Copy link to clipboard
Copied
Hi,
I wanted to access gpudata during a PF_Cmd_EVENT call. My solution was to store the pointer to gpudata in a sequence_data (in a SmartPreRender call) and access that sequence_data during a PF_Cmd_EVENT. The issue is, it seems like the sequence_data between PF_Cmd_EVENT and PreRender differs ! or they might be out of synch ?
So generally, is there a way to modify and share consistently the sequence_data between PF_Cmd_EVENT and a SmartPreRender ?
thank you,
yeah... sequence data is separate on the render and ui threads. logic being that the render threads are free to render asychronously, without having their data (all project data, not just the sequence data) change under them from another thread.
you can find ways around it, but it's like that by design.
global data is shard between the render and ui threads, if that helps. though it's not instance-specific and is shared by all instances. if you have to identify data associated with some specif
...Copy link to clipboard
Copied
yeah... sequence data is separate on the render and ui threads. logic being that the render threads are free to render asychronously, without having their data (all project data, not just the sequence data) change under them from another thread.
you can find ways around it, but it's like that by design.
global data is shard between the render and ui threads, if that helps. though it's not instance-specific and is shared by all instances. if you have to identify data associated with some specific instance, you can have the render instances store their data along with some id (such as the comp item id + layer id + effect index on layer), so the ui thread can find the correct data it's looking for. (just use a mutex...)
Copy link to clipboard
Copied
Hey! Thx for the speedy answer! Silly me ... I always knew about the data separation between ui and rndr. I was (naively) hoping that PreRender was part of ui :-). So in my case i can store the gpu info in global data. As for per instance i can either put them in arb/hidden params to pass them from ui to rndr thread or use ur global data trick. Question, among your instance identification (comp item, layer index, instance id) which one is immune to layer reordering? Thx.
Copy link to clipboard
Copied
comp item id doesn't change thoughout the session. it can change between sessions, and if a project is imported into another then a new comp item id is assigned to the ones in the imported project.
layer id doesn't change in reordering. it can change, however, if the layer is copied to another comp, or cut/pasted back into the same comp. same goes for duplicating. i think a layer id might be re-used if a layer is deleted and a new one is created. in any case, layer ids are unly unique within one comp. the same id might be used for layers in different comps.
as for effect index, well... it changes when the effect is moved in the effect stack, but not when the layer is moved. you might have more than one instance of your effect on a layer.
in regards to writing data to an arb param, you can only do that from the ui thread. the render threads can not change the project at all, and that includes changing param values.