|
|
> I have tried it in every possible way I can come up with and what I
> have found is that povray sometimes chokes on reading data while
> inside a #macro. Which indicates to me that povray does not handle
> #macros correctly. Another indicator to that is that shortly before
> it crashes the memory usage goes up strongly.
Well, thanks to a recent question by Thomas about Parse_String(), if
you absolutely need to include code on a macro, there is a workaround
using that function from strings.inc:
Write the include file like this:
#write(filehandle, "\"#declare CFS[",str(Count,0,0),"] = <", vstr(3,
CFS[Count], ", ", -1,-1),">;\",\n")
Then, instead using #include "data.inc", use a call to this macro:
#macro ParseInclude(IncludeFile)
#fopen filehandle IncludeFile read
#while (defined(filehandle))
#read (filehandle,IncludeLine)
#debug IncludeLine
#debug "\n"
Parse_String(IncludeLine)
#end
#fclose filehandle
#end
like this:
ParseInclude("data.inc")
Hope this helps...
--
jaime
Post a reply to this message
|
|