Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions scale with expression

  • scale with expression

    Posted by Jose Arce on December 31, 2007 at 9:26 pm

    I need to create a scale grow up object with a little bounce at the final of the growth, a can made this by hand using key frames but the last movement is a little hard. Anybody can explain how to do this with a simple expression. Thanks

    Greetings from Costa Rica

    Jose Arce replied 18 years, 8 months ago 2 Members · 2 Replies
  • 2 Replies
  • Mike Clasby

    January 1, 2008 at 10:46 am

    Here is a Dan expression that is probably what you want. First keyframe the layer for the initial resize like from say 50% to 100%, then add a Marker at that 100% keyframe by hitting the asterisk key on the numeric pad (*). Then put the expression on Scale. The marker will trigger a little bump:

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

    if (n == 0){
    value;
    }else{
    maxDev = 10; // max deviation in pixels
    spd = 40; //speed of oscillation
    decay = 10.0; //how fast it slows down

    t = time – marker.key(n).time ;
    x = scale[0] + maxDev*Math.sin(spd*t)/Math.exp(decay*t);
    y = x;

    [x,y]

    }

    No marker, not bump, so asterisk away. Change the maxDev, spd, and decay to taste. The decay a 10 makes the bump quick, not much oscillation, a smaller number makes it oscillate longer.

    If you want a little squish and squash action on the bump, instead of a uniform x and y bump as above, change lines 17 and 18 to this:

    x = scale[0] + maxDev*Math.sin(spd*t)/Math.exp(decay*t);
    y = scale[0]*scale[1]/x;

  • Jose Arce

    January 1, 2008 at 6:15 pm

    Thanks, just what I need.
    The squish and squash is very nice.

    Have a good year 2008

    jose arce
    chisco
    maiceropro

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