Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions marker to pause and maker to resume keyframed animation?

  • marker to pause and maker to resume keyframed animation?

    Posted by Juanluis Vich on May 17, 2022 at 7:55 pm

    hello!

    I thought this would be easy, but I can’t get it to work.

    Could someone know how to get that, having an animation with keyframes, when a marker is found, that animation is paused, until the next marker, which makes the animation to resume? (and so on in the following pairs of markers?)

    thank you very much!

    Juanluis Vich replied 4 years ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    May 17, 2022 at 8:42 pm

    Try this:

    m = marker;

    acc = 0;

    if (m.numKeys > 0){

    n = m.nearestKey(time).index;

    if (time < m.key(n).time) n--;

    if (n > 0){

    if (n%2){

    acc = time - m.key(n).time;

    }

    for (i = 1; i < n; i += 2){

    acc += m.key(i+1).time - m.key(i).time;

    }

    }

    }

    valueAtTime(time - acc)

    BTW, it does just the opposite (runs the animation between marker pairs) if you change the last line to this:

    valueAtTime(acc)

  • Juanluis Vich

    May 17, 2022 at 8:56 pm

    Dan, thank you very much, it works wonderfully!

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