Whether you're animating for a game or film, you're likely to face the need to create cycled animations, and that is especially true for the former.
Run and walk cycles are normally created in two ways: the character may stay in a fixed position, while his feet "slide" on the ground with its positioning set at a later stage; or the character really makes two steps forward, while Blender takes care of appending the beginning of the next cycle where the first ended—making the character really move forward in a straight line. The latter is what we'll cover here.
008-RunCycle.blend
. It has our character Otto in its resting pose, ready for our work. We're going to create a funny jog run cycle. When the term "cycle" is used in animation, it means the last position of the action must be equal to its first one. This ensures that it can be repeated indefinitely in a seamless manner. Root
bone), press Ctrl + C, go up 10 frames (Up arrow), and press Ctrl + Shift + C. This will copy the first pose and paste it mirrored on the selected frame in the timeline. Foot.R, Foot.L
, and Hips
, and then move (G) them to the front until you think it's is a good distance for the second step. With all bones selected, insert a new keyframe (I) to save this position.When you're happy with the timing, start creating the Breakdown positions. In this jog run action, the Breakdown happens when both feet are off the ground, in the middle of the step.
Now our first part is done. We have defined the cycle, but how can we make it really loop while going forward? This is where we're going to use the Root bone and the NLA Editor.
Root
bone doesn't have any keyframes set on this action. Root
bone and insert a LocRot keyframe (I) for it. We need to position the Root
bone forward on the exact same timing and spacing it takes from the first Extreme of the cycle to the last. But how do you know exactly how much you need to move the Root
bone forward? Using the Transform panel on the 3D View! Foot.R
bone (which is planted on the ground), and check its Y location value. In this case the value is 0, as you can see in the following screenshot: Root
bone forward, on its Y axis. The math for this is the last position minus the first one. Root
bone forward to the position you've got at the previous step. You may accomplish it through the Transform panel, typing the value on the Y field and inserting a new keyframe (I) for it. Root
bone still selected, open a Graph Editor window and look to its Y Location curve. We need to turn it from a soft curve to a step where the bone "jumps" from one position to the other directly. We also need to repeat this movement in an incremental way: the Root
bone should go forward more steps in order to allow more repetitions of this cycle. Root
bone, let's make it repeat incrementally. With the Y Location channel still selected, open the Properties (N) panel on the Graph Editor window and look for the Modifiers section. Click on the Add Modifier button and choose the Cycles modifier. Leave the Before values unchanged. For the After values, set Repeat with Offset on the first field and the number of cycles you need on the After Cycles field. Your curve and modifier values should look similar to what's shown in the next screenshot:We're almost done. Now we have two actions: one with the weird jog run cycle animation and the other with the Root bone "steps", to move the cycle forward. It's time to do some NLA magic!
On the Properties (N) panel to the right-hand side, set this new track name as Stride on the Active Track section. Scroll down the panel and look for the Action Clip section. The End Frame field has the number of frames of the Action, but it doesn't consider the cycle modifier we've set, so we need to multiply this value by the number of cycles we need.
The number of cycles for the run cycle here is one unit higher than the number of cycles set on the Stride modifier. For example, if the stride moves forward four times, the cycled run must repeat five times. It happens because the stride controls the starting point of the cycle, so the fourth stride jump is actually the beginning of the fifth run cycle.
Almost done! If you hit Alt + A to play the animation, you'll notice that there is a weird jump between each cycle. It happens because we need to remove the last frame of the Cycle action from the NLA evaluation, since it overlaps with the first frame of the next cycle.
If you need to edit the contents of an Action Strip inside the NLA, just select it and press Tab, just like you do to enter the Edit Mode of objects on the 3D View. You'll enter on some kind of Edit Mode for actions, and you'll be able to tweak the keyframes inside the DopeSheet window.
The file 009-RunCycle-complete.blend
has this finished recipe for your reference.
By carefully building a cyclic run, where the first frame equals its last, you can use the NLA Editor and the Root
bone to repeat the cycle as you wish. The Root
bone, which is the parent of all bones in the armature, should move forward the exact length of the cycle without any interpolation between its first and last position. The length of the entire run can be controlled through F-Curve modifiers and the NLA strips.
Appendix: Extremes, Breakdowns, Inbetweens, ones and twos
Chapter 6: Non-linear animation
Chapter 6: Animating in layers
Chapter 7: Easy to Say, Hard to Do: Mastering the Basics
3.139.83.96