MART Term 2, Lecture 1
Walk Cycles

# Animating a Walk Cycle

Now that we know all about rigging, let's try and animate a walk cycle. We're going to use a very simple character today. Load the following file:

walkcycle-start.ma

This is Eric. Here are a things to know about him:

• There are three locators behind Eric: one for moving the global SRT, and two for adjusting the pole vectors. Notice that the pole vector targets are behind the knees instead of in front: the effect is equivalent though.

• Eric does not currently have foot roll, which makes his feet rather tricky to animate. You could add foot roll if you wish, but I'm just going to ignore his feet at the moment.

The first thing to do is make sure we always select the bones / joints and not the geometry. I am going to do this by using the `Select by Object Type` icons at the top of the screen (below), but you could equally well do it using templating. I am going to click off `Surfaces` (the icon that looks like a 2×2 grid). Note that this does not only disallow selection of NURBS surfaces, but polygon meshes as well. If we wanted, we could make a character set which contained only the parameters that we wanted to animate: this time I'm not going to do that, however, as the character is very simple so it probably won't make our animating life much easier.

In order to animate a good walk, it is important to study walks: watch people in the street, or stop-frame through films and animations to see what motion the body actually performs when it walks. There are a few good books which contain reference pictures for animators: by far the best is "The Animator's Survival Kit" by Richard Williams1. This has in depth analyses of not only many different types of walks, but also lots of other actions.

There are many different ways to animate a walk cycle*: the method I am going to show you today is a nice quick start, but arguably not the best. Don't forget that you can fiddle about with it till your heart's content once you've got the basic steps in.

# Step 1: Animate the Hips

First we will animate the basic position of the entire body using the hips. We decide how far we want the character to move in how many frames, and then keyframe the hips respectively. The hips locator is NOT the one that's behind Eric: that is his global SRT (which also moves the ikHandles of his feet). The hips locator is actually a locator at the centre of his pelvic sphere. I'm going to keyframe it where it is at frame 0, then further along (approximately 40 units in the z axis) at frame 100. You might want to carry out some / all of this procedure in a side view to begin with.

When you move the hips, the feet will try their very best to stay where they were: the ikHandles will stay, but the feet will move because the legs aren't long enough.

# Step 2: Animate the Feet

Scrub the timeline back, and you'll see the animation that we've put on the hips locator. The front leg's motion looks quite sensible, up until the point when it leaves the floor: we're going to play on this fact in order to make our job easier. Keyframe the foot at that stage (about frame 21 in my example), as well as in the same position on the first frame.

At this point I should say that it is generally NOT a good idea to ever have the leg completely straight: this usually leads to fairly clunky looking animation. That said, all rules in animation are there to be broken if the circumstances require.

Now let's go back to when the back foot leaves the floor (about frame 2). Keyframe it there, then we will move it to the end of its step, which is a couple of frames before the other foot leaves the ground. On that frame, keyframe the foot on the ground in front of the character.

Now you should find that Eric slides his foot from behind to in front at the correct time. In order to make him lift it off the ground, put another keyframe between the other two at the "passing position": this is (unsurprisingly) where the two feet cross in a side view. Scrub to where the feet cross, and then move the foot we were working with (originally the back foot) up a little (left).

Now repeat this process wherever Eric should take a step: scrub through the timeline until his foot is dragged off the floor, and carry out the same procedure each time. You should end up with something that looks approximately like he is walking along.

# Step 3: Animate the Rest of Eric

The resulting walk is less than convincing. This is because when we walk along, it is not only our legs that move: watch someone walking and you'll see what I mean. Our arms swing, our hips sway (some more than others), amongst many other subtle movements.

Have a go now at adding swinging arms to your walk. Our arms normally swing opposite to our legs: if the right leg is in front, the left arm is in front. Key the rotation at the shoulder joints in the same way as you keyed the legs.

Now we'll do some movement of the hips. When we walk, our hips don't only move forward, they also move up and down. Animate the translateY value now so that it is slightly higher on the passing positions.

Let's go and have a look at what we've done in the graph editor. Select an object we have animated (I'm going to use the hips locator), and open up a graph editor. You should see that as well as the hips locator moving along (in the z axis), we now also have a curve to indicate its vertical position that looks a bit like a sine curve. Lets look at a few ways to change this curve.

One thing you might want to do is change a set of keys so they are all the same value: for example, you might want the highest point of the hips to be the same height for each step. The two text boxes amidst all the icons at the top of the window contain the frame number and value of the currently selected key: try selecting a key and changing them. But you can also do this for multiple keys: in order to do this, select the points on the curve that you want to change (either by drawing a box, or by using shift-LMB). Now enter a value into the right hand text box: all of the keys should magically jump to the same value.

Note also that you can scale & translate keys: pressing the `r` key and MMB dragging will scale the selected keys, using the initially clicked position as a reference. Try it.

Finally, don't forget our tools for adjusting the angle of each of the slopes individually.

So have a play and try and get a really nice, fluid walk. For something like a straightforward walk, you probably want all of your animation curves (in the graph editor) to be smooth and flowing: if there are any sharp points, the animation will appear to jump.

# Adjusting Timing with the Dope Sheet

Select any part of Eric and press the up arrow key. This selects the object's parent. Press up several times, and you will find you have GlobalSRT selected. This is equivalent to selecting the GlobalSRT in the outliner, but a little easier.

Now go to `Window → Animation Editors → Dope Sheet`, and turn on `Hierarchy below / none `(the three joined boxes: all of them should be red (right)). What you see here is a black mark for every keyframe. Select all of them, and then press `r` (the scale key). You can now retime your animation by making the box shorter (faster animation, because it happens over fewer frames) or longer (slower animation). The `w` key works for translating too.

# Ghosting

One thing that can be very useful when animating is to be able to see not only the frame you are on, but also the frame before and the frame after. Maya lets us accomplish this using ghosting.

To try out ghosting, first switch to wireframe mode (`4`): although ghosting does work in shaded mode, it can be a little temperamental. Click on one of the objects that comprise Eric (I chose his head). In the attribute editor, open up the` Object Display `section, and the` Ghosting Information `sub-section, and turn on` Ghosting`.

You'll see that there are several options: by default, it will look at the global preferences (the Display → Animation section), but you can change this behaviour. Have a play with the options, in particular try out changing the` Ghosting Control `to` Keyframes`.

There is also an easy way to ghost a whole character: select the root of the hierarchy, and go to the options box of` Animate → Ghost Selected`. When you've set everything to your liking, make sure` Hierarchy `is turned on, and click` Ghost`.

1WILLIAMS R., 1981. The Animator's Survival Kit. London: Faber and Faber.

*Note that technically what we are animating is a walk, rather than a walk cycle, because our character will not end up in the same position he started in: a true walk cycle occurs on the spot.