Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expession Question

  • Expession Question

    Posted by Victor Nash on August 15, 2006 at 9:53 pm

    I have the follow expression below applied to my camera’s position to give it a little bounce on each keyframe. However, I was wondering if there was a way to trigger the bounce to occur on every other keyframe, so that I can get the bounce to trigger on each ‘settling’ keyframe rather than the starting keyframe of the camera’s position? Thanks.

    n = 0;
    if (numKeys > 0){
    n = nearestKey(time).index;
    if (key(n).time > time){
    n–;
    }
    }
    if (n == 0){
    value
    }else{
    t = time – key(n).time;
    veloc = 18;
    amplitude = 60;
    decay = 3;
    y = amplitude*Math.cos(veloc*t)/Math.exp(decay*t);
    value+[0,0,y];
    }

    Dan Ebberts replied 19 years, 9 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    August 15, 2006 at 10:18 pm

    Change the 8th line from this:

    if (n == 0){

    to this:

    if (n == 0 || n%2 != 0){

    Dan

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