-
Scale based on Comp Centerpoint expression
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.