Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Link X-Scale to animated Y-Position

  • Link X-Scale to animated Y-Position

    Posted by Sebastian Ungrad on February 11, 2014 at 10:27 am

    Hi there,

    i have animated an object in 3D space only Y-Position with an expression. So it goes up and down. On a different layer, that is the shadow of the object, i’m looking for an expression that takes the Y-value and makes an even X-scaling. So the shadow gets an even width while the first object is moving up and down.

    Hope u know what i mean.
    Here’s the expression for the y-position.

    -52+Math.sin(time*effect("FREQUENCY")("Slider"))*effect("AMPLITUDE")("Slider")

    Jason Jantzen replied 11 years, 3 months ago 3 Members · 2 Replies
  • 2 Replies
  • George Goodman

    February 11, 2014 at 9:48 pm

    Add this expression to your shadow layer

    I put in some arbitrary values here. Change those and also make sure to change the “MovingObject” to the name of the layer.

    ypos=thisComp.layer("MovingObject").transform.position[1];

    startY = 500;
    endY = 560;
    startScale = [140,100];
    endScale = [100,100];
    linear(ypos,startY,endY,startScale,endScale);

    “|_ (°_0) _|”

    Sincerely,

    George

  • Jason Jantzen

    February 17, 2015 at 1:28 am

    Thanks George! This is exactly what I needed 😀 I animated a bouncing thing in Newton and needed to animate the shadow’s scale according to hte bouncing Y position.

    Jason Jantzen
    vimeo.com/jasonj

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