Copy link to clipboard
Copied
Hi everyone!
My question is about triggering of events and different changes by plugin. I'll divide my question into three small parts.
1. First of all, I want to make my plugin dependent on camera. For this I use PF_OutFlag2_I_USE_3D_CAMERA flag. When I add a camera or change some camera parameters (anchor point, position, zoom...), it causes rerendering and this is what I want. But when I'm trying to change another parameters (for example, focus distance) nothing happens. What may be the reason for such behavior?
2. More generally, is it possible to make plugin dependent on arbitrary element from the composition (and rerender when this elment changes)?
3. Is there in AE a general way for arbitrary event triggering? For example, now I have rerendering on camera change. But I also want to do another work on camera charge (once but not for each frame). Ideally I'm looking for something like OnSomeElementChange(...) event in order to do some work on this event.
Thanks,
Ilya
1 Correct answer
Hi Ilya,
as far as I know, there is no 'general' way of doing it (or if there is one, I'm interested too!), but there are several work arounds:
The most common is to create a light, and attach it to the layer you want your plugin to depend on. Then if you set the PF_OutFlag2_I_USE_3D_LIGHTS flag, you'll receive a call everytime this light changes.
The good point is you can use this light to react to almost anything in the comp (by setting some expressions, for example linking some parameter to your
...Copy link to clipboard
Copied
Hi Ilya,
as far as I know, there is no 'general' way of doing it (or if there is one, I'm interested too!), but there are several work arounds:
The most common is to create a light, and attach it to the layer you want your plugin to depend on. Then if you set the PF_OutFlag2_I_USE_3D_LIGHTS flag, you'll receive a call everytime this light changes.
The good point is you can use this light to react to almost anything in the comp (by setting some expressions, for example linking some parameter to your camera's focus distance).
The bad point is you'll end up with a light in your comp when you may want to avoid it...
Another way to check for changes is to check for IdleHook. You'll receive a call everytime AE does 'nothing', i.e. right after anything happens. When receiving this call, you can check for any change in the composition that occured since last time you've checked...
So, to make it short, the 'Light' way is pretty easy but inelegant, the 'Idle' way is more complicated to implement, but invisible to user.
Hope it helps!
Cheers,
François
Copy link to clipboard
Copied
iliyachi wrote
But when I'm trying to change another parameters (for example, focus distance) nothing happens. What may be the reason for such behavior?
Could it be that the camera's depth of field is not turned on? I noticed that you can still change the focus distance of a camera even though the DoF is off. I think this particular parameter only has any effect if DoF is turned on. So AE won't send your effect a render command as there's no cache invalidation happening.
Copy link to clipboard
Copied
Thanks, Francois and Christian, your answers are very helpful for me!
Christian, you were right, depth of field was turned off and this fact was the reason of the described behavior. Sorry, I don't have an option for marking your answer as correct too...))
Thanks Francois again for such detailed description of dependency problem. It's very interesting to try both variants.
Ilya.

