A08   THE BIPED WALK CYCLE

A Simple Walk Cycle

This is male figure with a fairly standard rig applied.   You can practice assorts of animation using this figure but for those who are not sure how to achieve a simple walk cycle then this section is for you.

THE BRIEF
A Walk in the Park.

Artistic Elements Covered: Choreography of a Walk
Technical Elements Covered: Biped Cycle & Use of Advanced Rig including Inverse Forward and Kinematics


Scene file "Walk in the Park".     Sequence Duration 24 frames

Use the human rig to produce an ON the SPOT walk cycle..


This is a simple polygonal male figure is controlled by a jointed skeleton, itself controlled by handles made from nurbs curves.   The polygon figure has three incoming nodes which affect the shape.
The first is blendShape1 node with one same-shape single target in case any blends need to be added for a more complex project.
The second is skinCluster1 driven by the jointed skeleton.
The third is a smooth node polySmoothFace1 which increases the face count for a finer looking figure.
The legs of this character are controlled by inverse kinematics (ik handles) and pole vector handles only.
The arms of this character are controlled by switches that mix between IK & pole vector handles and forward kinematics (FK) rotation handles.
The switches, which are the "Arm FK_L" and "Arm FK_R" attributes on "move_ALL", also control the visibility of the controls which helps to keep the rig uncluttered.

The Biped RIG

The function of the control handles are as follows:-

General:
move_ALL moves rotates and scales the whole rig around the environment.
control_root moves and rotates the figure but leaves all control_arm_IK and control_leg_IK in position.
control_spine rotates and bends the spine on three axis.
control_neck rotates and bends the neck on three axis.
control_shoulder_L and control_shoulder_R moves the shoulders in z or y.

Arms:
move_ALL.Arm FK_L and .Arm FK_R switches the left and right arms from IK to FK
When move_ALL.Arm FK_L set to 0:-
control_arm_IK_L moves and rotates the left hand.
control_elbow_L moves the pole vector of the left arm.

When Move_ALL.Arm FK_L set to 1:-
control_arm_IK_L and control_elbow_L become invisible but the FK controls below are revealed.
control_FK_should_L,
control_FK_elbow_L
and
control_FK_wrist_L allow the arm to be rotated in FK mode.

The controls for the right arm behave in the same way.

Legs:
control_leg_IK_L moves and rotates the foot around the ankle joint.
control_ leg_IK_L Toe Roll X and Y rotate the foot around the base of the toes.
control_ leg_IK_L Heel Roll X and Y rotate the foot around the heel-floor contact point.
control_ leg_IK_L Toe FK X curls the toe,
control_knee_L moves the pole vector of the left leg

The controls for the right leg behave in the same way.


Put Your First Foot Forward
Starting the Cycle by set keying the feet.
We will start by keying the position of the feet for a 24 frame walk cycle.   A 24 frame cycle is easier than using a 25 frame cycle because 25 is a difficult number to divide without using fractions.   If you need a 25 frame cycle then start with 24 and then scale all the animation curves up along the time-line to 25 when you have finished.   Set the time line to play between frame 1 and frame 24.

Spread the feet out to the full stride position with the left foot out in front and the right foot out behind.
In the example animation above I set keyed control_leg_IK_L at 3.0 on the Z axis and control_leg_IK_R at -3.0.on the Z axis, at frame zero, and at frame 24.
The foot positions can then be swapped with the right foot out in front and the left foot out behind.   Set key these on the Z axis at frame 12.
Try out the animation by playing it back.
The legs of your figure should move like a skier along the Z axis.

Now set up the Y channels.
Set key the Y channels of both control_leg_IK_L and control_leg_IK_R at value 0 at frame 0, 12 and 24.
The next stage is to set key the pass over positions in the Y channels.
Now set up the Y channels.
Set key the Y channels of both control_leg_IK_L and control_leg_IK_R at value 0 at frame 0, 12 and 24.
Set control_leg_IK_R on the Y axis to value 0.9 at frame 6.
Set control_leg_IK_L on the Y axis to value 0.9 at frame 18.
Try out the animation by playing it back. It start looking a little more like a proper walk.

