BLENDER
steps to
success Turn a simple walk cycle into a stroll with style! Improve your character animation in our Blender masterclass, which makes use of genuine rigs from the movie Elephants Dream, provided on the CD BY BASSAM KURDALI alk cycles are one of the staples
layer animations on top of his walk. Finally, we’ll look at some
of 3D character animation. Yet it’s
of the extra cloth animation controls the character rig contains.
all too easy to end up with bland,
Don’t worry too much about Proog’s coat until the very last step
robotic movements. In this tutorial,
of the tutorial – to look good, it needs some hand tweaking.
W
you will learn how to create a walk with personality,
FACTFILE
The walkthrough is intended for readers who already have
keyframing and refining a basic movement cycle, then
some familiarity with both Blender and the basic concepts
layering secondary animations over the top.
of animating a walk cycle. If you get stuck, refer to the
For this, we will use Blender’s NLA Editor (Nonlinear
annotated screenshots on the CD. The disc also contains a set
FOR Blender
Animation Editor). It works just like a video editor, but using
of numbered scene files that will enable you to pick up the
animation ‘strips’ instead of video clips. Each strip represents
tutorial again at the corresponding steps, and more are available
DIFFICULTY Intermediate / Advanced
instances of an action that can be moved, scaled in time or
for download from www.3dworldmag.com/stoppress.
TIME TAKEN One day
action that contains one walking cycle, while the strip itself
from the movie, and is available under a Creative Commons
contains as many cycles as are required for your character to
attribution licence, so it can be used for any project you like.
ON THE CD • Full-size screenshots • Blend file for Proog • Textures • Blend files for stages 2,15, 21 and 26 ALSO REQUIRED More supporting files can be found on our website
layered on top of other strips. This allows you to create an
The Proog model itself is the genuine rigged character
walk along the path you have assigned to it. The repetitive
Most of the tutorial can be completed in Blender 2.41,
nature of the cycling can be offset by using additive action
which is included on the disc. However, some of the advanced
strips to alter the motion, or by adding other strips to layer
steps require Blender 2.42, which should be a free public
different actions on top of the walk.
download from www.blender.org by the time you read this.
In the tutorial, we’ll be using Proog, the lead character in the world’s first open source animated film, Elephants Dream.
Bassam Kurdali is a freelance animator. He recently finished
First, we’ll keyframe a basic walk cycle and make the action
work as Director/Animation Director on Elephants Dream
loop properly, then put him on a path and add some actions and
www.freefactory.org
054 | 3D WORLD August 2006
TDW80.t_blender 054
6/6/06 12:58:32
Animating better walk cycles | TUTORIALS
ON THE WEB ● Bonus scene files and finished walk animation www.3dworldmag.com
ON THE CD
● Blender 2.41 (see note in introduction about version 2.42) SEE PAGE 82
▲ August 2006 3D WORLD | 055
TDW80.t_blender 055
6/6/06 12:58:38
TUTORIALS | Animating better walk cycles
STAGE ONE | Creating a sneaky-looking walk cycle EXPERT TIP
i
Setting up contact points
Launch Blender and adjust the panels until you have Action, NLA and IPO Curve Editors, a 3D Viewport, buttons and timeline windows onscreen. Split and join panels by hovering the mouse over their edges and right-clicking. Move the edges by clicking and dragging. Drag down the top menu bar, select Edit Methods and, under ‘Auto keyframe’, select Available, drag the bar up and hit [Ctrl]+[U].
Load Proog: choose File > Open or [F1] and browse to where you extracted the files from the CD. Select ‘stage_2.blend’ and hit [Enter]. If you want to keep you current layout, deselect ‘Load UI’ at the bottom of the file selection window, otherwise you will get the same UI layout saved with the file. Note: the full-size screenshots are on the CD, so don’t worry about reading the tiny annotations above!
For the first contact position, drag the Frame Marker to frame one, then go to the Side View in the 3D Viewport. Select and move Proog’s left foot half a step forward and a touch inwards. Don’t lift it on the Z-Axis! Rotate it so his toes are pointing up and turned out. (Pronate by rotating on the Y-Axis.) Press the [I] key and select ‘LocRot’ to set a keyframe.
Here’s a little trick: select the left foot, press the down arrow on the 3D Viewport header (Copy Pose), then the small upwards icon with the pink arrow (Paste Mirrored Pose). The right foot is now in the mirrored position of the left foot, so move the right foot backwards, zero its X and Y rotation, then key it with the [I] key.
01
03
EXPERT TIP
We’ll create the walk cycle in one place using pose-to-pose techniques. Imagine that you’re animating a character walking on a treadmill, with each planted foot rolling back, when planning the poses. You can plan the cycle between any of the key poses, but the simplest way is to start from the contact positions where the front foot just begins to touch the ground, then do the passing position (where the back foot passes the front). Finally, do the down position and the up position. These last two give a sense of gravity and force to the walk cycle.
02
04
i
Pose the torso in the same way as you posed the foot in Step 3: select control bones, rotate and/or move them until you like the contact pose. The cage-like ‘bodybase’ control can be used to move and rotate the entire torso; the rest of the spine (body, back, neck and head) can be rotated independently (‘body’ can also be translated, but we’ll just rotate it). If you rotate, key ‘Rot’; if you move, key ‘Loc’.
05
EXPERT TIP
i
Using manipulators
The layers provided
Use manipulators for positioning, rotating and scaling. These can be turned on and off with the hand icon in the 3D Viewport, and the buttons to choose translate, scale or rotate can be [Shift]-clicked to select more than one at a time. The drop-down menu with the options Global, Local, Normal and View selects the alignment of the manipulator axis. Generally, Normal is the most useful for posing bones, since it aligns with the axis of each bone. You can also use hotkeys to constrain motion in the 3D Viewport by pressing the axis letter after initiating a transform.
Proog’s armature has 16 visibility layers that help minimise the clutter in the 3D Viewport, Action Editor and NLA Editor. The first layer contains his body and leg bones; the second has his left arm FK controls; the third, his left arm IK controls; and the the fourth, his left palm and finger controls. The fifth, sixth and seventh layers control his right arm and hand in the same way. The stride bone is on layer eight, and the facial controls are on layer nine. Layer 11 has cloth fix-up controls. Other layers contain bones that you shouldn’t animate and are supposed to be hidden.
Pose the arms and shoulders by rotating and keying rotations so that the right arm is forward and the left is backward. Rotate the palm, thumb and finger bones. The fingers and thumbs are each controlled by one bone: rotating it rotates the finger, scaling causes the finger to curl. Key each digit’s rotation and scale. ([Shift]-select multiple bones and key them together to save time).
06
056 | 3D WORLD August 2006
TDW80.t_blender 056
6/6/06 12:58:43
Animating better walk cycles | TUTORIALS
STAGE ONE (Continued) | Creating a sneaky-looking walk cycle
That’s the first pose done! Save time by pressing the VCR-style record button in the timeline; this turns on Auto-Keying. Select all the bones posed so far and select the Copy Pose arrow in the header. Then move the frame counter 24 frames forward, and hit the Paste Mirrored Pose arrow; another 24, and hit the Paste Pose arrow. You now have the character skating between contact positions.
Select the left foot and go into the IPO Curve Editor window (make sure it’s set to show Pose IPOs), then click on the label ‘LocY’. Select the Y location curve and hit [Tab] in the IPO Curve Editor, then select the Bezier handles between frames 1 and 24 and press [V] to make that section straight. Do the same for the right foot between frames 24 and 48.
Now the passing position (frame 16). This is where the back foot passes the front foot in the middle of the cycle. Lift the right foot up and make sure to remove the X and Y rotation on the left foot, but don’t move its location. Pose the hips and other body parts as shown above, and then select all the bones that are keyed here. Copy the pose, go to frame 40 and Paste Mirrored Pose.
The first down position is frame 5. Clear X and Y rotation of the left foot and rotation of the ankle and toe, select them and press [I] > Available. Get Proog’s weight over his front foot and swing the arms further than in the contact pose. Paste Mirrored Pose on frame 29. Straighten the foot curves between down and contact poses.
Next, create the up position of the foot: the highest one after the passing position. Try to create a sense of Proog pushing his weight up and forward while on his resting leg. Again, Copy Pose and Paste Mirrored Pose to get the mirror of the pose done. Now delete all the extra location keys within straight segments of the feet IPO curves.
We can continue to break down the walk into poses, or do straight ahead runs on the feet, head, arms, and neglected body parts such as fingers. Break apart the motions of joints (try to get the hands and fingers to trail the arms, and so on) to limber the motion up. Tinker with the Action Editor and 3D Viewport until the movement looks good.
07
10
08
11
09
12
STAGE TWO | Making Proog walk along a path EXPERT TIP
i
How this method works While posing Proog to create the walk cycle, think of the ‘stride’ bone (see Step 13) as a conveyor belt moving backwards that the character walks on. When applying the ‘stride’ to a path, Blender cycles the action and uses the ‘stride’ bone to control the speed of the cycles. The ‘stride’ bone itself remains stationary on the path for every cycle of the action. This makes the character move steadily forwards along the path. You need to key the first and last frame of the action on the ‘stride’ bone itself for this to work correctly.
Go to the last frame in which the left foot is in contact with the ground (in my case, frame 34 – this may differ depending on the tweaks you applied in Step 12). Move the ‘stride’ bone in the Y-Axis until the ‘L_stride’ triangle is aligned with the back of the left heel. Don’t move or key ‘L_stride’ itself; just the ‘stride’ bone.
14
▲
Go to frame 5 (or the first ‘down’ position in the action). In the 3D Viewport, select the ‘stride’ bone and press the [I] key and select ‘Loc’ to key its location. Click on Stride Root in the Armature Bones panel. Move the bone ‘L_stride’ until it lines up with the back of the left heel in the side view. ‘L_stride’ is just a marker, so it doesn’t matter if it’s keyed.
13
August 2006 3D WORLD | 057
TDW80.t_blender 057
6/6/06 12:58:48
TUTORIALS | Animating better walk cycles
STAGE TWO (Continued) | Making Proog walk along a path EXPERT TIP
i
Switching between modes
Select the ‘stride’ bone and, in the IPO Curve Editor, select its Y Location curve. In the header menu, select Curve > Extend Mode > Extrapolation. The curve becomes a straight line. Go to frame one, put the mouse in the IPO Curve Editor window and press [I] to insert a key. Do the same at frame 49 (the last frame of the action). In the Action Editor, delete the original ‘stride’ bone keys at 5 and 34.
Check that the right foot matches up with the stride: simply use the ‘R_stride’ marker and line it up with the back of the right heel in any frame in which the right foot is in contact with the ground. The ‘R_stride’ should remain aligned in all other ground-contacting frames, otherwise the right foot needs to be adjusted.
To create the path on which Proog will walk, hit [Spacebar] while in the 3D Viewport. Select Add > Curve > Path. Press [Tab] once to go to Object Mode, then press [Alt]+[G] followed by [Alt]+[R] to clear its location and rotation. Press [Tab] again to go into Edit Mode and edit the path until you achieve something you like the look of. Don’t make it too extreme or the walk cycle will break.
Select ‘proogskel’. If you haven’t named the action, do so now. Delete the link to the action by clicking the ‘x’ next to its name in the Action Editor. Mouseover the NLA Editor and add ([Shift]+[A]) the action as a strip (or mouseover the NLA window and press [Alt]+[C] to convert the action to an action strip). Make sure that you’re in NLA Mode (see the Expert Tips box after Step 21).
15
17
When adding new objects, Blender automatically enters Edit Mode on that object. This allows you to edit vertices/bones in sub-object level. Blender’s working modes are accessible via the pop-up menu in the 3D Viewport header, or via hotkeys. They consist of, in order: Object Mode, Pose Mode (armatures must be in Pose Mode before they can be animated), Edit Mode, and modes for weight and face painting on meshes. To toggle Edit Mode on and off, use [Tab], and to toggle Pose Mode (this is only available for armatures), use [Ctrl]+[Tab].
16
18
In the NLA Editor, hit [N] to get the strip’s Transform Properties window, if it isn’t already visible. Check the Stride Path option, and make sure the Stride Bone option has the ‘stride’ bone name, and that the axis for the striding is the Y-Axis.
19
EXPERT TIP
i
Single actions vs strips
In the 3D Viewport, press [Ctrl]+[Tab] to take the armature out of Pose Mode, select the path, then [Shift]-select the armature and hit [Ctrl]+[Alt]+[C] and add a Follow Path constraint to the armature. In the Panels window, select the Object buttons, go to the Constraints panel, and make sure the CurveFollow button is pressed – the follow (Fw) direction is in -Y, and Z is the Up vector.
20
Tweak the speed of the movement by clicking on the path and going to an IPO Curve Editor, then editing the speed curve as shown above. Change the Strip End time to the end of the animation, and adjust the end frame of the animation. And that’s it! You’ve got Proog walking!
21
To display a single action rather than a strip, click on the button in the NLA Editor next to the name of the armature. When the button shows the Action Editor icon, the armature displays only the results of that action’s keys. When it shows the NLA Editor icon, the armature displays the results of NLA strip animations. For path-based animation to take place, you must be in NLA Mode or the armature will only display the result of one motion cycle. If you’re editing a single action, you can use the toggle to ‘capture’ the NLA-based state at any frame and key it in your action.
058 | 3D WORLD August 2006
TDW80.t_blender 058
6/6/06 12:58:54
Animating better walk cycles | TUTORIALS
STAGE THREE | Layering more actions on top of the walk
Now let’s refine the animation. To add another action on top of the path animation, [Shift]+[A] in the NLA view (with Proog’s armature selected) and add an action by name. Select the ‘crouch’ action and click the Add button, then make the Blendin and Blendout 15 frames or so. Proog will now crouch a bit as he walks.
22
EXPERT TIP
You can also add an entirely new action and edit it on top of the NLA animation. Let’s make Proog peer around. Go to the Action Editor, which currently shows whatever action is active, click on the ‘x’ to the right of the name, then on the arrows for selecting an action, and choose ADD NEW from the menu. Call the new action something descriptive: we simply called it ‘peer’.
Before starting to create the action, select and key the bones you intend to animate (the head, neck, back, shoulders and arm bones, including the hands) at the last and first frame of the action. This allows you to blend the action from the current animation without having to use the Blendin/Blendout feature.
To finish off, refine the cloth animation. Select all the strips in the NLA Editor by pressing the [A] key once or twice. Move them roughly 30 frames in and don’t forget to edit the speed curve of the path as before. Now, bake the cloth simulation by clicking on the ProogSoftProx object on layer 15, and in the Physics buttons, bake the simulation over the range of the animation. The
cloth can be tweaked further by moving (and keying) the cloud of empties on scene layer nine. Proog’s armature (‘proogskel’) and jacket armature (‘proogjakskel’) have controls on armature layer 11 to animate the collar and sleeve manually. And that’s it: you’ve learned to keyframe a walk cycle, refine it, and added secondary motions. Now experiment for yourself to develop the animation further. ●
23
24
i
Animating the face You can also add facial animation! In the ‘proogskel’ armature on layer nine are Proog’s facial controls. The controls (nicknamed ‘bots’) are mostly location controls, and are locked, allowing them to move only in useful ways. Move around the blue shapes and you’ll see their effect on the face. You can scale ‘botbrowmid’ and ‘botnarrow’ to wrinkle the brow and purse the lips. The green eyelid controls can only be rotated about their X-Axis to raise and lower each eyelid. The ‘eyetracker’ (shaped like a pair of sunglasses) controls the direction in which Proog’s eyes point.
In the left column of the NLA window, hit [Alt]+[C] to convert the action to a strip. You can continue to edit from here while viewing the results in the 3D Viewport. Over the range of the action, the new keys replace the underlying walk, which is usually what you want. Experiment with what you’ve learned so far to keyframe a suspicious ‘peering’ action for Proog for yourself.
25
26
August 2006 3D WORLD | 059
TDW80.t_blender 059
6/6/06 12:59:01