Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Constant expression to non constant expression

  • Constant expression to non constant expression

    Posted by Olly Lawer on August 17, 2012 at 6:41 pm

    That’s probably a complicated way of explaining it.

    Basically I have some cogs which I have used expressions to make them move all using the main cog as a reference (so if they client wants it longer, it’s easy to amend).

    Later in the animation I want to slow and eventually stop the cogs, then they fall off. How do I do this? At the moment the main cog has ‘time*150 on the Z axis.

    Thanks

    Olly Lawer

    Dan Ebberts replied 13 years, 9 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    August 17, 2012 at 7:34 pm

    This is one of those speed-control things that turns out to be trickier than it seems like it should be. Although it doesn’t address this case exactly, this article has some good background info on calculating the “area under the curve”, which is what you need in this case:

    https://www.motionscript.com/articles/speed-control.html

    This expression does that–it will begin to slow down at 6 seconds, and will slow to a stop over a one-second period:


    rate = 150;
    beginStop = 6;
    stopDur = 1;

    if (time < beginStop){
    time*rate;
    }else if (time < beginStop + stopDur){
    r = linear(time,beginStop,beginStop + stopDur,rate,0);
    (beginStop + stopDur/2)*rate - (beginStop+stopDur - time)*r/2;
    }else{
    rate*(beginStop + stopDur/2);
    }

    Dan

  • Olly Lawer

    August 17, 2012 at 7:35 pm

    Thanks Dan tho that just fried my brain. Is there an easy way to do it with an expression control maybe?

    Olly Lawer

  • Dan Ebberts

    August 17, 2012 at 8:04 pm

    Well, you could add a Slider Control to the layer, set a keyframe for 150 at 6 seconds and another for 0 at 7 seconds, then apply the Rotation expression in this section of the article:

    https://www.motionscript.com/articles/speed-control.html#linear

    It should give you the same result as the previous expression.

    Dan

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