Now set up the X channels.
The next stage is to set key the pass over positions in the X channels.
Set key the X channels of both control_leg_IK_L and control_leg_IK_R at value 0 at frame 0, 12 and 24.
Set control_leg_IK_R on the Y axis to value 0.07 at frame 6.
Set control_leg_IK_L on the Y axis to value -0.07 at frame 18.

Here is an exact description of how do the above:-
Go to frame 0 by typing 0 into the current frame field.
Set Key control_leg_IK_L Z = 3.0, Y = 0 and X = 0
Set Key control_leg_IK_R Z = -3.0, Y = 0 and X = 0
Left scroll to frame 24
Set Key control_leg_IK_L Z , Y, and X (should default to z= 3.0, y=0 and X=0)
Set Key control_leg_IK_R Z, Y, and X (should default to z=-3.0, y=0 and X=0)
Left scroll to frame 12
Set Key control_leg_IK_L Z = -3.0, Y = 0 and X = 0
Set Key control_leg_IK_R Z = 3.0, Y = 0 and X = 0
Left scroll to frame 6
Set control_leg_IK_R Y = 0.9 and X = 0.07
Left scroll to frame 18
Set Key control_leg_IK_L Y to 0.9 and X = -0.07
Try out the animation by playing it back.

Left Foot If you don't edit the tangents of your keys then the animation will look poor.

Edit the control_leg_IK_L Z curve as follows:-
Key 1 at frame 0 should be linear.
Key 2 at frame 12 should be linear in and flat out.
Key 3 at frame 24 should be flat.

Edit the control_leg_IK_L Y curve as follows:-
Key 1 at frame 0 should be flat.
Key 2 at frame 12 should be flat.
Key 3 at frame 18 should be flat.
Key 4 at frame 24 should be linear.

Edit the control_leg_IK_L X curve as follows:-
All keys should be flat.

The control_leg_IK_L curves should look like the ones below.

Left Foot Curves

A clearer view of the X and Y curves are below:-

Left Foot Curves

Now edit the right foot.
Left Foot Edit the control_leg_IK_R Z curve as follows:-
Key 1 at frame 0 should be flat.
Key 2 at frame 12 should be flat in and linear out.
Key 3 at frame 24 should be linear.

Edit the control_leg_IK_R Y curve as follows:-
Key 1 at frame 0 should be flat.
Key 2 at frame 6 should be flat.
Key 3 at frame 12 should be linear in and flat out.
Key 4 at frame 24 should be flat.

Edit the control_leg_IK_R X curve as follows:-
All keys should be flat.

The control_leg_IK_R curves should look like the ones below.

Right Foot Curves

A clearer view of the X and Y curves are below:-

Right Foot Curves

Try out the animation by playing it back.
Before we refine the feet motion we should lift the body of the figure at the point of each leg pass over.


Lifting the body during leg pass over.
control_root

Key the control_root Y axis as follows:-
Key 1 value -0.4 at frame 0.
Key 2 value +0.05 at frame 6.
Key 3 value -0.4 at frame 12.
Key 4 value +0.05 at frame 18.
Key 5 value -0.4 at frame 24.
Here is an exact description of how do the above:-
Got to frame 0 by typing 0 into the current frame field
Set Key the Control_Root Y = -0.4
Scroll left to frame 12
Set Key the Control_Root Y (defaults to -0.4)
Scroll left to frame 24
Set Key the Control_Root Y (defaults to -0.4)
Scroll left to frame 18
Set Key the Control_Root Y = +0.05
Scroll middle to frame 6
Set Key the Control_Root Y (defaults to +0.05)

