Skip to main content
Known Participant
August 25, 2008
Question

Effect depends on Position, Rotation, Scale of the Layer

  • August 25, 2008
  • 5 replies
  • 2878 views
Hi,

I'm creating an effect that depends on the Transformation values (Pos, Rot, scale) of the Layer which the effect is applied. So whenever the user moves the Layer around, the effect needs to be updated.

I've set the flag PF_OutFlag_NON_PARAM_VARY during global setup.
But the PF_Cmd_RENDER is only called when I drag the timeline, not when I move the Layer around.

Any solution?

Thanks
This topic has been closed for replies.

5 replies

Community Expert
October 28, 2008
this solution is a bit shady, but it will do the job.
add another parameter, say, a slider.
using AEGP_setExpression apply to that slider an expression like this:
"position[0] + scale[0] + rotation + anchorPoint[0]"
then, using AEGP_dynamicStreaSuite, make that slider invisible.

so what to you get?
you get a parameter that the user is unaware of, that calls for your plug-in to render automatically whenever the user changes the position, rotation, scale or anchor point.

I hope it helps you,
it worked for me.
:-)
Inspiring
October 23, 2021

13 years later, your posts are still useful. Thanks shachar

Bruce Bullis
Community Manager
Community Manager
October 28, 2008
You can't; there's no method for effects to identify such dependencies.
Participant
October 15, 2008
Hello Brooce,

If the effect params do not change, would it be possible to redraw when only the layer properties change?

Your solution above mentions that we can use parameter supervision to get a callback into the effect plugin.
But I only know how to set supervision for effect params, how can we do this for the layer that the effect is applied to?

Thanks!
Chia
Known Participant
October 3, 2008
Hi brooce, Thanks for the tips. I'll try it and hopefully it'll work.
Bruce Bullis
Community Manager
Community Manager
September 23, 2008
AE doesn't have a method for effects to identify such dependencies. Your best bet is to use parameter supervision (see the Supervisor sample), and check the xform values during PF_Cmd_FRAME_SETUP. If the values your plug-in was using are now stale, save the fresh values, and cancel out of the render. You'll be called to render again, with your fresh values.

Setting a bunch of breakpoints in a debugger will teach you more about param supervision than reading ever will. :)