Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression help

  • Posted by John Harcus on February 22, 2006 at 9:02 pm

    I need an expression that cuts between the layers of a comp for a fixed period of time. Very simular to motionscript’s random stills example, however without the random(ness). It seems like an easy thing to tweek. I’m not good with expressions, I have a tiny brain…and now it hurts. Thanks.

    John Harcus replied 20 years, 2 months ago 2 Members · 2 Replies
  • 2 Replies
  • Colin Braley

    February 22, 2006 at 10:46 pm

    Your first step is to create a null called “Controller”. Add an expression control slider to it and name that slider “curr layer”. Add the following expression to that slider:

    duration = .5; //length of each cut in seconds
    numLayers = 4;//Number of layers you want to switch between
    //These layers must be the uppermost layers in the comp
    (Math.floor(time/duration) + 1 ) % numLayers + 1

    Modify the duration and numlayers variables as necessary. Next, add the following expression to the opacity property of the layers you would like to switch between:

    v = thisComp.layer(“Controller”).effect(“curr layer”)(“Slider”);
    if(index == v)
    100
    else
    0

    Well, that should do it.

    ~Colin Braley

  • John Harcus

    February 22, 2006 at 11:25 pm

    Thanks man.

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