ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Animate in steps

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Vojtěch Palme
Animate in steps
on Jun 26, 2017 at 10:05:58 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 (80x330, 80x360, 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


Return to posts index

Charlie Laud
Re: Animate in steps
on Jun 30, 2017 at 1:00:36 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)


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]