Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions scaling an object at a special position

  • scaling an object at a special position

    Posted by Kai Hattermann on August 29, 2011 at 5:31 pm

    hello,
    i wanted to build a kind of animated timeline, the function a bit like
    the alarm setting on the iphone (scrolling up and down the numbers).
    i uploaded an picture where it is better explained.
    there i try to animate a timeline of years verticaly. the year
    wich will be exactly in the center of my grafic should be scaled.
    when it leaves its position it should be scaled down again.
    i wanted to try this with an expression, and found some expressions
    about scaling an object at a special time. but i dont get it changed to
    “scale at a special postiion”.
    i am not very good in this expressions, maybe someone knows an solution?
    thanks a lot, greetz!

    Kai Hattermann replied 14 years, 8 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    August 29, 2011 at 6:17 pm

    This should scale the layer to 125% as it approaches the center of the comp:


    yPos = thisComp.height/2;
    maxScale = 125;
    range = 50;

    d = Math.abs(transform.position[1] - yPos);
    ease(d,0,range,[maxScale,maxScale],value)

    Play around with the first three parameters to set: the y position where maximum scale occurs; the maximum scale value; and the distance at which the scaling starts.

    Dan

  • Dan Ebberts

    August 29, 2011 at 6:23 pm

    It occurred to me that your numbers may be parented to some other layer. If so, try changing this line:

    d = Math.abs(transform.position[1] – yPos);

    to this:

    d = Math.abs(toComp(anchorPoint)[1] – yPos);

    Dan

  • Kai Hattermann

    August 29, 2011 at 7:11 pm

    Hi Dan,
    thank you a lot for your quick help!
    Exactly like this i wanted it!!

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