Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions RE: Older Post — Exponential Scaling Expression; can we add sthg?

  • RE: Older Post — Exponential Scaling Expression; can we add sthg?

    Posted by Lu Nelson on January 30, 2006 at 8:59 am

    This is an open question, but refers to some code offered in a previous post, by Dan Ebberts and Aaron Fisher, which were expressions for scaling exponentially between keyframes:

    https://forums.creativecow.net/cgi-bin/new_read_post.cgi?univpostid=703921&forumid=2&postid=703921&pview=t&archive=T

    Let me just say to you both, if you read this, that it was great to find this! It gets around the render hit of using 3D comps just to have this effect and so is a huge timesaver for the sort of Pan and Zoom effect that we editors-and-some-time-motion-graphics-guys need to do; but I wonder…:

    would it be possible to add EASING to this algorithm? And perhaps just specify some ‘easeIN’ and ‘easeOUT’ params at the head of the script, that could be modified to suit (or, of course, just set to zero if not needed)?

    This would really make it an all-time amazingly useful thing. I hope it’s possible without too much additional complexity?

    (– and my next question would be how do I make a script Item under the File>Scripts menu that will add this script in to the Scale property of any selected layer — but that’s for next time)….

    THANKS!

    Filip Vandueren replied 20 years, 3 months ago 2 Members · 1 Reply
  • 1 Reply
  • Filip Vandueren

    January 31, 2006 at 9:48 am

    I think the trick would be to ease the value of t.

    Without any more complex coding (writing your own ease-function), you can only achieve an easy-ease though.
    You can change the ease() function to easeIn or easeOut, but you can’t specify the strength of the ease in frames or percentage.

    For Dan’s code that would be:


    if (numKeys > 1){
    v1 = key(1).value;
    v2 = key(2).value;
    t1 = key(1).time;
    t2 = key(2).time;
    if (time > t1 && time < t2){ t = time - t1; T = t2 - t1; k = Math.log(v2/v1)/T; easy_t=ease(t, 0, T, 0, T); v1*Math.exp(k*easy_t) }else{ value } }else{ value }

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