Now we need to bring the body centre of gravity slightly forward.
Key the control_root translate Z axis as follows:-
Key 1 value +0.72 at frame 0.
Key 2 value +0.72 at frame 24.

Editing the body Y key tangents in the graph editor.
Key 1 at frame 0 should be linear.
Key 2 at frame 6 should be flat.
Key 3 at frame 12 should be linear in and linear out.
Key 4 at frame 18 should be flat.
Key 5 at frame 24 should be linear.


The control_root Y curve should look like the one below.

control_root

Try out the animation by playing it back.

The animation should now be looking a little more natural but we will need to come back to the control_root later to key other channels.


Refining the foot movement.
Feet again The feet of this figure now need to be refined in the following ways:-

Heel Roll:
First, as the foot passes over from behind we need to rotate the angle of the foot before it makes contact with floor.   Once the heel has made first contact with the floor and the leg begins to take the body weight then the foot should flatten out so that the entire sole is in floor contact.

Key the control_leg_IK_L.Heel Roll axis as follows:-
Key 1 value -26 at frame 0.
Key 2 value 0 at frame 1.
Key 3 value 0 at frame 19.
Key 4 value -26 at frame 24.

Make sure your key tangents are set correctly (flat) like the examples below.

Heel Roll Curve

Toe Roll:
Secondly, as the opposite leg passes over and the foot starts to pass behind then it should start to peel away from the floor leaving the only the toe area in contact.

Key the control_leg_IK_L.Toe Roll axis as follows:-
Key 1 value 0 at frame 0.
Key 2 value 0 at frame 5.
Key 3 value 32 at frame 12.
Key 4 value 0 at frame 24.

Make sure your key tangents are set correctly (flat) like the examples below.

Toe Roll Curve

Toe FK:
Thirdly, the toe should eventually lift from the floor and when it does, it should straighten up as the load is removed.

Key the control_leg_IK_L.Toe_FK as follows:-
Key 1 value 0 at frame 0.
Key 2 value 0 at frame 12.
Key 3 value 40 at frame 15.
Key 4 value 0 at frame 24.

Make sure your key tangents are set correctly (flat) like the examples below.

Toe FK Curve

IMPORTANT:
Before you refine the right foot you must select all three curves control_leg_IK_L.Toe Roll, control_leg_IK_L.Heel Roll and control_leg_IK_L.Toe_FK from the Graph Editor like the view below.   Then go to the Graph editor Menu bar and select Curves / Pre infinity / Cycle and then Curves / Post infinity / Cycle.
If you then go to Graph editor Menu bar / View / and tick infinity, you will then see the results represented by a dotted line.

Foot Curves

It is imporant that you do this because we will be using these same curves for the other foot but you will be shifting them through the time line so they are in proper phase with the right foot.
Feet again De-select any curves in the Graph Editor.   Select the control_leg_IK_L from the geometry window.   Select Toe Roll, Heel Roll and Toe_FK channels using the control key in the Channel Box.   Right mouse and select "Copy Selected". Left Scroll to frame 12. Select the control_leg_IK_R from the geometry window.   Select Toe Roll, Heel Roll and Toe_FK channels using the control key in the Channel Box if they are not already selected.   Right mouse and select "Paste Selected".   All the work you have done on these three channels in the left leg should now be pasted in to the right leg but starting from frame 12. The infinity treatment of pre and post will make sure the animation happens even when it it is out of range of the animation curves.

Your curves for the right foot should look like the ones below:-

Foot Curves

Try out the animation by playing it back.



Moving the Arms in FK mode.
Move_ALL to FK mode

The animation of the arms is next.
Set the channels move_ALL Arm FK_L and Arm FK_R to 1.0
This will set both arms to FK mode, hide the IK and reveal the FK controls.
Arms in FK mode

Set control_FK_should_L Rotate Z to value -80.0 at frame 0 and 24.
Set control_FK_should_L Rotate Y to value 30.0 at frame 0 and 24.
Set control_FK_should_L Rotate Y to value -30.0 at frame 12.


