Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Animate in steps

  • Posted by Vojtěch Palme on June 26, 2017 at 10:05 pm

    I’m trying to make a radial value grow in steps (30, 60, 90, 120,…. ) and when it reaches certain value, make it start over (80×330, 80×360, 0, 30….) (because this is an evolution parameter and it has some limit after which it stops animating) I have found several solutions to the step part (loopout offset, or some math.floor function) but dunno how to make it reset every once in a while.
    Please, how would you go about it? The fewer keyframes, the better

    thank you

    Charlie Laud replied 8 years, 10 months ago 2 Members · 1 Reply
  • 1 Reply
  • Charlie Laud

    June 30, 2017 at 1:00 pm

    Hey Vojtech,

    If I’m understanding this correctly, the modulus operator (%) should be able to help!

    transform.rotation % (360*80)

    The above code would reset transform.rotation back to 0 every time it reaches a value higher than 360 * 80. So if you put % (360*80) at the end of your expression, it will continuously keep the return value from exceeding the upper limit of the evolution parameter.

    You might be able to eliminate keyframes entirely with something like this:


    updateFreq = 24; //step forward every 24 frames
    radialStepValue = 30; //by 30 degrees
    (Math.floor(timeToFrames(time/update Freq))*radialStepValue) % (360*80)

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