Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Loop out at marker

  • Loop out at marker

    Posted by Edward Clayton on June 28, 2022 at 7:49 pm

    Trying to work out an expression that will loopOut() Time Remap keyframes starting at a marker.

    startMarkerTime = thisLayer.marker.key(1).time;

    I can get the animation to start at the marker, but not loop:

    if (time <= startMarkerTime) {
    0
    } else {
    time - startMarkerTime
    }

    Or I can get the loop to start at the marker, but not from the first frame:

    if (time <= startMarkerTime) {
    0
    } else {
    loopOut()
    }

    How can I get the animation to start at the marker AND loopOut starting from the first frame?

    Edward Clayton replied 3 years, 10 months ago 2 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    June 28, 2022 at 8:59 pm

    Probably close to this:

    startMarkerTime = marker.key(1).time;

    if (time <= startMarkerTime) {

    0;

    } else {

    (time - startMarkerTime)%(key(numKeys).time - key(1).time);

    }

  • Edward Clayton

    June 28, 2022 at 9:40 pm

    Yes, this works great! Any way of getting this to boomerang ( i.e. loopOut(“boomerang”) ) without it using the loopOut function?

  • Edward Clayton

    June 28, 2022 at 9:59 pm

    Yes, this works great! Any way of getting this to boomerang ( i.e. loopOut(“boomerang”) ) without it using the loopOut function?

  • Dan Ebberts

    June 28, 2022 at 10:26 pm

    Do you mean “pingpong”? That would be like this I guess:

    startMarkerTime = marker.key(1).time;

    if (time <= startMarkerTime) {

    0;

    } else {

    t = time - startMarkerTime;

    t1 = key(1).time;

    t2 = key(2).time;

    d = t2 - t1;

    n = Math.floor(t/d);

    n % 2 ? t2 - t%d : t1 + t%d;

    }

  • Edward Clayton

    June 28, 2022 at 11:19 pm

    Ah yes, I meant pingpong. Perfect! Thank you, Dan.

    FYI, I had to change key(1).time to key(1).value

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