To download the free project files for this tutorial, click here!
We are going to learn how to find the stride length of a walk cycle quickly. This will be invaluable to your workflow, because a good animator should know how to put together an accurate, looping walk cycle in a short amount of time. Use this cheat whenever you start any looping animation that needs to travel in Z; for walk cycles that stay in place without having a master control counter-animated against the world IK controls (like in games), you need only make sure that, as the animation cycles, there are no visible pops in the animation.
Remember, the stride length is the distance that a character travels in one complete cycle. For a biped, this means two steps. We are going to assume a 20-frame walk cycle, meaning 10 frames per step. Also, the first and last frame need to be the same so we’re going to be doing a lot of copying keys, and a lot of math input in the Graph Editor’s stat boxes. However, knowing our stride length, this is a simple process and will quickly become an indispensible part of your workflow.
We are not going to animate the full cycle, only find the stride length and animate the feet accurately (see the additional content at howtocheatinmaya.com for a complete walk cycle tutorial). The rest of the animation on the body that doesn’t travel in Z is very simple to make cycle: copy the first frame to the last frame of the cycle, and make sure the Post- Infinity curve type is just “cycle”! Let’s give it a shot.
1 Open walk_start.ma. Goon is standing still, ready to animate. Remember that we’re going to be using a lot of math operators in the Graph Editor, so open it up in preparation for this.
2 Pose Goon with his right foot forward, his root comfortably between his feet and a little bit downwards in Y. We normally make a “milestone” f01 of a cycle, like the foot planting, as we’ve done here.
3 Set a key at f01 on all of the world IK controllers that are moving in Z. These are his left and right feet controls, and his root. Take note of what the value is on Goon’s right foot. Mine is 10.967.
4 Go to f10, and now pose Goon with his left foot forward, along with the root moving forward as well. Keeping everything exact is not important because we’re going to be typing in the Z values once we’ve found our stride length.
5 Now look at the translate Z value on the left foot. Mine is 21.96. Hey! That is roughly double the first value we had. We now can approximate our stride length. The nearest, nice, integer value is 22. Voila! We have our stride length.
6 On the timeline, MMB-drag and copy f01-f20, with both feet and the root selected.
HOT TIP You can also make your cycles accurate by changing each Translate Z value to an integer as you go instead of applying the math function at the end. Our first step was 10.976, so we could have made our first value 11, and then known right away that our stride length was 22. Just another timesaving cheat to get perfectly looping walk cycles!
7 Now select the Translate Z channel in the Graph Editor on all three controllers (both feet and root). In the value stats box, type in “+=22”. The last key has now been adjusted to reflect our stride length. Using a math operator means we know the values are exact.
8 Flat all tangents in the Graph Editor. Now select the root_ctrl on the ground at Goon’s feet. Set a key on f01 and then on f20, set a key on Translate Z on -22.
9 Now let’s make sure these keys have the right cycle type. Select all of Goon’s controls and in the Graph Editor, go to Curves > Post Infinity > Cycle.
10 Now select both foot controls, the center root, and the ground root control. In the Graph Editor, select only the Translate Z channels. Go to Curves > Post Infinity > Cycle with Offset. Expand your timeline and watch Goon cycle perfectly in place! The rest of the cycle now comes easy.
HOT TIP To quickly isolate specific curves on multiple controls in the Graph Editor, just select the channel you want to see in the channel box, such as Tz, and click the Isolate Curve Display button in the Graph Editor (looks like a squiggly line – make sure Classic Toolbar isn’t activated in the Display menu). This saves tons of time scrolling through the attribute panel selecting specific curves.
Excerpt from How to Cheat in Maya 2014 by Kenny Roy © 2013 Taylor and Francis Group. All Rights Reserved.
About the book
From menus to modeling, lipsync to lighting, How to Cheat in Maya 2014 covers all of the methods available in the latest version of Maya. Get up to speed quickly and produce stellar results with these insider workflows. With new, updated cheats for the latest version of Maya, this book is an essential guide for amateur and professional 3D animators alike. Fully updated with gold-mine coverage including: expanded sections on production workflow, all new chapters covering rigging cheats and Maya’s referencing tools, and brand new project files demonstrating production-proven techniques.