Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Y position drives xScale and opacity

  • Y position drives xScale and opacity

  • Jonathan Lutjens

    April 17, 2020 at 9:59 pm

    Hi all,

    I hope this finds you well, given the circumstances.
    I’ve done some searching and haven’t found a solution on my own. Hoping someone with deeper knowledge can help.
    I have an animation setup for an Elephant (thank you Creation Effects for the great AE project!) and I’m adding a shadow to match the movement I’ve keyframed.
    What I’d like to do is use the Y position of the end of the trunk (I have this value from the Elephant animation controls) to drive the shadow layer’s opacity and XScale.
    Opacity would be highest when the end of the trunk is closest to the ground (highest Y position value), and Xscale largest when the end of the trunk is farthest from the ground (lowest Y position value).
    That way, when the trunk is hanging straight down and close to the ground, the shadow will be more compact and darker, and when the trunk is raised up, the shadow will be more spread out and lighter.

  • sheikh ghanee

    April 22, 2020 at 12:37 pm

    You can use value remapping technique to achieve this effect.
    linear() – expression is helpful here.
    Assign the below expression to scale of the shadow layer and edit “Name of Trunk Layer” in the expression.

    yPosition = thisComp.layer("Name of Trunk Layer").transform.position[1];//Get the y position value of the trunk layer
    // Here we set minimum and maximum for the value receive from trunk layer
    inMin = 300;//the highest y position of trunk layer that affects the shadow layer
    inMax = 600;//lowest y position of trunk layer
    // Here we set minimum and maximum value for scale X of shadow layer
    outMin = 100;//when trunk goes far from shadow, scale X increases till its hits value 100
    outMax = 10;//when trunk comes near to shadow, scale X decreases till its hits value 10

    scaleXaxis = linear(yPosition,inMin,inMax,outMin,outMax);

    [scaleXaxis, 50]

  • Jonathan Lutjens

    April 27, 2020 at 3:34 pm

    Thank you, Sheikh! This is working great!
    I appreciate you taking the time to answer me.

    Cheers!

Viewing 1 - 3 of 3 posts

Log in to reply.

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