Shoulders Editing the control_FK_should_L Y
All three keys should be flat.
Make sure pre and post infinity are set to "Cycle".
Paste a copy of this curve into control_FK_should_R at frame 0.

This is how your curve for both control_FK_should_L and R Y should look.

Shoulder Curves


Elbows Paste a copy of this same curve into control_FK_elbow_L at frame 3.
This three frame shift in phase should give a feel of loosening the fore arm during the swing.
Paste a copy of this same curve into control_FK_elbow_R at frame 3.

This is how your curve for both control_FK_elbow_L and R Y should look.

Elbow Curves

Try out the animation by playing it back.



Re-using curves and More Phase Shifting
Control Root again Paste a copy of this same curve that you last used for control_FK_elbow_L into control_root rotate Y at frame 0.
Edit the key frame values of control_root rotate Y in the Graph Editor as follows:-
Key 1 value -8.0 at frame 0.
Key 2 value 8.0 at frame 12.
Key 3 value -8.0 at frame 24.


Why bother set keying up a new curve when you can use an old one?
Your modified curve should look like the one below:-

Control Root Curve


Spine

Paste a copy of the same curve that you last used for control_FK_elbow_L into control_spine rotate Y at frame 2.
Edit the key frame values of control_spine rotate Y in the Graph Editor as follows:-
Key 1 value 18.0 at frame 2.
Key 2 value -18.0 at frame 14.
Key 3 value 18.0 at frame 26.

Set Key control_spine rotate X as follows:-
Set Key to Value 7.0 at frames 0, 12 and 24.
Set Key to Value 16.0 at frames 6, and 18.
All five keys should be flat.
Make sure pre and post infinity are set to "Cycle".

Paste a copy of this new curve into control_spine.wobbleX at frame -2.
Edit the key frame values of control_spine.wobbleX in the Graph Editor as follows:-
Key 1 value -6.0 at frame -2.
Key 2 value 10.0 at frame 4.
Key 3 value -6.0 at frame 10.
Key 4 value 10.0 at frame 16.
Key 5 value -6.0 at frame 22.
All five keys should remain flat.


The control_spine curves should look like the ones below:-

Control Spine Curves
To finish we will copy some curves into control_neck rotations.

Neck Paste a copy of control_spine.wobbleX into control_neck rotate X at frame -3
Edit the key frame values of control_neck rotate X in the Graph Editor as follows:-
Key 1 value -15.0 at frame -3.
Key 2 value 1.0 at frame 3.
Key 3 value -15.0 at frame 9.
Key 4 value 1.0 at frame 15.
Key 5 value -15.0 at frame 21.
All five keys should remain flat.

Paste a copy of the curve used for control_FK_elbow_L into control_neck rotate Y at frame 0.
Edit the key frame values of control_neck rotate Y in the Graph Editor as follows:-
Key 1 value -12.0 at frame 0.
Key 2 value 12.0 at frame 12.
Key 3 value -12.0 at frame 24.

The control_neck curves should look like the ones below:-

Try out the animation by playing it back.

Control Neck Curves

Your walk cycle should now look like the one at the top of this chapter.
Experiment with control_root control_spine and control_neck curves.
You can try shifting curves along the time line. (changing the phase). Make sure their pre and post infinities are set to cycle
Try changing some of the values of these keys but make sure the first and last key are the same value.

Happy Animating.

This site and all the learning materials are the copyright of Henry Lutman.   The sole purpose of the site and downloads are to aid the teaching of 3D Computer Animation and related topics.   Please do not reproduce any of the content of this site, or any of the downloads for purposes other than to use as a guide to learning, without the written permission of Henry Lutman.
Web Site Author: Henry Lutman.     Web Site Editor: Martin Capey
Lutman Animation Copyright Henry Lutman