Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Gradually scale up size while layer move to center and scale back down when moving away.

  • Gradually scale up size while layer move to center and scale back down when moving away.

    Posted by Frederic Antoinette on September 20, 2016 at 9:27 am

    I have a row of logos, all connected to a null which I move from lenght to right, so all logos scroll.
    I’m look for an expression that would gradually scale up and then down the scale of each logo while it’s approaching the center of the screen, using there world position, when the position y = 1660 it start from size 100% when it reaches y=960 size is 200% then when it reaches y=260 scale is back to 100, and liked it to kind of ease out from size 100 and ease at size 200 to ease back in at size 100

    Here is kind of a graph of how I would like the scale to do relative to the y value

    Any help, much appreciated… Have been playing with Math.sin but can’t quite understand it.

    Dan Ebberts replied 9 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Frederic Antoinette

    September 20, 2016 at 11:12 am

    I ended up figuring it out using the web to undestand sine curve.
    For those interested here is the code I used

    minV = 100; //Min scale value
    maxV = 250; //Max Scale Value
    S = 260; // Smallest position value where animation starts or end
    E = 1660; // Largest Position value where animation starts or end

    T = E-S;

    A = (maxV-minV)/2;
    B = 2*Math.PI/T;
    C = -(S+(T/4))*B;
    D = minV + A;

    x = thisLayer.toWorld(thisLayer.anchorPoint)[0];
    if (x >= S && x <= E) {
    s = A*Math.sin((B*x)+C)+D
    } else {
    s =100 }
    [s,s]

  • Dan Ebberts

    September 20, 2016 at 1:19 pm

    AE’s ease() might have worked as well:


    y = toComp(anchorPoint)[1];
    if (y < 960)
    s = ease(y,260,960,100,200)
    else
    s = ease(y,960,1660,200,100);
    [s,s]

    Dan

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