Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions link a layers Y position to another layers y scale

  • Scott Mcgee

    November 12, 2018 at 12:41 pm

    If you want the green top layer to move on the y position.

    Someone might have a better expression to link something to the edge. But this is the idea you want.

    x = value[0]
    y = thisComp.layer(index+1).position[1] – thisComp.layer(index+1).sourceRectAtTime().height;
    [x,y]

    Making sure you anchorPoint is attached the bottom of the pink layer the is scaling up. This will position it to the top part of the shapeLayer.

    If you are using the scale[1]. You’ll need it to calculate the percentage

    x = value[0]
    y = thisComp.layer(index+1).position[1] – (thisComp.layer(index+1).sourceRectAtTime().height * thisComp.layer(index+1).scale[1]/100);
    [x,y]

    I’m sure someone else will have a tidier expression that works better, but this should do the trick for you if your anchorPoints are set up correctly

    Hope that helps.

  • Conor Mclaughlin

    November 14, 2018 at 12:46 pm

    Thanks!

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