Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expression to maintain linear velocity

  • Expression to maintain linear velocity

    Posted by Matthew Woods on August 19, 2010 at 9:08 pm

    I seem to remember there being a simple expression that you can add to a keyframed property similar to loopOut that will extrapolate and maintain a linear velocity based on the velocity and vector of the last keyframe. I can’t find it or figure it out though. Can anyone tell me what it is? It would really help me on this project.

    Thanks,

    -Matt

    Walter Soyka replied 15 years, 9 months ago 3 Members · 5 Replies
  • 5 Replies
  • Chris Wright

    August 19, 2010 at 11:40 pm

    That’s easy, just take the very last keyframe, then distance = velocity * time. And the exact same code pasted into the rotation will work too.

    n = 0;
    if (numKeys > 0){
    n = nearestKey(time).index;
    if (key(n).time > time){
    n–;
    }
    }
    if (n == 0){
    t = 0;
    }else{
    t = time – key(n).time;
    }

    if (n > 0){
    v = velocityAtTime(key(n).time – thisComp.frameDuration/10);
    value + v*t;
    }else{
    value;
    }

    https://technicolorsoftware.hostzi.com/

  • Walter Soyka

    August 20, 2010 at 12:31 am

    Well, that, or this:

    loopOut("continue")

    Walter Soyka
    Principal & Designer at Keen Live
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    RenderBreak Blog – What I’m thinking when my workstation’s thinking
    Creative Cow Forum Host: Live & Stage Events

  • Chris Wright

    August 20, 2010 at 12:49 am

    true, but you can’t use sliders with that.

    https://technicolorsoftware.hostzi.com/

  • Matthew Woods

    August 20, 2010 at 1:17 pm

    loopOut(“continue”) was what I was looking for.
    I couldn’t remember it.

    Thanks both for the helpful replies!

    -Matt

    Need a quick break from motion graphics?
    Try my game Constellation at:
    https://www.paperdragongames.com

  • Walter Soyka

    August 20, 2010 at 1:22 pm

    I’ll keep Chris’s expression in my back pocket, too — he really knows his stuff, and if he’s concerned about limitations of loopOut(“continue”), it’d be good to have his code around if you run into them.

    Walter Soyka
    Principal & Designer at Keen Live
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    RenderBreak Blog – What I’m thinking when my workstation’s thinking
    Creative Cow Forum Host: Live & Stage Events

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