Immediately apply changes to AE from a plugin
Hello,
This is probably going to be difficult to explain, but here it goes.
I'm working on a plugin that has it's own UI. I want this UI to be open by a button, stay open and not block any functionality of After Effects. Then, I want to make changes to AE using my plugin's UI. Seems simple enough but...
There are a lot of ways to create a non blocking UI, and I decided to do it from the GeneralCallback. This was due to the fact that I need the AeData *aeData in order to make changes to the layer my plugin is working on. I make sure the GenericCallback is called from the IdleHook by using the following code:
A_Time currentTime;
suites.LayerSuite6()->AEGP_GetLayerCurrentTime(activeLayer, AEGP_LTimeMode_LayerTime, ¤tTime);
suites.EffectSuite3()->AEGP_EffectCallGeneric(gpid, effectRef, ¤tTime, PF_Cmd_COMPLETELY_GENERAL, nullptr);
The problem is that by using this method, changes made by my plugin are only applied when the IdleHook function is called (and consequently GeneralCallback), and this creates a bit of a lag between the the time I change something in the UI and the time it actually get changed in After Effects.
My plugin supports events, and I can immediately call a function upon change, but this way I can't actually make any changes to AE because I have no access to a AeData *aeData. Any other methods to change AE simply got discarded probably due to the fact that AE now has different threads for render and UI and those are synchronized periodically and not on demand.
So basically, using IdleHook I cannot make changes on demand, where should I create my UI, so I could apply these changes immediately after I change them, much like if an AE parameter it was?