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 location/position

  • Scale based on location/position

    Posted by Mike Olson on April 13, 2012 at 5:02 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.

    Dan Ebberts replied 6 years, 2 months ago 3 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    April 13, 2012 at 5:43 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

  • Mike Olson

    April 13, 2012 at 6:17 pm

    Brilliant!

    Thank you!

  • Lizzy Rowlatt

    July 16, 2020 at 7:28 am

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

  • Dan Ebberts

    July 16, 2020 at 5:47 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

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