• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

After Effects sequence data synch prerender and PF_Cmd_EVENT

Community Beginner ,
Jan 23, 2024 Jan 23, 2024

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,

TOPICS
SDK

Views

225

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 24, 2024 Jan 24, 2024

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

...

Votes

Translate

Translate
Community Expert ,
Jan 24, 2024 Jan 24, 2024

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...)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 24, 2024 Jan 24, 2024

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. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 31, 2024 Jan 31, 2024

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines