
Animating a Walk-Cycle Using Loop Expressions
Dan Ebberts July 27, 2023
0 Comments
Originally published in 2002
With version 5.5 of After Effects, Adobe has included some new keyframe-looping expressions that can be very useful for cyclic animation and layer-looping. In this tutorial, Dan Ebberts walks us through the basics of how to set up and use these expressions and then we'll use one to loop a walk-cycle as you might do in a simple character animation.
Project file: .sit file not available
The new loop expressions can be a little confusing until you get used to them. Basically, you define the region that you want looped by setting one or more keyframes. Then, the type of loop expression you use determines whether looping occurs before the first keyframe (loop_in) or after the last keyframe (loop_out). The parameters that you provide determine the nature of the looping (cycle, pingpong, offset, or continue) and the duration of the segment that gets looped. An example might make things more clear. Let's say that you have an animated sequence at the start of a layer and you want it to repeat over and over for the duration of the layer. You might use the following expression in each of the animated properties:
loop_out( cycle ,0)
(Note that Adobe's documentation shows these expressions in the form loop_out(type= cycle , num_keyframes= 0), but you can safely leave out the type= and num_keyframes=. I prefer the shorter form and that's what we'll use in this tutorial).
This expression tells After Effects to take the sequence between the first and last keyframes and, starting from the last keyframe, repeat the sequence until the layer's Out point is reached. Note that the second parameter defines the length of the sequence to be looped by telling After Effects how many keyframes (counting backwards from the last one) to loop. A zero in this parameter says to use all keyframes. The expression given above is probably the one you will use most often and it's the one we'll use for the walk-cycle animation.
O.K. Let's Begin Go Ahead and open the loop_project (currently unavailable here) file in After Effects. Then open the intro comp. This comp has layers set up with position keyframes and loop_out expressions applied. You will want to examine the various layers in this comp to see how the loop expressions work. I've set these up so that the keyframes start one second into the comp so that you can see that nothing happens before the first keyframe. Select the cycle_1 layer. As you examine each of these layers, you'll want to make sure that it is the only layer visible (besides grid ) and that you hit the u key to expose the keyframes in the position property and that you open the little twirly so you can see the expression. Step through the keyframe area and beyond. You might expect, since this is supposed to be a cyclic loop, that the segment between the two keyframes would loop over and over. That's not quite what happens as you'll notice as you move past the keyframed segment.
at first frame of new cycle, box does not return to starting position as expected
It seems that the cycle flavor of loop_out works best when the starting and ending positions are the same. Toggle the visibility of cycle_1 off and turn cycle_2 on. You'll see that we've solved this little anomaly by adding one more keyframe and moving the square back to the starting position. Now it works the way you would expect. This is something that you need to keep in mind when using cycle . Toggle off the visibility of cycle_2 and turn on ping_pong . As you step through this layer, you'll notice that it works exactly the way you would expect - the little square moves back-and-forth along its path. Turn off ping_pong and turn on offset . You'll see that the offset version repeats the motion but starts from where the previous cycle left off. Turn off offset and turn on continue . I've changed the path somewhat for this example so you can more easily see the effect. You'll notice that the little square keeps moving with the direction and velocity it had at the last keyframe.
Feel free to experiment with these layers until you feel comfortable with what's going on. I'd recommend changing the expressions to the loop_in variety and seeing that the looping action now occurs before the first keyframe. You might also want to experiment with the num_keyframes parameter, although 0 will probably be what you use the most often. Also try the loop_in_duration and loop_out_duration varieties, where the second parameter is time (in seconds) instead of keyframes.
Go ahead and open the model comp. This comp is an Illustrator file that was imported as a comp. It has a separate body part in each layer. To keep things somewhat simple I made each arm as only one piece and the head is combined with the torso.
exploded view of model showing the pieces
I've taken care of the animation of one cycle of the walk-cycle (since the focus of this tutorial is using the loop expressions, not character animation), but I'll briefly go over what I did. The first step was to move all the anchor points to the center of rotation for that body part. For the feet this would be the ankle, for the lower legs it's the knee, for the upper legs it's the hip joint, and for the arms it's the shoulder joint. I did this in the comp window using the Pan Behind tool.
repositioned anchor points
After the anchor points were in the correct positions, I stitched the character together by establishing parent relationships. Look at the parent column in the time line and you'll see that the torso is the parent of the arms and the upper legs, the upper legs are parents of the lower legs, and the lower legs are parents of the fe
Most recent headlines
05/01/2027
Worlds first 802.15.4ab-UWB chip verified by Calterah and Rohde & Schwarz to be ...
01/06/2026
January 6 2026, 05:30 (PST) Dolby Sets the New Standard for Premium Entertainment at CES 2026
Throughout the week, Dolby brings to life the latest innovatio...
02/05/2026
Dalet, a leading technology and service provider for media-rich organizations, t...
01/05/2026
January 5 2026, 18:30 (PST) NBCUniversal's Peacock to Be First Streamer to ...
01/04/2026
January 4 2026, 18:00 (PST) DOLBY AND DOUYIN EMPOWER THE NEXT GENERATON OF CREATORS WITH DOLBY VISION
Douyin Users Can Now Create And Share Videos With Stun...
21/02/2026
With Software Defined Broadcasting more established in Milan Cortina look for Los Angeles 2028 to have less hardware and more cloud-based software systems...
21/02/2026
The SVP of Olympic Operations on turning CAD drawings into reality, building tru...
21/02/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
21/02/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
21/02/2026
Back to All News
Netflix Unveils the Trailer of Accused', A Psychological ...
20/02/2026
Gravity Media and Los Angeles-based Green Couch Entertainment announce a strateg...
20/02/2026
IMAX announces it is working with Apple TV to bring the 2026 FIA Formula One Wor...
20/02/2026
Daktronics has partnered with the Philadelphia Phillies to design, manufacture, ...
20/02/2026
ESPN announces the upcoming launch of Women's Sports Sundays - a first-of-it...
20/02/2026
As the Seattle Seahawks and New England Patriots faced off in the NFL's biggest sporting event of the season on Sun., Feb. 8, Sennheiser wireless solutions ...
20/02/2026
ESPN announces its 2026 Major League Baseball spring training schedule, which includes four national games on ESPN, six games on ESPN Unlimited, and more than 2...
20/02/2026
Open Broadcast Systems, which specializes in software-based professional video transport, has added support for 200 Gigabit Ethernet to its range of encoders an...
20/02/2026
Chyron announces the release of PAINT 10.3, which is designed to help analysts and operators turn live action into clearer, faster on-air storytelling.
PAINT 1...
20/02/2026
With full squad workouts underway, MLB Network's live Spring Training game s...
20/02/2026
Tech enhancements, marquee productions are expected to take advantage of a summe...
20/02/2026
In-venue and creative video staffers at the professional and collegiate level ha...
20/02/2026
Ratings Roundup is a rundown of recent rating news and is derived from press rel...
20/02/2026
Speaking with SVG Europe after one of Team GB's greatest days at a Winter Olympics, BBC Sport's head of major events, Ron Chakraborty, explains the broa...
20/02/2026
Making Winter Games Olympic magic is the goal for every broadcaster in Italy cov...
20/02/2026
Curling, one of the least-dangerous Winter Olympic sports, is dominating the Mil...
20/02/2026
BBC Sport's presence at the 2026 Winter Games is centred around a significan...
20/02/2026
BBC Sport is bringing together its linear TV and streaming digital arms in a str...
20/02/2026
To broaden the appeal of winter sports at Milano Cortina, the BBC has integrated...
20/02/2026
Just in time for the start of Apple TV's inaugural season as the exclusive U...
20/02/2026
One big challenge was to depict the character of each of very different and wide...
20/02/2026
(L-R) Writer-director Amanda Kramer photographs the photographers at the premiere of her film By Design at the Library Center Theatre in Park City. (Photo by ...
20/02/2026
In our latest blog, Tim Pearson explores the impact that increased memory prices are having on the consumer electronics market, and particularly the set-top box...
20/02/2026
Calrec Type R: Shaping the Future of Radio from the Heart of Flirt FM
Love may have filled the airwaves last week for Valentine's Day, and we've just c...
20/02/2026
NEW YORK - February 10, 2026 - An estimated 125.6* million viewers watched Super Bowl LX on Sunday, February 8, according to Nielsen's Big Data Panel meas...
20/02/2026
NEW YORK - February 19, 2026 - Nielsen today shared updated and final Super Bowl...
20/02/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
20/02/2026
A leading global investment bank, with offices at Two International Finance Centre in Hong Kong, partnered with systems integrators Global Vision Engineering (G...
20/02/2026
Rise AV and Rise Broadcast, the global not-for-profit organisations dedicated to improving gender diversity across technical industries, have today announced a ...
20/02/2026
Open Broadcast Systems, the leader in software-based professional video transport, has added support for 200 Gigabit Ethernet to its range of encoders and decod...
20/02/2026
Signiant today announced the formation of its Customer Advisory Board (CAB), bringing together a select group of customers to collaborate on product strategy, r...
20/02/2026
PTZOptics today announced the launch of its Visual Reasoning initiative that makes video more actionable by combining robotic PTZ camera systems, AI, and open i...
20/02/2026
Amino, a global media technology provider delivering devices, software and cloud services that simplify and elevate video delivery, today announced the successf...
20/02/2026
SMPTE , the home of media professionals, technologists, and engineers, today announced its call for technical papers for the SMPTE 2026 Media Technology Summit....
20/02/2026
Wowza Media Systems today announced that Granicus, a leading provider of digital engagement solutions for governments, continues to rely on Wowza to power its h...
20/02/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
20/02/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
20/02/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
20/02/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
20/02/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
20/02/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...