Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Triggering Repeating animation with Markers

  • Triggering Repeating animation with Markers

    Posted by Owen Rucker on February 13, 2018 at 3:57 pm

    I want to make either a null or slider move X amount every time it hits a layer marker. In this case x = -135.

    BUT

    I don’t want it to start from 0 every marker, which is the only thing I can find right now.

    So if it’s a slider, when it hit’s the first Marker 1 it moves from 0 to -135. I don’t know how to make Marker 2 trigger -135 to -270. Marker 3 from -270 to -405. And so on and so forth.

    Is this possible?

    Owen Rucker replied 8 years, 3 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    February 13, 2018 at 5:26 pm

    If you want it to jump at each marker, you could do it like this:


    n = 0;
    if (marker.numKeys > 0){
    n = marker.nearestKey(time).index;
    if (marker.key(n).time > time) n--;
    }
    value + [-135*n,0]

    If you want it to slide, it would be like this:


    n = 0;
    if (marker.numKeys > 0){
    n = marker.nearestKey(time).index;
    if (marker.key(n).time > time) n--;
    }
    x = 0;
    if (n > 0){
    easeTime = .25;
    t = time - marker.key(n).time;
    x = ease(t,0,easeTime,-135*(n-1),-135*n);
    }
    value + [x,0]

    Dan

  • Owen Rucker

    February 13, 2018 at 6:08 pm

    This works. Thanks so much!

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