Working with After Effects is fun since there are so many features to explore. It’s like a never ending experiment and you will discover something new everyday.
When I am talking about Rotating layers in After Effects, those who are familiar with the software must have thought about Keyframes. No doubt, Keyframes is the key to animating layers in After Effects.
You can move things from one point to another, scale objects and rotate layers. The most common method of rotating layers in After Effects is by adding keyframes to the rotation property and changing the rotation amount manually.
But, with an After Effects Expression, you can set an automatic rotation to a layer.
For instance, if you want to rotate the blades of a Helicopter, you can use the keyframes to do so. But, with keyframes, it is difficult to adjust and control the rotation speed.
You need to move the keyframes in or out to adjust the speed. So, using an Expression instead of manual animation can save you some time and results will be much better. For detailed explanation, watch the Quick Tip video below.
The After Effects Expression about which I am talking here is the TIME expression. Instead of adding the rotation value manually, we tell our Layer’s rotation property to Multiply the total length of timeline with another user defined value or integer.
Therefore, the expression comes out to be TIME*(any user defined number).
How it Works
Let’s take an example – I have a square which I want to rotate by 360 degrees (one full rotation) and length of my timeline is 5 seconds.
There are two methods through which I can achieve my goal. One is the manual keyframe method. I can set a keyframe at the starting frame of my timeline and one keyframe at the end and change the rotation value to 360 degrees.
That means, the square will cover a full rotation of 360 degrees in 5 seconds.
To get the same result with an expression. Simply divide the value of degrees i.e. 360 degrees by the length of your timeline, in this case, 5 seconds.
The result which you get is the user defined value mentioned in the above expression. On dividing 360 by 5, the result is 72.
So, the After Effects Expression to rotate the square by 360 degrees or one full rotation in a 5 seconds long composition will be TIME*72.
In case of rotating the blades of helicopter or where you want your layer to rotate continuously, use can use any value in the expression.
The higher the value, the higher will be the rotations and speed.
How to Rotate Layers with After Effects Expression
Watch this Video on Vimeo
To Rotate a layer automatically with After Effects Expression.
- Select the layer which you want to rotate and hit R on your keyboard to open up the rotation properties.
- Hold down ALT key on your keyboard and click on the stopwatch at the rotation property. The same stopwatch which we use to add keyframe. By holding down the ALT and clicking on the stopwatch, instead of adding a keyframe, Expressions text area will be opened.
- Delete the existing transform.rotation from the Expressions area and type in your new Rotation Expression – TIME*(any user defined number).
- Click anywhere to on the screen to finalize the expression. After Effects will notify you of any errors, if found.