ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

If Else statement targeting index from pop up controller

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Christian Simpson
If Else statement targeting index from pop up controller
on Oct 10, 2017 at 7:37:28 pm

Hey I was wondering if it's possible for an if else statement to target an index from a popup controller? I am trying to have a pop up controller be used to display a specific layer in a pre-comp. I was thinking I need to target the opacity parameter. Is this possible and if so how would you write that?


Return to posts index

Dirk de Jong
Re: If Else statement targeting index from pop up controller
on Oct 10, 2017 at 9:24:15 pm

[Christian Simpson] "I was wondering if it's possible for an if else statement to target an index from a popup controller?"

Yes, I've recently started doing that.

[Christian Simpson] "I was thinking I need to target the opacity parameter. Is this possible and if so how would you write that?"

something like this applied to Opacity parameter
if (comp("COMP NAME").layer("LAYER NAME").effect("EFFECT NAME")("POPUP PARAM")==1) 100 else 0;

the popup menu choices start at 1 as the topmost and 2 as the next down etc. so with the above expression the layer would be transparent unless the popup menu was set to the first choice (==1)

== is equal to and of course you can use other comparison operators as well (<, >, <=, >=, !=)


Return to posts index

Dirk de Jong
Re: If Else statement targeting index from pop up controller
on Oct 10, 2017 at 9:46:36 pm

BTW, using this as a method for disabling layers I've found that making a layer's Opacity zero is not exactly the same as actually disabling the layer by clicking the little eyeball button in the timeline as far as performance optimization goes - maybe this is already widely known - but it's unfortunate - I would kind of hope that if Opacity was zero (with no interpolation etc.) that it would be no slower than the disabled layer. In my case there were several effects applied to the transparent layer and those effects had expressions applied and those expressions were being triggered while adjusting the comp (so the parameters of the effects on the transparent layer were changing) - but that was also true with the eyeball turned off and it was much faster to adjust the comp with the truly disabled layer than the enabled but fully transparent layer - it seems like an unexploited possibility for an optimization in AE

also it might be nice if AE allowed for expressions to apply to a Layer's enable/disable switch, a Layer's Blend Mode, etc.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]