FORUMS: list search recent posts

Expression to make only one of several layers in a pre comp visible

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Brian Speight
Expression to make only one of several layers in a pre comp visible
on Jul 21, 2014 at 7:17:08 pm

I'm an expression newbie and this forum has been invaluable. Unfortunately, I haven't found an answer for my issue below:

Basically, I have a pre comp with 3 layers that is being controlled by a null in my main composition. I only want to be able to see 1 of the 3 layers at any particular time and I'd like to be able to control which of the 3 is visible from my main comp via the null.

Ideally, it would be something like the layer control where I would have a drop down with the 3 layers listed. I could then choose the layer I want to be visible and have that generate the keyframe.

I've seen how to do this with 2 layers in the pre comp via the slider control but I can't see how to adapt that to choosing between 3 layers.

Thanks!


Return to posts index

Dan Ebberts
Re: Expression to make only one of several layers in a pre comp visible
on Jul 21, 2014 at 7:32:33 pm

You can use a slider control like this:

s = comp("Main Comp").layer("controls").effect("Slider Control")("Slider");
(Math.round(s) == index) ? 100 : 0


If the slider control value rounds off to 1, layer 1 will be visible, etc.


Dan



Return to posts index

Brian Speight
Re: Expression to make only one of several layers in a pre comp visible
on Jul 21, 2014 at 7:57:40 pm

Perfect!
That is going to really help me to simplify this prototype.

Thanks very much!

Brian


Return to posts index

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