Copy link to clipboard
Copied
Hi,
From my understanding, sequence data is sent to rendering thread using flattening mechanism. I honor the calls: PF_Cmd_GET_FLATTENED_SEQUENCE_DATA and PF_Cmd_SEQUENCE_RESETUP.
If I get it right, the first one performs flattening and the second the unflattening. It works well with save/load projects but somehow, PreRendering and SmartRendering do not trigger the flattening and thus,
their copy of data sequence is invalid. am I missing something ? what makes PreRender call the data flattening ? thank you
to force a sync of the sequence data you have to have user interaction that would trigger a USER_CHANGED_PARAM or click/drag event in a custom ui. otherwise, either use an arb param (which creates undo entries and immediate invalidation of cached frames), or devise some other way to transfer data to the render thread. for example, place instructions in the global data sctucture which is common to both threads, and have the render thread check for messages there. that's not an easy route, but if
...Copy link to clipboard
Copied
the sequence data gets synced between the UI thread and render thread on very specific times. (and only UI to render, not the other way around).
it happens when a new instance is being created, and on specfic UI events as noted in the docs:
"FORCE_RERENDER doesn’t work in every situation it did before, because it needs to
synchronize the UI copy of sequence_data with the render thread copy.
FORCE_RERENDER works when set during PF_Cmd_USER_CHANGED_PARAM. It
also works in CLICK and DRAG events, but only if
PF_Cmd_GET_FLATTENED_SEQUENCE_DATA is implemented. "
yes, it's an issue. i'd recommend devising a mechanism that doesn't require syncing at tother times, because it can get CRAZY hard to do without caveats.
consider using an invisible arb param which gets synced on every change, if applicable to your design...
Copy link to clipboard
Copied
Thank you ! I ended up synching part of my data via hidden arb. But just to make sure, can you confirm that the sequence data is "transported" from ui to render thread via PF_Cmd_GET_FLATTENED_SEQUENCE_DATA mechanism ? thx.
Copy link to clipboard
Copied
it is PART of that mechansim, that must be supported in order to comply with the new sequence_data scheme, but as far as i recall, it doesn't have to happen through PF_Cmd_GET_FLATTENED_SEQUENCE_DATA. this new selector came to deal with an old ail where you'd have to get rid of your unflat data inorder to send the flat copy, which would in turn force the plug-in to unflatten the data back again. even when a plug-in supports PF_Cmd_GET_FLATTENED_SEQUENCE_DATA, not flatten calls use this selector. so i'm can't tell you that for sure every sync operation goes through that instead of PF_Cmd_SEQUENCE_FLATTEN.
why does this certainty matter to you? do you rely on it?
Copy link to clipboard
Copied
Because I wanted to persist an object from ui to rendering thread. I thought it was a good idea to serialize/deserialze the object using seq_data.
Copy link to clipboard
Copied
to force a sync of the sequence data you have to have user interaction that would trigger a USER_CHANGED_PARAM or click/drag event in a custom ui. otherwise, either use an arb param (which creates undo entries and immediate invalidation of cached frames), or devise some other way to transfer data to the render thread. for example, place instructions in the global data sctucture which is common to both threads, and have the render thread check for messages there. that's not an easy route, but if you must, then you must...
Copy link to clipboard
Copied
Nice hints ! thank you. Last question, if I handle PF_Cmd_GET_FLATTENED_SEQUENCE_DATA call , do I still have to handle PF_Cmd_SEQUENCE_FLATTEN ? (suppose that I am not looking for bwd compatibility). thank you again.
Copy link to clipboard
Copied
yes, you still have to. 😞
the new call is used on some occasions, and the old on others. the transition to the new mechanism has not yet been completed.
Copy link to clipboard
Copied
thx alot for your help.
Copy link to clipboard
Copied
I was setting sequence data in changed UI callback and it was not visible in render callback. This thread helped me figure out my error. Thanks