ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Scale based on location/position

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mike Olson
Scale based on location/position
on Apr 13, 2012 at 5:02:34 pm

Help , please...

I have a horizontal row of images, all attached to a null. I need to move the position of the null horizontally and as each image gets to the center of the comp, it needs to scale up by a small percentage.

I'm not finding exactly what I need on this forum so any help would be greatly appreciated.


Return to posts index

Dan Ebberts
Re: Scale based on location/position
on Apr 13, 2012 at 5:43:47 pm

This will increase the scale by 25% as the layer approaches the horizontal center of the comp:

pct = .25; // increase by 25%
r = 100; // distance to being increasing scale
center = thisComp.width/2;
p = toWorld(anchorPoint);
d = length(p,[center,p[1]]);
mult = ease(d,0,r,pct,0);
value*(1+mult)


Dan



Return to posts index

Mike Olson
Re: Scale based on location/position
on Apr 13, 2012 at 6:17:35 pm

Brilliant!

Thank you!


Return to posts index


Lizzy Rowlatt
Re: Scale based on location/position
on Jul 16, 2020 at 7:28:03 am

Hi Dan, how would I adjust this to scale as it approaches the vertical?


Return to posts index

Dan Ebberts
Re: Scale based on location/position
on Jul 16, 2020 at 5:47:10 pm

I haven't tested it, but it should be like this:

pct = .25; // increase by 25%
r = 100; // distance to begin increasing scale
center = thisComp.height/2;
p = toWorld(anchorPoint);
d = length(p,[p[0],center]);
mult = ease(d,0,r,pct,0);
value*(1+mult)


Dan



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]