|
|
in news:3f1e657d$1@news.povray.org Torsten Crass wrote:
><sigh>if it must be...</sigh> I was just hoping I could use the same
> macros for creating both .inc files and ready-to-use objects for my
> scene.
>
I may be misunderstanding you sihgs, but you can use one macro/inc-file
for that.
#macro SomeMacro (a,b,c, FileName)
....
....
#if(file_exists(FileName))
#include FileName
#local WriteFile=0;
#else
#if(strlen(FileName)!=0)
#local WriteFile=1;
#fopen GeneratedObjectsFile FileName write
#else
#local WriteFile=0;
#end
#end
....
....
// generate an object here,
// use the WriteFile variable to check
// wether it should be written to file or not
#end
When you call the macro with a FileName="" no file will be written.
When you call a macro with a FileName="something" it will be checked
wether the file already exists. In that case the existing file will be
parsed. If it doesn't exist a new file will be written.
Ingo
Post a reply to this message
|
|