Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Turn off sequentially

  • Turn off sequentially

    Posted by John Madison on September 26, 2012 at 5:03 pm

    HI guys,
    I would like your help on the following if possible.
    I have a set of layers and I want to have an animation where they turn off sequentially in the time line.
    So, let’s say I have 20 layers of a square (100×100) positioned on the screen from top to bottom so they appear as arranged boxes. I would like to animate them so that as the time moves forward, they start to disappear from top to bottom. I would also like to control the rate at which they disappear. I am talking about completely off (0 opacity) sequentially.
    Im thinking an expression with the index property of each layer and the opacity linked with the time will work, but how?
    Thanks

    Navarro Parker replied 13 years, 6 months ago 3 Members · 16 Replies
  • 16 Replies
  • Dan Ebberts

    September 26, 2012 at 5:25 pm

    It will probably be something like this, which should turn the layers off sequentially, starting at 1 second and then every .25 seconds:

    tStart = 1;
    tDelay = .25;
    time >= (tStart + (index-1)*tDelay) ? 0 : value

    Dan

  • John Madison

    September 26, 2012 at 5:59 pm

    Thanks,

    How would i go about reversing it if possible, so that the bottom layer goes off first instead of the top layer?

  • Dan Ebberts

    September 26, 2012 at 6:05 pm

    If all layers in the comp are participating, it would be like this:

    tStart = 1;
    tDelay = .25;
    time >= (tStart + (thisComp.numLayers – index)*tDelay) ? 0 : value

    Dan

  • John Madison

    September 28, 2012 at 6:17 pm

    Thanks Dan!

    I thought I had it, but not quite! What I wanted was the layers to turn on sequentially and then off again sequentially.

    So in the set-up, I have 20 layers arranged top to bottom. I would like them to turn on one by one and then once all are on, they start to go off again sequentially.

    I thought the expressions above would do it with some tweeking but finding it really difficult!

  • Dan Ebberts

    September 28, 2012 at 10:32 pm

    Like this maybe:


    tStart = 1;
    tDelay = .25;
    if (time < tStart + thisComp.numLayers*tDelay)
    time >= (tStart + (index-1)*tDelay) ? value : 0
    else
    time >= (tStart + (thisComp.numLayers + index-1)*tDelay) ? 0 : value;

    Dan

  • John Madison

    September 29, 2012 at 4:01 pm

    Many thanks Dan, but its still not quite what i wanted. I should’ve explained better.

    I want them to turn on from bottom up and then turn off immediately after from top down.

  • Dan Ebberts

    September 29, 2012 at 6:22 pm

    Try this:


    tStart = 1
    tDelay = .25;
    if (time < tStart + thisComp.numLayers*tDelay)
    time >= (tStart + (thisComp.numLayers-index)*tDelay) ? value : 0
    else
    time >= (tStart + (thisComp.numLayers + index-1)*tDelay) ? 0 : value;

    Dan

  • John Madison

    September 29, 2012 at 11:51 pm

    perfect!

  • Navarro Parker

    October 1, 2012 at 10:34 pm

    How about an expression where all layers start out visible. Then sequentially, each layer blinks off then comes back on before the next one blinks off, then back on.

    such as this:

  • Dan Ebberts

    October 1, 2012 at 10:58 pm

    Something like this maybe:


    tDelay = .3;
    tOff = .1;
    tOn = .2;

    idx = Math.floor((time - tDelay)/(tOff+tOn));
    if (idx == (index -1))
    if ((time - tDelay)%(tOff+tOn) > tOff) value else 0
    else
    value

    Dan

Page 1 of 2

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