Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Using Layer control to select particular layers.

  • Using Layer control to select particular layers.

    Posted by Justin Maloney on March 30, 2015 at 3:30 pm

    Hey there, I’m trying to make a Layer Control box that can switch which layers are visible (say flip the selected layer’s opacity from “0” to “100”)

    I’m also trying to control the layers in a pre-comp, from a master comp.

    For example:
    I have a Master Comp with a Pre-Comp imbedded. And a Null object (named “Shape Selector”) with the layer control.

    Inside the Pre-comp, I have the layers I’d like to switch between. (“Circle”, “Square”, and “Triangle”)

    Is an expression that lets me switch between the shape layers in the pre-comp, from the Master Comp, even possible?

    Thanks very much in advance =D

    Justin Maloney replied 11 years, 5 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    March 30, 2015 at 4:27 pm

    The layer control dropdown only lists the layers in the comp with the control, so it wouldn’t work across comps.

    Dan

  • Dan Ebberts

    March 30, 2015 at 6:05 pm

    I think the best you could do is maybe use a slider control in the Master Comp and then use an expression like this on the opacity of the shapes in the pre-comp:

    if (Math.round(comp(“Master Comp”).layer(“Shape Selector”).effect(“Slider Control”)(“Slider”)) == index) 100 else 0

    Dan

  • Justin Maloney

    March 31, 2015 at 8:09 pm

    That could work. But the other animators I’m making this for would be thrown for a loop for with a control like that. It was for a character rig I’m building. I wanted to make it so they could easily select a different hair style, nose style, wardrobe, etc, with drop down boxes. I stuck with check box controls for each option.

    thisComp.layer(“Hair Styles”).effect(“Emo Swoosh”)(“Checkbox”) *100

    But I’ll keep what you showed me in mind for other things =D

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy