|
|
stbenge schrieb:
>
> I don't :/ My program simply writes to an .inc file every time an arrow
> key is pressed. I might be able to optimize this by writing only once if
> a key is still being pressed.
You might do it as follows:
- In your program, update the .inc file only after verifying that a
certain "acknowledge marker" ("ACK") file does exist; after having
written the .inc file, have the program delete the ACK file.
- In your scene file, use the file_exists() function to check whether
the ACK file does exist; if not, include the .inc file, then use
#fopen/#write to generate/overwrite a temporary .inc file to contain the
very same data, and after that use the same mechanism to create the ACK
file. If however the ACK file does exist already, simply include the
temporary .inc file instead.
I think that should do the trick without conflicts.
Make sure to init the system properly (e.g. by making sure the ACK file
is not present, and the main .inc file exists and has some content that
makes sense), and to provide for a way to recover in case the system
should become "stuck" for some unexpected reason (e.g. time out if the
POV-Ray script fails to create the ACK file in due time; you can also
put the current frame number into the temporary .inc file and cross
check, to create a timeout mechanism on the POV-Ray side in case the
program fails to clear the ACK file at regular intervals)
Post a reply to this message
|
|