Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Control Opacity of multiple layers with 1 Slider Controller

  • Control Opacity of multiple layers with 1 Slider Controller

    Posted by Alexandru Costiug on April 4, 2016 at 2:04 pm

    Hello, I’ve been searching forums but haven’t found a solution to my problem.

    I have 10 shape layers and each layer is at 2inch distance from another ( more like an extrusion ). When I move the Slider Controller to value 5 for example, I want only the first 5 layers to be visible. If i move to value 10, all the layers should be visible.

    Maybe you understand better if I explain like this :
    if(slider value==x) ;all layers <=x opacity==100 else 0.

    Kalleheikki Kannisto replied 10 years, 1 month ago 3 Members · 3 Replies
  • 3 Replies
  • Miguel De mendoza

    April 4, 2016 at 2:54 pm

    Lets say you name the layers like “shape_1”, “shape_2”, etc… You can write this on the opacity:

    sliderValue = //Your link to the slider
    nameSplit = name.split("_");
    shapeNum = nameSplit[nameSplit.length - 1];
    if (shapeNum <= sliderValue) {
    value = 100;
    } else {
    value = 0;
    }

    You can reference the shape layers by index to, but this is a way to fix your referenceing.

  • Alexandru Costiug

    April 4, 2016 at 3:04 pm

    Thank you very much sir !

  • Kalleheikki Kannisto

    April 4, 2016 at 6:21 pm

    [Miguel de Mendoza] “this is a way to fix your referenceing.”

    Good tip, thanks!

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