|
Persistent data across Quartz evaluation cycles ?first variant of the question: Is there a way in Quartz/Javascript to save data between/across calls to a JS function? (other than using the Quartz Queue patch to save a structure) ( like some form of "static/global" variable ?) second variant: Other than writing a plugin in Objective-C (where presumably All Things Are Possible) , is the Queue the only mechanism for persisting data across Quartz evaluation cycles? Can Quartz read/write files?
|
First: stuff outside of the Main function in JS will persist across frames.
Second: the Queue is the only other way of storing data across frames. well, sample & hold is another, but it's relatively limited (limited to a single value per frame).
(virtual) Third: No, QC cannot write to files on its own. There are plugins that accomplish that in varying amounts.
Declaring the variables outside the main loop works in the JavaScript patch.
I thought at one point that a similar technique could be used to create feedback-type effects using JavaScript in a Core Image Filter patch, but sadly, it doesn't seem to be possible to have persistant __image variables in a CIFilter. Unless I'm missing something.
a|x
Haven't checked this but from my mental model i'll say that it does in fact 'save' the value. However the value is just a memory reference (or pointer) to where the image is being stored. The space where the image is being stored may have been used for something else by the next frame.
Well, that's my thought, i might look into that if i get some time.
Cheers
EDIT: fixed typo