|
|
pbrants wrote:
> OK, the #fopen statement should go into the init stuff, and what should I
> do to prevent the file being closed after the first frame? Otherwise
> stated, what is the sequence of #fopen read write append statements in the
> #if block? The documentation of POV mentions something like this: "You may
> open, read, write, append, and close plain ASCII text files while parsing
> POV-Ray scenes. This feature is primarily intended to help pass
> information between frames of an animation. Values such as an object's
> position can be written while parsing the current frame and read back
> during the next frame", but nothing is elaborated.
>
> Paul
>
The file WILL be closed at the end of the first frame.
So what you need to do is
#if(clock<=0)
[ whole bunch of init code here ]
#fopen FileHandle "FileWithInitData" write
#write(FileHandle, [all my data ])
#fclose FileHandle
#else
#fopen FileHandle "FileWithInitData" read
#read (FileHandle, [ all my data ])
#fclose FileHandle
#end
Keep in mind that whatever is written in the first block HAS to be read in the exact
same order in the second block.
However, sometimes it's far simpler to create an include file in the first block. The
second block then looks like this
#else
#include "PreviouslyCreatedFile"
#end
--
Ger
Post a reply to this message
|
|