Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Linking slider amount to index

  • Linking slider amount to index

    Posted by Matt Newt on March 11, 2019 at 2:35 am

    I may have an impossible question. I have a very simple expression to control the visibility of layer duplicates using a slider. The null layer with the slider is layer #1, hence the “index-1” in the expression.

    slider=thisComp.layer("controls").effect("Number of Duplicates")("Slider")

    if(slider>=index-1){100}
    else{0}

    So…say I wanted to add another layer at the top. Is it possible to make it so regardless of what the index numbers are, the number of layers at 100 % opacity will match the slider amount? I’m not sure if using “index” will even work, or if maybe there’s another condition I could add to the expression?

    I also realize I could just move the null below the other layers or to another comp entirely, but honestly I just want to know if this is possible. I’m new to expressions so it’s interesting to learn new ways of doing things.

    Thanks!

    Kalleheikki Kannisto replied 7 years, 6 months ago 2 Members · 1 Reply
  • 1 Reply
  • Kalleheikki Kannisto

    March 11, 2019 at 4:25 pm

    From what I can tell, your code should work for that just fine, making the top X layers transparent (as long as the expression is applied to the transparency in every one of them), skipping — or including — the controls layer, since you’re actually including (slider value + 1) layers into it. Or is it not doing that?

    Kalleheikki Kannisto
    Senior Graphic Designer

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