Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions the spring bounce back movement, with only 1 kf and an expression?

  • the spring bounce back movement, with only 1 kf and an expression?

    Posted by Bert Brown on June 11, 2008 at 9:49 pm

    i’m not sure how to describe the effect, but we all know it. a traveling object doesnt come to a hard stop, it sort of springs in the direction it was going a bit and then back to it’s resting point?

    i have to do it all the time, and i usually have to use three keyframes just for the stopping motion. the middle one is Easy Ease, the last is Easy In.

    is there a way to do this with an expression, possibly even based off the speed at which the object was traveling?

    ———————————-

    peep my over-the-interweb band, red abbott.
    “we electro-rock over long distances…”

    Dan Ebberts replied 12 years, 8 months ago 7 Members · 12 Replies
  • 12 Replies
  • Kevin Camp

    June 11, 2008 at 10:18 pm

    i’ve played around with ease & wizz a bit and i think it has a setting that will give you what you are describing… it’s a neat little script with a ui panel, it has limitations, but it may work for you.

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Dan Ebberts

    June 12, 2008 at 3:16 am

    Something like this should give a little bounce at the last keyframe:

    k = .05; // spring constant
    d = 10; // damping constant
    freq = 4; // oscillation frequency

    if (numKeys > 0){
    if (time > key(numKeys).time){
    t0 = key(numKeys).time;
    t = time – t0;
    v = velocityAtTime(t0)*(k*Math.cos(freq * t * Math.PI * 2)/Math.exp(t*d));
    valueAtTime(t0) + v;
    }else{
    value
    }
    }else{
    value
    }

    Dan

  • Bert Brown

    June 12, 2008 at 2:54 pm

    thanks for the responses. that last code doesnt seem to do anything. i have it applied to the position property of a solid with two keyframes, in a right to left 1 sec motion.

    ———————————-

    peep my over-the-interweb band, red abbott.
    “we electro-rock over long distances…”

  • Dan Ebberts

    June 12, 2008 at 3:16 pm

    Try increasing the spring constant to .25 or so.

    Dan

  • Bert Brown

    June 13, 2008 at 3:20 pm

    nothing. is it working for you? maybe i’m doing something wrong. i’ve played with all the different levels at the top of the code.

    ———————————-

    peep my over-the-interweb band, red abbott.
    “we electro-rock over long distances…”

  • Dan Ebberts

    June 13, 2008 at 5:00 pm

    What’s the velocity at your last keyframe?

    Dan

  • Kevin Camp

    June 13, 2008 at 9:00 pm

    it worked perfectly when i tried it…

    i just key framed a position change from point a to b, then added the expression to position… when the layer hits the last keyframe it comes to a spring-like ‘soft bounce’ then to a full stop after a few oscillations.

    i had never used ‘velocity’ before, i had actually wondered what the difference was between ‘velocity’ and ‘speed’ but never explored it… ‘velocity’ is multidimensional, which is very cool… thanks dan.

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Nate Ledet

    June 19, 2008 at 1:44 am

    I installed ease & wizz and really like it, but the Elastic effect does not work, and it’s one of my favorites. I e-mailed him about it and he said he is working on it, but I haven’t seen an update in months. Instead of springing back and forth to a stop, it arcs into a stop, which is not what it’s supposed to do.

    Has anyone else noticed this?

    ~ Nate ~

  • Reynaldo Der

    October 15, 2008 at 4:52 am

    When I tried it, it works on regular keyframes, but not on keyframes with easy ease.

    Thanks for the code Dan!

  • Ross Newton

    August 20, 2009 at 11:27 pm

    Awesome! It worked for me first try. The only catch I found was that the last keyframe can’t be on Easy Ease. It had to be linear to work for me.

    This same code also works in Flash too. It’s like the universal springiness equation.

Page 1 of 2

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