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

UI and Render Threads Not in Sync in CC2015+

Engaged ,
Nov 15, 2016 Nov 15, 2016

My plugin is a modular effect, similar to Plexus, in that there is a main render effect, and a number of UI-only effects that provide data to the render effect (I've posted about this on a number of other occasions!).

When you apply the Renderer effect from the effects and presets panel, it uses Sequence Setup to automatically add the default data effects, so you end up with:

Module Selector (added automatically)

Builder (data effect - added automatically)

Instancer (data effect - added automatically)

Renderer (render effect - added manually)

This all works perfectly in AE pre CC2015, but in CC2015+ I get a bunch of After Effects error: internal verification failure, sorry! {invalid index in indexed group} errors, and the effect fails to render.

The reason for this seems to be that the UI and render copies of the project are not in sync. Indeed when I debug Smart Render, when it loops through the layer effects to gather the data it only finds the render effect, and none of the data effects. With no data, it renders nothing.

Now, if I save the project, close it and reopen it, everything works as expected, so the problem is limited to first applying the effect.

Any thoughts on how I can sync up the two threads?

Thanks, Christian

TOPICS
SDK
1.8K
Translate
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 , Nov 15, 2016 Nov 15, 2016

the sequence setup is not a rather dodgy time to modify the layer your

effect is being applied to...

i would suggest utilizing an AEGP with an idle hook. do all your effect

adding during that time.

Translate
Community Expert ,
Nov 15, 2016 Nov 15, 2016

the sequence setup is not a rather dodgy time to modify the layer your

effect is being applied to...

i would suggest utilizing an AEGP with an idle hook. do all your effect

adding during that time.

Translate
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
Engaged ,
Nov 15, 2016 Nov 15, 2016

How would that work?

Does the AEGP need to be a separate plugin, or can it be bundled with the effect plugins? Currently I have one .aex/.plugin file, and that by use of multiple PiPL entries contains five separate effects. I'd rather not (if possible) have to write an installer...

But by the by, if I have an AEGP, what does it do? Wait for an effect to be added to a layer, and if it matches my plugin's match name, apply the additional effects?

Thanks.

Translate
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 ,
Nov 15, 2016 Nov 15, 2016

i vaguely remember there's something about it in the SDK guide... i think

that if you're to add an AEGP plug-in to the same binary as effect, the

PiPL of the AEGP must be the first one.

anyways, i think you can setup an idle hook from the global setup of you

plug-in, but i'm not 100% sure. i use a separate AEGP plug-in for that.

when your effect is applied it can set a flag (either with the AEGP or the

global data) that there's a pending operation. once you hit the idle hook,

you can check that flag and continue the process.

heck, you can even leave the detail for what layer to add the effects to.

On Wed, Nov 16, 2016 at 12:26 AM, Christian Lett <forums_noreply@adobe.com>

Translate
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
Engaged ,
Nov 16, 2016 Nov 16, 2016

Interesting.

So, I'd need to tell the AEGP there's a pending operation from the effect's Sequence Setup, which would involve populating a data structure with, say, a layer handle and some other info? This data needs to be accessible from the effect plugin and the AEGP, but where does the data live? There's the global_refconPV that's passed when you use AEGP_RegisterWithAEGP() in the effect plugin's Global Setup, but as you're not referencing a specific AEGP (and the refcon is global), how is the structure of this global refcon defined?

Thanks, Christian

Translate
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 ,
Nov 16, 2016 Nov 16, 2016

that refcon is whatever you want it to be. pass a pointer to something,

and AE will pas that something to your idle hook function.

you'd probably want that something to be your data bank.

Translate
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
Enthusiast ,
Nov 16, 2016 Nov 16, 2016

Hi Christian,

I've been working on a modular plugin too, and got the same kind of problem.

What about forcing a re-render of the first effect (Module Selector) once all the effects have been applied?

I guess 1st effect would synch, then trigger a render of 2nd... and so on.

What about applying the effects in reverse order? first effect will be applied last and probably re-render all the chain...

And, do your different effects communicate via AEGP_EffectCallGeneric() or via their outputs?

Cheers,

François

Translate
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
Engaged ,
Nov 16, 2016 Nov 16, 2016

Hi Francois,

All my effects communicate via AEGP_EffectCallGeneric(). I looked into using a cumulative output chain type thing, but couldn't find a suitable way to render into hidden channels.

Shachar, So I think the AEGP method will work - I just need to figure out how to populate the data for the idle hook to receive.

In my AEGP entry point I can set the global_refcon parameter as a void pointer to a struct e.g.

MyStruct ms;

ms.my_flagB = FALSE;

global_refconPV = (void*)&ms;

In my effect plugin's Global Setup, when I register with AEGP, I'm assuming that what it passes in the AEGP_GlobalRefcon parameter is what I set in the AEGP entry point? Do I need to get cast the AEGP_GlobalRefcon parameter to a static copy/GlobalData in my plugin code, which I can then manipulate elsewhere (e.g. SequenceSetup)?

Cheers, Christian

Translate
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
Enthusiast ,
Nov 16, 2016 Nov 16, 2016

I looked into using a cumulative output chain type thing, but couldn't find a suitable way to render into hidden channels.

I have one plugin working this way:

1st instance renders output with usefull data (in fact, just a ramp representing coordinates) and sends its input to 2nd instance via AEGP_EffectCallGeneric()

Distortion effects alter this ramp.

2nd instance uses the ramp as an input, and receives also 1st effect's input, then map it according to ramp's coordinates.

It's pretty easy as long as you don't shrink or extend the output buffer. If you do, it becomes a nightmare! 😉

I don't know if it can help...

Cheers,

François

Translate
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
Engaged ,
Nov 16, 2016 Nov 16, 2016

Thanks, but I've got it working very well (and fast) using the data only method. The potential downside is that every data effect requires a copy of input to output, but that's a negligible cost. The upside is that rendering happens in one place, and I've managed to highly optimise it to render very quickly on CPU only.

The only issue I have with it is the initial adding of the data effects when first applying the plugin on CC2015 and above. Other than that it's ready to go!

Cheers, C

Translate
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 ,
Nov 16, 2016 Nov 16, 2016

yes, the data you get in the pointer is the one passed while registering

the idle hook. however, since it's a pointer... the content of that pointer

is dynamic.

a good way to talk to an AEGP is using a custom suite, as demostrated in

the "checkout" and "sweety" sample projects. it will allow you to sent and

receive data to and from the AEGP.

Translate
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
Engaged ,
Nov 17, 2016 Nov 17, 2016

The AEGP solution (custom suite + idle hook) worked brilliantly, thanks.

BTW, you can't mix AEGP and Effect Plugins in the same binary. At least I couldn't get it to work that way.

Christian

Translate
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
Engaged ,
Nov 18, 2016 Nov 18, 2016

So, everything is working properly on MacOS.

However on Windows my AEGP isn't working. It builds OK and produces a .aex file, but my main plugin returns a Missing Suite error when it attempts to access the custom suite. Debugging also fails to work, so I'm assuming AE has ignored the plugin on load.

Is there a specific location that AEGP plugins need to live on Windows? On Mac, both my AEGP and effect plugins are loose in the Plugins/Effects/quarterlight_pictures folder, and it works.


Thanks.

Translate
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
Engaged ,
Nov 18, 2016 Nov 18, 2016
LATEST

All sorted now. Was the dreaded PiPL.rc file - for some reason the Visual Studio project didn't have the line to import the .rc.

Translate
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