Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Stagger opacity

  • Posted by Judy Ranelli on April 24, 2015 at 5:38 pm

    I’m new to expressions and playing with staggering the opacity from 0-100 on 80 layers, with keyframes on the 1st layer. Not working. Any suggestions?

    m=thisComp.layer(1).marker.key(1)time - thisComp.layer(1), inPoint;
    thisComp.layer(thisLayer,-1).transform.opacity.valueAtTime(time-M);

    Layer 1 has two keyframes, 0 opacity at frame 1 and 100 opacity at frame 30.

    Ilya Sire replied 11 years ago 3 Members · 6 Replies
  • 6 Replies
  • Dan Ebberts

    April 24, 2015 at 6:59 pm

    Your expression has a few issues. What are you trying to do exactly (e.g. what do you mean by “stagger opacity”)?

    Dan

  • Judy Ranelli

    April 24, 2015 at 7:02 pm

    I want layer 1 to go from 0 to 100 opacity over time of 1 second. and once layer one is at 100% opacity then layer 2 would go from 0 to 100 opacity and so forth through the rest of the layers.

  • Dan Ebberts

    April 24, 2015 at 7:14 pm

    There are a number of ways to approach it, but one way would be to give each layer this opacity expression:

    dur = 1; // 1 second
    tStart = (index – 1)*dur;
    tEnd = tStart + dur;
    linear(time,tStart,tEnd,0,100)

    Dan

  • Judy Ranelli

    April 24, 2015 at 7:26 pm

    Is there a way to make the expression so that if I adjust the keyframe timing on layer 1, it adjusts for the other layers? For instance if I made the opacity on layer 1 go from 0 to 100 over 45 frames instead of 30… then the timing on the other layers adjusts as well?

  • Dan Ebberts

    April 24, 2015 at 7:37 pm

    Something more like this, probably:


    p = thisComp.layer(1).transform.opacity;
    if (p.numKeys > 1){
    dur = p.key(p.numKeys).time;
    tStart = (index - 1)*dur;
    t = time - tStart;
    p.valueAtTime(t);
    }else
    value

    Dan

  • Ilya Sire

    July 14, 2015 at 9:01 am

    Hi Dan, i found this code and how can i make this from 0% and 100% after second variable? Not like fade in just On Off opacity.

    Thank you
    Sire

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