Before we jump in to animating a walk, lets breakdown the body mechanics. It is important to understand the motivation behind why the body moves the way it does. If you're just copying poses from your reference without understanding the mechanics behind the action, you'll have trouble evaluating whether it's working or not. Understanding the mechanics will free you from your reference and allow you to adapt the walk to your character without destroying the physicality.
Humans are very effecient walkers. We use gravity and forward momentum to vault themselves over our contacting leg requiring minimal assistance from muscles to swing the leg forward. This natural use of gravity dictates a sweet spot range of 1.3-1.4m/s ( at least with Earth's gravity). The key factors are gravity and the length of the leg, not athletic abilty or any other factors. If we go faster or slower we expend engage our muscles more and expend more energy. We can use more leg muscles to speed up our leg swing. A brisk purposeful walk might get us going 1.75m/s. Humans can both run and walk at 2.4m/s. That's a pretty natural speed to transition in to a run.
Many elements of a walk are dictated by balance or compensation for loss of balance. Imagine an individual carrying a heavy box. They'd take shorter steps with a wider stance. They'd shuffle their feet, moving them forward quicker when they took a step. These actions widen the support base, keep the feet on the ground longer, and increase the amount of time that both feet are in contact with the ground. All of which increase balance. This is a trade off of balance vs. speed. Now think of an 85 year old man shuffling down the street. He'll employ all the same strategies: shorter, wider steps with a higher Duty Factor ( amount of time his feet are in contact with the ground vs. swinging ). Two very different scenarios but they're both dealing with the same physics and biomechanics. One of them trying not to drop the box, one of them trying not to fall.
Phases of a Walk:
A walk is broken in to two phases: Stance and Swing. If the foot is contacting the ground it's in Stance. If the foot is in the air it's in Swing. In a standard walk, Stance takes up 60% of the stride and Swing takes up 40%. Otherwise known as a Duty Factor of 60%. For a biped to be considered walking, they have to have a Duty Factor of 50% or greater. That means at least one foot is on the ground at any given time. Generally there is an overlapping period when both feet are on the ground known as the Balance Assistance Stage ( 10% of the stride in this case ).
The Stance Phase is divided in to three Stages: Heel Strike, Mid-Stance, Push-off. The elasticity of the leg's ligaments and tendons collect energy during the Heel Strike, retain it through the Mid-Stance, then release the energy during the Push-Off. This elasticity requires less strain and energy output from the muscles. Once forward motion is started it's easier to maintain. So it's easier to keep walking then it is to start or stop walking.
Heel Strike Overview:
This is the first stage of the Stance Phase. It takes approximately 15% of the total stride. All the weight support is transferred from the back leg to the front leg during this stage. The front leg accepts 95% of the weight in the first 2/3 of the Heel Strike stage that corresponds with the opposing rear leg's Push-Off Push Stage. The remaining 5% of weight is transfered over by the end of the Heel Strike stage. This is the most chaotic moment of the stride. The entire weight of the body shifts from one leg to the other. The body does most or all of it's lateral shifting during this stage to help balance the weight over the forward leg. The movement from side to side is around half the stance width ( around 3-4cm for a healthy person).
Reach:The start of the Heel Strike is charactarized by the reaching stretch of the front leg that was stretched out in the Reach Stage of the previous stride. The feet start at their max distance apart (equal to half of the stride or one step). It's this reach of the front leg that drives most of the mechanics of the hips. The front foot is actually a little further in front of the hips than the back foot is behind. This descrepancy in the reach of the front and back leg is made up by the tilt of the hips and the flex of the ankle.
Hips:To help with the reach, the hips are at two extremes of their rotations. The hips are rotated about 30deg to help extend the distance of the step length. This expands the reach of the front and back feet. Key to giving more reach to the front leg, the hips are tilted down in favor of the forward leg. This both gives more reach to the front leg, and subtracts reach from the rear leg since that lifts it's hip socket higher. This causes the discrepancy of having the front foot further forward vs. how far back the rear foot it. This is the hips maximum tilt for the stride at about 5deg. The hips then tilt up as the weight bearing leg takes the weight and the opposing leg begins to swing. However, the hips are almost even by the passing pose. This is because the hip abductors have kicked in and are actively stabilizing the hip area. In a healthy person there is only a slight tilt (1deg or less) down with the passing leg. You start to see more sag durin the passing pose when the abductors can't handle the load. For example: the persons abductors are weak, old, fatigued etc. Another example would be the abductors are overloaded with a person carrying a heavy load. The amount of sag doesn't necessarily corrolate with heavy. Even if a muscle bound hero was heavy, his abductors would be strong enough to carry his weight. Those who's hip abductors can't stabilize the weight will compensate in one of two ways. By more lateral shift over the weight bearing leg, tilting their torso to the side of their weight bearing leg to counter the weight or a combination of both. Someone with healthy hips should have very little torso tilt from side to side. But all this won't be done till later on during the passing pose. To stick to the Heel Strike stage, the hips start tilted down to their maximum, then tilt back up as the leg braces to support the weight.
Feet:The forward reaching foot is flexed back by the dorsiflexors. This projects the heel forward to help extend the leg reach even further. The dorsiflexors also keep the feet from slapping down during the rest of the Heel Strike stage. So a healthy individual's foot should have a smooth transition, while slapping would be more characteristic of someone fatigued, sick, or carrying too much weight etc. In a standard walk the stance should be about 7-8cm wide. This is a generalization. taller people would be wider, shorter people would have a more narrow stance. Generally the faster we move the closer together we keep our feet, to almost a straight line when dashing. Women tend to keep their feet closer together vs. men's wider stance. Typical rotation angle of the feet would be 0-10deg. Women tend to keep their feet straighter, more macho guys rotate out further. Bringing the toes in past straight is know as "Pigeon Toed", avoid this unless you intend for the walk to look timid, weak, or injured.
Torso:The body maintains a forward lean throughout the walk cycle. This also favors the reach of the forward leg as well as giving gravitational momentum pulling the COG forward.
Arms:It's actually more efficient to swing your arms then not. Meaning even though it takes energy to swing your arms, the overall benefit lowers the total metabolic consumption. There are a few theories but the general gyst is that they help counter balance the momentum of the legs swinging forward. Arms are good way to put character in to your walks. Is your character loose and casual or tight and purposeful.
This is the second stage of the Stance Phase. It takes up 25% of the total stride. It is the quiet section between the more chaoic weight transfers. The body is vaulted over the supporting leg riding on momentum created by the opposing leg's Push. The quads support the vertical weight. The Passing pose ( F07 ) is right in the middle of the Mid-Stance Stage. The supporting leg has a 10-15deg flex.
The arms move with the opposing legs. This puts them down at the sides in mid swing durning the passing pose ( F07).
The Push-Off Stage is the third and last stage of the Stance Phase, comprising 20% of the total stride. The Push-Off Stage can further be divided in to two equal sections: The Push and the Balance Assistance sub-stages each taking up 10% of the total stride. Pose f13 is right in the middle. This is the start of the opposing legs Heel Strike Stage.
Plantar Flexors in the ankle pushes off the ground to propel the individual forward. This both accelerates the Center of Mass and propels the leg in to the swing phase. This Push from each leg provides 80% of the power for the rest of stride. The thrust up causes the hips to hit their maximum tilt up of 5deg by the end of the stage.The hips are also rotated to their maximum of 30deg.
The foot maintains contact with the ground as the opposing foot touches down and enters the heel strike stage.This is the flip side to the weight shift that happens during the heel strike. 95% of the weight gets transferred to the other foot during this sub-stage. To deal with this weight shift the body does a 3-4cm lateral shift over the opposing/ weight bearing leg. The knee flexes about 45-65deg and the foot flexes about 20 deg to maintain contact with the ground.The hips tilt back towards even as the opposing leg takes the weight and the trailing leg transfers weight to the front leg. The hips will still tilt down about 1deg and it will keep this tilt till it reaches the passing pose f19.
When an individual can't perform planar flexion of the foot, the body weight needs to be shifted more abruptly. Suddenly putting more weight on the newly planted foot. This results in one form of a limp.
Swing Phase Overview:
Once the foot leaves the ground it's in Swing Phase which totals 40% of the total stride. The Swing Phase can be subdivided in to two stages: Early/Pickup and Late/Reach. The passing pose at f19 marks the division point between the Pickup and Reach stages.
Pickup is the first stage of the Swing Phase, it takes up about 15% of the total stride.The hamstrings move the leg forward. The hips keep their 1deg tilt through to the passing pose at the end of this stage (f19). The foot gets lifted slightly to clear the toes. The knee flexes another 5deg to about 70deg.
The Reach Stage is the second part of the Swing Phase. It takes up about 25% of the total stride. The leg straightens and reaches forward to hit it's maximum stride distance by the end of the Stage. The toes only clear the ground by about 1cm. This explains why you always trip over relatively small cracks in the sidewalk. The hips rotate forward and tilt down to hit their extremes at the end of the Stride.The foot flexes back to project he heel out for the Heel Strike at the beginning of the next Stride.
I always start by prepping my rig for the action required for that particular shot. Workout what actions you'll be doing, and set the rig up in your favor. As a generally rule, if the limb maintains contact with something I have it in IK, if it doesn't I use FK. For something like a walk cycle, I have the legs in IK, and the arms in FK. I leave the polevector controls following their respective limbs. That means I only need to move the master body mover and the feet to move the rig in world space. I set the neck and shoulders to rotate in world space. That way adjusting the torso, shoulders, etc. doesn't destroy your arm or head poses. It helps to avoid a lot of counter animation.
[Distance = Speed x Time] The distance in this case will be our stride length. We've already decided that this will be a typical 24 frame walk cycle, so our time = 1 second. Based on the discussion earlier about Gait speed, lets pick 1.35m/sec which puts us right in the middle of the human sweet spot for energy effeciency.
I use this pose as a starting point because it lets you setup the stride length.
The distance between our two foot controls should be half of our stride length (0.675m) one of our two steps. You can slide the foot controls forward or backwards, but you must maintain this half stride distance between them. The feet should be about 7-8cm wide. Rotate the feet out 3-5deg..
The body maintains a forward lean throughout the walk cycle around 5-10deg for this pose. This also favors the reach of the forward leg as well as giving gravitational momentum pulling the COG forward. The faster the walking speed, the more body lean forward. Adjust the height to work with the leg pose and stride length.
The body maintains a forward lean throughout the walk cycle around 5-10deg. This also favors the reach of the forward leg as well as giving gravitational momentum pulling the COG forward. The faster the walking speed, the more body lean forward. I use a secondary Body control or the lower spine control to do this pitch forward. Adjust the height of the main body control to work with the leg pose and stride length. It doesn't have to be perfect, we'll adjust it as we go.
Once the hips are set, you can finalize the foot controls. I adjust everything to get the forward leg pose correct, then I compensate with the back leg. The forward foot should be perpendicular to the leg. This extends the heel out and increases the reach of the forward leg. Slide both foot controls till the pose of the forward leg looks correct. It should be straight but not causing an IK pop. The front foot should be slightly further ahead of the hips than the back foot is behind them. Keep the foot perpendicular to the leg. Adjust the body to work with the front leg pose if needed. Once the front leg is set, adjust the back foot roll to create a nice straight back leg.
Upper Body Controls:
The upper body will counter rotate to the hips. Use a combination of all the torso controls to rotate the opposing shoulder forward. We'll be offsetting controls later on. The torso's tilt is pretty minor, we'll discuss that later as well.
The arm swing forward should match that of it's opposing leg. The amount can vary, but generally the more casual the walk the less the swing. We'll work on the arms further later.
All the work for this pose was done with Pose f01. A human walk, at least a vanilla one, is symmetrical. Just duplicate f01, then mirror it. Slide all world controllers forward half a stride (0.675m). That's It.
This is the same pose as f01, but translated forward one stride (1.35m).It's technically not part of the 24 frame cycle, but is needed to be able to cycle the animation in the graph editor.
The next step is to key frame the rig's world controller backwards to counter the forward motion of the world space controls. This keeps the rig walking on a stationary treadmill for the rest of the walk cycle process. Set frame 01 at zero, frame 25 negative the length of your stride. Make it linear for a nice constant backwards translation. If you want to see your rig walk in world space, just mute the World control's translation channel.
Pose f07 and f19:
I block in the passing pose because along with the previous contact poses they give you the extremes of the legs. We're going to refine the pose later, but for now pose the supporting legs with a 15deg or so bend in the knee. The swinging leg should have about a 70deg bend in the knee. Key the ankle of the swinging leg to pose the foot perpendicular to the leg. The swinging foot should be behind the supporting leg while it's knee is in front of the supporting leg. Try to balance the mass of the leg under the COG of the body. Pose F19 should be a mirror of F07.
Once I've blocked in the five key poses, I switch over to a layered approach. I start with the main controls then I move down the hierarchy.
Main Body Control:
This is the main control for moving the character. I do all my body translation with this control, but I limit the rotation to only the Yaw/Horizontal rotation ( usually Y ).I do any Tilt or Pitch rotations with the next control down, usually a secondary Body Control. I find this keeps my Graph Editor cleaner.
From f01- f25 keep a constant linear forward motion the length of the stride ( 1.35m in this case). In actuality a persons hips don't keep a constant speed, their COG does. A characters COG and their COG controller are not the same thing. True COG will shift depending on the pose. Lean forward more, or raise your arms and your COG will change. However the amount of lean/pitch the torso does in a standard walk is pretty minor. In the interest of simplicity, I keep the body translation even. If later on you end up introducing some substantial pitch rotation to your upper body, you can counter that with back and forth translation to keep the true COG translation linear. I'd recommend putting it on a secondary body control though.
The body's up and down motion is adjustable. It should already be set from the three contact poses on f01, f13, and f25. After that it should hit the low points on f04 and f16 when the quads have caught all the weight. The body hits it's high points at f10 and f22. That's when gravity has eaten away the lift created by the rear leg push-off. You can play with these highs and lows to get more weight or spring to your walk. Height can also be adjusted to help out with the poses of the legs. The weight bearing leg should still be flexed 10-15deg during the passing pose. In the graph below, I'm favoring a faster drop during the Heel Strike stages, then a slower more even rise during the Mid stances for each leg
The body shifts from side to side as each leg switches from Swing to Stance phase. The biggest shift is during each legs Push Stage, the Heel Strike Phase for the opposing leg. This is when the weight is transferred from one leg to the other. The momentum of this shift carries through until it slows then reverses at two passing poses (f07 and f19 ). The amount of translation should be adjusted for characters with longer legs and wider stances. As a general rule, translate half the width of the stance. In this example the stance width was 8cm so the body translates over 2 cm to each side (4cm total). The movement in the upper body will seem a little extreme until countered by the tilt in the torso in the next step.
The torso tilts to counter the side to side motion of the body. The easiest way to animate this is to copy the Body's side to side translation and apply it to the Lower, Middle, and Top spine controls. Since you're copying a cm translation in to a rotation channel the 0.02 movement won't do much as a 0.02deg rotation. Scale it up x50 to get a 1deg tilt on the pass pose for all three controls.
Roll/Tilt Frame Offset:
From there offset the three controls. Subtract one frame from the Lower Spine control. Add one frame to the upper spine control.
Roll/Tilt Value Offset:
You can also scale the amounts to get different levels of rotation in the Bottom, Middle, and Upper Spine Controls. There's not specific values. Just adjust it to your particular rig till it looks natural.
Torso Yaw ( horizontal rotation ):
The Yaw rotation for the torso controls should already be keyed from setting the Contact poses at f01,f13, and f25. You want to have the maximum swing of the arms hit on these frames. But, if you leave the max rotation on all the spine, shoulders and arm controls at the same frame, it will feel really mechanical. To make it feel more organic, offset the controls. Leave the biceps of the arms on the current keyframes. Then work your way back to the base of the spine. Start with neg 1 frame for the shoulder/clavicle controls. Neg 2 frames for the top spine control, then subtract another frame for each control going down the spine. I then go back and advance the elbow keyframes plus 1 frame. This way they lag behind the shoulder by 1 frame to provide a little follow through. These offsets will soften the max arm poses for f01,f13, and f25. You can increase the values to get back the angle of swing you had.
The torso pitches forward 5-10deg throughout the whole stride. This helps pitch the COG forward and provide forward momentum as we walk. I use a secondary body control to set this initial pitch. This will rotate the hips as well as the upper torso in to postion. In the graph below I went for negative 8deg being the maximum pitch. The range of rotation is pretty small, less than half a degree in this example.You'll notice that the curve shape mimics that of the Body's vertical translation.Once I've keyed out the body control, I copy and paste the curve to the mid and upper torso controls, offsetting the curve one frame as it gets further away from the base of the spine. Also repositioning the curve around zero. Finally, I usually scale the curves to have less rotation in the middle of the spine and even less at the top.
Head and Neck
I copy the Upper Spine Controls pitch to the neck and the head controls. Offset by adding one frame to the neck and two to the head. Scale the curve till the amount looks natural.
I use the tilt of the Neck Control to counter the tilt of the torso and the side to side translation of the body. Copy the lowest torso control and invert it. Then scale that till it looks natural. You want to take a lot of the side to side motion out of the head. Most of it, but not all of it.
Yaw ( horizontal rotation ):
Hips hit their maximum rotation forward and back at the contact points of f01,f13,and f25. A typical amount would be 15deg, but the amount is dependant on the length of the legs vs. the length of the stride. Longer legs would require less rotation, and shorter legs more rotation. I tend to favor the forward leg during the two passing poses: f07 and f19. But, feel free to adjust this to the character or rig.
Hips also hit their maximum tilt at the contact points: f01, f13, and f15. Let's follow the progression of one side through a full stride. As the leg is forward f01, the hips tilt down their maximum (-5deg ). As the leg takes the body weight, the hips tilt back up to even ( f03, 0deg ). As the opposing leg leaves the ground and begins to swing, three forces start acting on the hips. The contact leg is exerting force upward and the opposing leg is being dragged down by gravity. However, hip abductors stabilize the hips to limit the amount of tilt. By f07 at the passing pose the hips are only 1deg up over the contact leg and 1deg down on the opposing swinging leg. The hips glide forward at this 1deg tilt up to f10. F10 - f13 the back leg hits the Push Stage pushing the Hip tilt up to their maximum of 5deg by f13. The rest is just an inverse of the first half of the stride. By f15 the hips are even again ( 0 deg ). By the passing pose at f19 the hips tilt down 1deg staying there till f22. Then the hips tilt down to help the leg reach forward, hitting the max -5deg by f25. Use these numbers as a base. They can be pushed to tweak the feel of weight for the character. You can also adjust them later to clean up the arcs of the knees.
During the Stance Phase ( f01-15) I use the master foot control to deal with the foot translation and Yaw. Then I use foot roll, and ball rotate to set the foot angles. If the foot roll isn't setup correctly use whatever controls you have available to achieve the correct angles. The Swing Phase is the tricky part for most rigs. Depending on where you have the pivot point for your foot control ( ankle, heel, ball ) you're going to get different results.
Once the foot control contacts the ground on f01 for the heel strike it stays in position through till f15. f25 should be set one stride forward. Use other keyframes or tangents to create ease in and outs of f15 and f25. You can drop a keyframe on f19 to make sure the knee is a little ahead of the body and the foot is behind. If your foot control is pivoting from the ankle, you should be good. If your control pivots from somewhere else, you'll need to make adjustments later.
The foot stays down for the whole Stance Phase ( f01-f15). The Ankle hits the high point at f17. The foot control then swoops down to zero again for the contact at f25.
Typical stride stance puts the foot 4cm from the edge of the foot at f01. So 4cm plus half the foot width. The foot will keep this distance through to f15. During the passing pose ( f19 ) the swinging foot will pull in closer to the supporting leg. Then the foot goes back out to the same distance as f01 at f25.
This is a variable angle. A general starting point would be 3-8deg out from straight ahead during the Stance Phase ( f01-f015 ). The foot comes back to pointing more straight forward during the passing pose ( f19 ). Then it rotates back out to start the next stride ( f25 ). As a general rule, men tend to angle out more than women. A woman in heels would probably be straight forward.
Foot Roll ( Stance)
Starting at f01 the foot should be pulled back on the heel to be perpendicular to the straight leg. At any given stride length, shorter legs will have more of an angle on the foot, longer legs less. By f04 the foot should be flat on the ground until the passing pose at f07. F07-f15 the foot rolls up on the ball and then toes. Degrees are less important than adjusting it to avoid IK pops in the leg, and keeping a nice arc to the knee and ankle. You can add more snap to the foot if you have it flat on f03.
As the heel pulls off the ground the foot twists on the ball of the foot. No specific numbers here, but it should ramp up to hitting it's maximum twist at f15 before leaving the ground. I usually key it back to zero by the passing pose at f19 and keep it there for the rest of the stride.
Foot Pose ( Swing ):
As I mentioned earlier different foot rigs can give you different results as you enter the swing. So in an attempt to keep this versatile enough for all rigs, just use whatever controls and settings you can to get the poses in the diagram. The angle of the foot should make a smooth transition from the push off f15 to the next contact pose at f25. The spacing on the ankle should ease out of f15 then ease in to f25. The spacing should be the widest at f19 during the passing pose.
The way a character arcs their knees will be one of those things that helps you define the character of the walk. But, for a starting point, keep the keep the knees in line with the feet, pointing straight forward for most of the stride. Swing out a little f16 for picking the foot up. This will coincide with the foot twisting during the balance assist half ot the push-off. The knee will come back in by f19 for the passing pose. If you play the walk cycle, you might notice some jitteriness in the knees and feet. This will get cleaned up in the last step..
There are no definite rules for arm swing, but here are some starting point guidelines. The arm movement is the same as the opposing leg.
The arms swing the widest during the three contact poses f01, f13, and f25. As I explained back when we did the torso Yaw rotation, I like to have the spine, clavicle, arms and elbows ofset by one frame a peice. Hit the maximum bicep rotation on the contact poses and offset the other controls by one frame for each link down the hierarchy down to the base of the spine. Bicep forward rotation hits max on f01, clavicle f00, upper spine frame neg1, middle spine neg2, lower spine neg3. There's a little bit of a twist inward as the arm hits the forward position f13. Starting facing forward f01- f07 then rolling in 5-10 deg by f13 then back to facing forward f19-f25. Finally I use the third rotation channel of the bicep, to create some variation of a figure eight with the wrist. This keeps the arm swing from looking like it's stuck in a slot.
The clavicle should hit it's maximum yaw back one frame before the bicep (f12). Then the maximum yaw forward, one frame before the bicep (f24). You can dip the shoulders slightly (1deg) on the two passing poses (f07,f19). Raise the shoulder up slightly (1deg) on the three contact poses (f01,f13,f25).
The Rear arm stays relatively straight ( 5deg or so ) F01- f07 at the passing pose. After the passing pose, the elbow bends to around 30deg by f10. It then straightens out to around 10deg for the other contact f13. After the contact, the elbow straightens out again to around only 5deg at the second pass pose f19 through till the next stride f25.