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

Where to perform long calculations and Compute Cache vs sequence_data?

Participant ,
May 08, 2021 May 08, 2021

Copy link to clipboard

Copied

TLDR: Where should I perform long calculations for filling sequence_data, given that sequence data is read only in the render thread and I don't want to hang the UI thread? Should I just ditch sequence data in favour of the new compute cache (as it can be written to in the render thread) or will I be waiting some time for AE users to update to an AE version which supports compute cache?

 

Longer version

 

Basically I'm doing something similar to françois_leroy in this thread:

Solved: Sequence_data different in PF_Cmd_RENDER and PF_Cm... - Adobe Support Community - 8279390

Having read the documentation on sequence_data and getting at least as confused as francois I came hunting on the forum and I'm glad I found his question.

 

In terms of sequence data - transfer is only one way - from the UI thread to the render thread. I had assumed that in the render thread I could do my long physics calculations without the UI becoming unresonsive and I could do them incrementally as later frames get rendered. But given the data flow is only one way, this isn't possible, so I'm not sure where to do my physics calculations without the UI becoming unresponsive.

 

In the latest SDK, it seems compute cache has been brought in to (eventually) replace Sequence_data. It looks like this is a better system all round and it can be called in the render thread. However, am I correct in assuming that it will only be available in the latest version of AE? Will I need to support (and learn to use) both Sequence_data and ComputeCache while everyone catches up?

 

Thanks

Phil

TOPICS
SDK

Views

631

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 ,
May 08, 2021 May 08, 2021

Copy link to clipboard

Copied

question: if you need to calculation done only for rendering and only during render time, why bother storing it in the UI copy of the sequence data? you could calculate it during render time and suffice with having it shared beween the different render threads.

am i making false assumptions here?

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
Participant ,
May 08, 2021 May 08, 2021

Copy link to clipboard

Copied

Hi Shachar

That is something that I had considered - but it seems like I am essentially reinventing the compute cache.

Compute Cache seems like an excellent new feature for exactly this scenario - assuming my users will have support for itin their version of AE.

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
Participant ,
May 08, 2021 May 08, 2021

Copy link to clipboard

Copied

And I would also have to keep track of the different instances of my plugin, because the calculations would depend upon the values of the controls - even with a single render thread, isn't this therefore just reinventing the sequence_data?

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
Participant ,
May 08, 2021 May 08, 2021

Copy link to clipboard

Copied

Oh, have I missunderstood the sequence_data across threads?

I was thinking that the sequence data was read only - but are you saying that I can modify the sequence data in the render thread, and then it will remain in the render thread for future render calls? I seem to remember reading in the docs or in a post here that sequence data is synced "only at specific instances". Surely if it is synced at any instance, then my sequence data is at risk of being wiped out - or are those specific instances well documented somewhere?

 

Sorry for the multiple replies. Various pennies are slowly dropping in my brain (hope that phrase makes sense in your part of the world!)

 

Phil

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
Participant ,
May 08, 2021 May 08, 2021

Copy link to clipboard

Copied

read only in the render thread that is

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 ,
May 08, 2021 May 08, 2021

Copy link to clipboard

Copied

LATEST

it's read only in the sense that you can't change the memory handle passed in the in_data with a new one in the out_data. that's by design so the different threads could simultaneously read it, worry free. as for it's content, it's up to you. you'll need to make sure the different threads don't step on each other's toes though...

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