-
Expression for scaling based on null position
I have a 2D comp with several icons that I want to scale with an expression based on the position of a null. I’m trying to create the effect of the icon growing as a mouse pointer passes by. I started with an expression that Dan Ebberts posted a while back, but I keep getting errors when I try to get it to work relative to the null position rather than the comp center. The problem I’ve had is that I can’t get it to factor in the Y position too.
I’m also stuck on getting it to look at the true null position if I parent it to another null, but that’s not totally essential.
Thanks!
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)