Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Motion Math with AE7

  • Mylenium

    July 7, 2006 at 2:19 pm

    Motion Math is dead ever since v6. You have to think of other ways.

    Mylenium

    [Pour Myl

  • Mike Clasby

    July 7, 2006 at 3:27 pm

    Scripts or expressions, both come with squish and squash.

    There is a script call Gravity.jsx

    Select the layer you want to apply gravity to,

    File > Run Script > Choose File > and you should open up to the folder (demos)

    Note: (demos) is a folder nested here (on a PC): C drive > Program Files > Adobe > After Effects 6.5 > Support Files > Scripts > Demos

    there should be a file there named “Gravity.jsx”

    select it.
    Now when you click the “Run Simulation” in the Gravity script palette you’ll get keyframes of the chosen gravity attributes (chosen in the palette). Also a cool plus, if you keyframe position as in moving the ball (or whatever layer is selected when you open the script) you’ll get a nice moving ball bouncing, note two that the layer bounce around a box created in the palette, just click he “?” for details>

    And this for Gravity Expression from earlier posts:

    Name: yikesmikes
    Date: Mar 22, 2006 at 1:53:30 am
    Subject: Re: Gravity

    Here a set of expressions,very nice with squish a squash as the ball bounces, not as hairy as it looks if you can copy/paste expressions (Alt + Click the Stopwatch for the property you want to apply the expression to, then paste)

    I just remembered Dan had a nice bouncing animation expression from this post:

    Name: Dan Ebberts
    Date: Sep 14, 2004 at 11:40:45 am
    Subject: Re: bouncing animation

    Here are a couple of bounce simulation expressions. The first one is for position and the second is for scale. With the parameters set the way they are, your object will drop until it reaches y = 400 (“floor”) and then bounce. You can control everything with the parameters (even better- assign them to sliders). You can use Vx0 and Vy0 to give your object an initial velocity – turning it into a projectile. For best results, move the anchor point of your object to the bottom. Here’s the expression for poisition:

    Vy0 = 500; //initial y velocity (pixels/second)
    Vx0 = 100; // initial x velocity (pixels/second)
    g = 2500; // gravity (pixels/second/second)
    floor = 400;
    e = .85; //elasticity

    d = .03; //squash factor
    spd= 10; //speed of squash oscillation
    decay= 10.0; //how fast squash slows down

    b = floor – position.valueAtTime(0)[1];
    h = b + Vy0*Vy0/(2*g);
    T = Vy0/g + Math.sqrt(2*h/g);

    if (time < T){ x = scale[0]; y = scale[1]; }else{ Vy = -(Vy0 - g*T); while (true){ max_dev = e*Vy*d; Vy *= e; t = T; T += 2*Vy/g; if (time < T){ t = time - t; x=scale[0]+max_dev*Math.cos(spd*(t))/Math.exp(decay*t); y=scale[0]*scale[1]/x; break; }else if (T - t < thisComp.frameDuration){ x = scale[0]; y = scale[1]; break; } } } [x,y] And for scale: Vy0 = 0; //initial y velocity (pixels/second) Vx0 = 0; // initial x velocity (pixels/second) g = 2500; // gravity (pixels/second/second) floor = 400; e = .85; //elasticity d = .02; //squash factor spd= 10; //speed of squash oscillation decay= 10.0; //how fast squash slows down b = floor - position.valueAtTime(0)[1]; h = b + Vy0*Vy0/(2*g); T = Vy0/g + Math.sqrt(2*h/g); if (time < T){ x = scale[0]; y = scale[1]; }else{ Vy = -(Vy0 - g*T); while (true){ max_dev = e*Vy*d; Vy *= e; t = T; T += 2*Vy/g; if (time < T){ t = time - t; x=scale[0]+max_dev*Math.cos(spd*(t))/Math.exp(decay*t); y=scale[0]*scale[1]/x; break; }else if (T - t < thisComp.frameDuration){ x = scale[0]; y = scale[1]; break; } } } [x,y] Dan

  • Mike Clasby

    July 7, 2006 at 3:29 pm

    I lied about the squish and squash for the script.

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