Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Pingpong position keyframes with rate change via slider control without time remap

  • Pingpong position keyframes with rate change via slider control without time remap

    Posted by George Goodman on November 23, 2013 at 6:47 pm

    Hi all,

    I’m animating two arms going back and forth that vary in speed throughout the composition with duik inverse kinematics. Because I’m animating null objects, I’m not able to precompose them to enable time remapping. I have an expression that I’ve applied to the position transform of the null objects, hoping it would bounce between the two keyframes and allow me to speed the rate up via slider control. It doesn’t, ha. I’m guessing the time aspect of the expression doesn’t apply since I’m working with keyframes? It basically just does a loop out instead of a pingpong between keyframes like I want.

    Any help modifying this would be greatly appreciated

    loopOut(type = "pingpong", numKeyframes = 0);
    rate=effect("Slider Control")("Slider");
    p=key(2).time-key(1).time;
    linear((time*rate)%p,key(1).time,key(2).time,key(1).value,key(2).value)

    Thanks,

    George

    George Goodman replied 12 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    November 24, 2013 at 8:19 am

    Yeah, your loopOut()doesn’t really do anything. The rest of your expression a do-it-yourself loopOut(“cycle”) expression. You can change to ping pong like this:


    rate=effect("Slider Control")("Slider");
    p=key(2).time-key(1).time;
    n = Math.floor((time*rate)/p);
    if (n%2)
    linear((time*rate)%p,key(1).time,key(2).time,key(2).value,key(1).value)
    else
    linear((time*rate)%p,key(1).time,key(2).time,key(1).value,key(2).value)

    Dan

  • George Goodman

    November 24, 2013 at 10:28 pm

    Thanks a million Dan!

    This is going to be a very powerful expression for me.

    Thanks,

    George

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