Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Scale expression needed… Please help!

  • Scale expression needed… Please help!

    Posted by Lyrad Boots on April 22, 2008 at 10:25 am

    Hi all,

    Before I start I will say a big thank you in advance to any help on this thread. I am very new to expressions and really struggle with the concept and formula.

    What I require is an expression that will facilitate the look of something landing after dropping and sort of squeezing down before popping up to proper height.

    I am animating a static image that will `fall` into the frame onto the ground. Hope I have made sense.

    I looked at Dan Ebberts site, got scared, cried a bit, tried the squash & stretch https://www.motionscript.com/expressions-lab-ae65/squash-and-stretch.html but it seemed to be stretching and squashing as it fell and not when it got the the floor. Any ideas as to what I am doubtlessly doing wrong?

    Ta all

    Daryl Booth replied 18 years ago 3 Members · 3 Replies
  • 3 Replies
  • Lyrad Boots

    April 22, 2008 at 10:26 am

    PS: which factors do I need to tweak to control the amount of stretch/bounce and time on this script?

    Ta in advance again

  • Dan Ebberts

    April 22, 2008 at 3:27 pm

    The simplest thing to do might be to change the expression to begin at the first layer marker. Just drop a marker where the object hits the ground and use this scale expression:

    maxDev = 13; // max deviation in pixels
    spd = 30; //speed of oscillation
    decay = 1.0; //how fast it slows down

    if (marker.numKeys > 0){
    t = time – marker.key(1).time;
    if (t >=0 ){
    x = scale[0] + maxDev*Math.sin(spd*t)/Math.exp(decay*t);
    y = scale[0]*scale[1]/x;
    [x,y]
    }else{
    value
    }
    }else{
    value
    }

    maxDev controls the amount of stretch
    spd controls how fast it oscillates
    decay controls how fast it stops oscillating

    Dan

  • Daryl Booth

    April 22, 2008 at 6:11 pm

    Hell Fire, a response from the man himself. thanks I will try it in a while and let you know
    😉

    salutations from codemonkey

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