Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Yet another bounce expression question – not falling, but pop-up with a spring effect.

  • Yet another bounce expression question – not falling, but pop-up with a spring effect.

    Posted by Scott G on October 9, 2006 at 1:24 am

    Hey Guys,

    I’ve been searching but haven’t found what I’m looking for yet. I’ll dive into it more fully later on, but for now I was hoping someone has already done this.

    I want to animate a bunch of layers rising up from off screen (bottom), and then settling into their positions. I want to keyframe the offscreen position, and the final on screen resting position, but i was hoping an expression could take care of secondary bounce. ie, when the layer flies up to it’s final position, it should bounce up and down (with decay) a few times, like it’s on a spring.
    Actually, almost exactly like a jackinthebox using only the Y dimension.

    Surely someone has done this before?
    Thanks!
    Scott.

    Scott G replied 19 years, 7 months ago 2 Members · 6 Replies
  • 6 Replies
  • Mike Clasby

    October 9, 2006 at 2:46 am
  • Scott G

    October 9, 2006 at 3:39 am

    heh, thanks, i would have checked jj gifford and dan’s site later on, i’m just swamped at the moment. perhaps this should be added to that sticky list of common questions, i searched for “bounce” and got a million responses (they were all drop-and-bounce though, not jackinthebox).

    cheers,
    scott.

  • Scott G

    October 9, 2006 at 4:17 am

    So the jackinabox pops up, and bounces with decay to a halt. but then imagine it went back into it’s box, it should have a small anticaptory bounce before going back down. i actually don’t think this is possible with the one expression on the one layer, as the beginning motion and the end motion are two different things, one a decaying spring, the other an anticipatory pseudo-squash-stretch motion. it’s not simply playing the first move in reverse…

    any clues here guys? dan?

  • Scott G

    October 9, 2006 at 5:19 am

    hang on… is this expression from dan

    veloc = 35;
    amplitude = 30;
    decay = 1.0;
    y = amplitude*Math.cos(veloc*time)/Math.exp(decay*time);
    value + [0,y]

    even work properly? it doesn’t for me. two keyframes, and… nothing. do the keyframes have to be at the start of the comp, ie, t=0?
    i’ve been fiddling with veloc, amp, and decay, and i can’t seem to get it working. the decay time is always massive, the layer bounces and just keeps bouncing…and bouncing… and bouncing.

    i can’t get it working.

  • Mike Clasby

    October 9, 2006 at 6:11 am

    Is your comp less than 5 sec? With the decay at 1, the bounce lasts about 5 sec.
    Up the decay to about 4 and the bounce will last less than 1 sec.

    Yes, that expression is triggered from time 0. Dan’s page says he set the 2 keyframes at frame 0 (jack below the box) and frame 1 (Jack up above the box) so he pops out from frame 0 to frame 1. If you want the bounce to be triggered by a marker, try this:

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

    if (n == 0){
    value;
    }else{
    t = time – marker.key(n).time;
    veloc = 18;
    amplitude = 55;
    decay = 4;
    y = amplitude*Math.cos(veloc*t)/Math.exp(decay*t);
    value + [0,y];
    }

    Set the marker where you want the bounce to start.

    Note: this is a much smaller and shorter bounce, adjust velocity, amplitude and decay as needed.

  • Scott G

    October 10, 2006 at 2:46 am

    thanks for explaining that for me, yikesmikes.

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