Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Slow something down using expressions

  • Slow something down using expressions

    Posted by Mike Tosetto on March 15, 2012 at 9:29 am

    Hi guys

    I’m trying to slow something down with expressions. What I have is a bunch of letters rotating in a circle from the same anchor point.

    I tried using time*100 on the rotation parameter and then set a slider to change the value over time to slow the movement down… like this

    time*100/thisComp.layer(“Null 2”).effect(“Slider Control”)(“Slider”

    All I did was pickwhip the slider and then change the value to something like 6 to divide the value by 6 and slow it down.

    Unfortunately, the letters move in the opposite direction before slowing down.

    I then tried the same thing with velocity and got the same result.

    veloc = 110; //rotational velocity (degrees per second)
    r = rotation + (time – inPoint) *veloc;
    [r/thisComp.layer(“Null 2”).effect(“Slider Control”)(“Slider”)]

    Hoping someone can help. It feels like it should be simple but I only just get by with expressions so this one has me stumped.

    Cheers

    Mike

    time*100/thisComp.layer("Null 2").effect("Slider Control")("Slider"

    veloc = 110; //rotational velocity (degrees per second)
    r = rotation + (time - inPoint) *veloc;
    [r/thisComp.layer("Null 2").effect("Slider Control")("Slider")]

    miketosetto dot com | bestiacollective dot com

    Mike Tosetto replied 14 years, 2 months ago 2 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    March 15, 2012 at 2:14 pm

    As you’ve discovered, controlling speed with expressions is not a simple task. It’s a little tricky to explain, but basically when you do a calculation based on an instantaneous speed value (like a keyframed slider), the result you get at any given frame is what you would get if the speed had always been that value. The result is a phase mismatch that will cause your animation to behave in unexpected ways.

    The solution can be complicated. You need to calculate the cumulative affect your slider control has had on all previous frames. It can be a fairly simple calculation if you only use linear keyframes, but if you use any easing, you’ll need to do a frame-by-frame integration/accumulation, starting at the layer’s In Point, and moving forward to the current frame.

    Dan

  • Mike Tosetto

    March 15, 2012 at 10:40 pm

    Hi Dan

    Thanks for your response and your honesty in regards to the complexity of solving this…

    What I’m trying to do is rotate a bunch of letters in space that start fast and then slow down later on in my animation.

    I was hoping to have each one with a slightly different speed and then control their velocity as a group via a slider.

    Is there any other way I could approach this? Or do you think you could possibly have a crack at explaining it to me? Or point me to a particular example on your site?

    Thanks again Dan, I really appreciate your help on this forum 🙂

    Mike

    miketosetto dot com | bestiacollective dot com

  • Dan Ebberts

    March 15, 2012 at 11:40 pm

    This will integrate the value of a slider that you would keyframe to control a rate (like rotation, for example). Apply it to the rotation property and keyframe the slider to set values for degrees-per-second.


    slider = effect("Slider Control")("Slider");
    f1 = timeToFrames(inPoint);
    f2 = timeToFrames(time);
    accum = 0;
    for (f = f1; f < f2; f++){
    t = framesToTime(f);
    accum += slider.valueAtTime(t);
    }

    accum*thisComp.frameDuration

    At each frame it has to do more calculations, so it can bog down if your comp is long.

    Dan

  • Mike Tosetto

    March 16, 2012 at 12:58 am

    Thanks Dan, I’ll give it a go 🙂

    miketosetto dot com | bestiacollective dot com

  • Mike Tosetto

    March 16, 2012 at 1:21 am

    Absolutely awesome!!! That worked a treat.

    Yet to test how it goes on 50 letters flying around the place but so far that’s a great solution.

    Thanks again Dan

    Mike

    miketosetto dot com | bestiacollective dot com

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