From the course: After Effects Apprentice: 09 Expressions

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Looping

Looping - After Effects Tutorial

From the course: After Effects Apprentice: 09 Expressions

Start my 1-month free trial

Looping

Another really handy expression is the ability to loop an animation. I want to clean up my display by selecting Close All from the Comp panel and open up 04-LoopOut*starter. Hopefully, the Rotation keyframes have already been exposed for this layer, and I'm going to turn off the background for now and just remove the distraction. Now what we have is a simple two-keyframe animation-- I'll press 0 to RAM Preview--of this watch piece rotating in one direction. Let's say you want that to repeat, rocking back and forth. You could do a lot of copying and pasting of keyframes and playing around with the Graph Editor, but there is a better way. I'm going to hold down the Option key on Mac, Alt key on Windows, click on the animation stopwatch for rotation to enable expressions and type in the following expression, loopOut. A quirk of the JavaScript language is that the first word is not capitalized, but every word after that is capitalized. And then I'm going to type open parentheses and…

Contents