|
|
Hi,
Does anyone know of a way to see the parsed SDL for a scene ( if it
actually gets created at all ). I know that the base SDL I've typed in gets
parsed, and was wondering if POV-Ray engine internally generates an
intermediate SDL file in memory. If it does, I'd like to output it.
For instance, if I have a macro that generates 100 spheres, is there ever a
version of the SDL that contains 100 sphere definitions?
--
#####-----#####-----#####
POV Tips and Hints at ...
http://povman.blogspot.com/
Post a reply to this message
|
|
|
|
POVMAN wrote:
> For instance, if I have a macro that generates 100 spheres, is there ever a
> version of the SDL that contains 100 sphere definitions?
No. You're probably used to other programming languages (C++, for
instance) that have a separate preprocessor and compiler. In POV-Ray,
SDL files get "compiled" at the same time as being "preprocessed". So,
macro substitution occurs as the file is being evaluated.
It would be simple (but tedious) to insert #debug statements into your
code to let you know what's going on. For instance, in your macro that
generates 100 spheres, you could do:
#debug "Macro generating 100 spheres...\n"
-or-
#local c_x = str(sphere_center.x, 0, 0);
#local c_y = str(sphere_center.y, 0, 0);
#local c_z = str(sphere_center.z, 0, 0);
#debug concat("Macro generated sphere at ", c_x, ", ", c_y, ", ", c_z, "\n"
...Chambers
Post a reply to this message
|
|
|
|
POVMAN <s### [at] acom> wrote:
> Does anyone know of a way to see the parsed SDL for a scene ( if it
> actually gets created at all ). I know that the base SDL I've typed in gets
> parsed, and was wondering if POV-Ray engine internally generates an
> intermediate SDL file in memory. If it does, I'd like to output it.
The current SDL parser is a very direct interpreter: It immediately acts
upon the commands it parses, without converting nor saving them anywhere.
(The only exception are the user-defined functions, which use their own
separate parser and interpreter which works quite differently. There might
have been some obscure trick to get the byte-compiled functions printed,
but I don't remember at all how it might have been done... :P )
--
- Warp
Post a reply to this message
|
|