FORUMS: list search recent posts

scale based on position

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Evan Hancock
scale based on position
on Jan 15, 2014 at 5:18:23 am

I've seen a few of these expressions for other scenarios but not for what I need.

I have a Null layer and a Shape Layer with a path (horizontal path). What I want to do is attach the x scale of the shape layer to the x position of the null so when I move the Null the horizontal path extends out.

I'm sure it's quite simple but how would I do this?

Return to posts index

William Marler
Re: scale based on position
on Jan 23, 2014 at 9:14:33 pm

Firstly, find out where on the X axis you want the Null to begin (i.e. the position of the null where the shape is at normal scale) and note that down (I'll refer to it in the code as "A")

In the scale property of your path, type the code below.

Hope this does the trick.

x = (thisComp.layer("insert the name of the null here").transform.position[0]-A)+100;

y = transform.scale[1];


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 All Rights Reserved