Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Scale based on Comp Centerpoint expression

  • Scale based on Comp Centerpoint expression

    Posted by Bryan Keeling on August 25, 2025 at 6:40 pm

    I have an expression that drives layer scale based on the center point of a comp (by referencing the placement of a null positioned in the comp center). I’m also driving opacity, too. The layer is at full scale and full opacity in the center of the Comp and scales down and fades out the farther away from the center point it is. Essentially all I really care about here is Y postion but here is the expression:

    target = thisComp.layer(“CenterNull”);

    d = length( position, target.position );

    xScale = value[0] – d * .09;

    yScale = value[1] – d * .09;

    [ xScale, yScale ]

    And it works great. However I would like to attach all the layers with this expression to a separate null–which then obviously changes all the layer positions to become relative to the new parent, which screws up the expression. I know I need to somehow work in a layer space transform function to fix, but I was having trouble sorting this out.

    Any help adjusting this would be greatly appreciated. Thanks.

    Brie Clayton replied 8 months, 1 week ago 3 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    August 25, 2025 at 7:50 pm

    Try changing the second line to this:

    d = length(toComp(anchorPoint), target.position );
  • Bryan Keeling

    August 25, 2025 at 7:58 pm

    Worked great! Thank you sir. So simple. I was trying to jam it into the first line and add a new second line . . . . . .

    Thanks again!

  • Brie Clayton

    August 25, 2025 at 8:33 pm

    Thanks for solving this, Dan!

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