Saturday, October 29, 2011

Walk across

1. Bring your character.
2. Set it up: Head parented to World or Root. Arms FK parented to the Root. Knees parented to the World or Root.
3. Create Quick Select Sets.
4. Bring pose2shelf, autoTangent to the scene (even in Maya12)
5. Position the character for the walk:
     Feet together, slightly outward.
     Body slightly "falling" forward.
     Arms down.
I know two ways of making a walk across. One is very simple. You make a cycle and move the World. If you translated feet correctly, If your World translation is on straight line, it's easy too eyeball or calculate the distance, so the feet are not sliding. Red is translation of the World.


But what if you need to walk AROUND some obstacle? Try to use the World? OK.

  

The legs are sliding and it's very difficult to eyeball it. Besides, the feet will slide on rotation anyways. 
It will look fine, if we simply hide the feet. 
But what if we do need to create correct walk across and there is no helping hand of a Technical Director, no clever tools to make our life easier?
Well, let's make a walk across, as though we see someone walking by. 
First, I'd recommend to do a cycle, just to see how character behaves. Then we decide what kind of walk it is: fast, slow, march, tired, happy, energetic, fluent etc. Let's make generic 12 frames per step walk.
Our character needs to walk from one point of space to another.
Select the Root, both Feet and Knees and move them together to that point. Make sure your curves are straight lines. We are making the guy to walk at constant speed forward.
( I used my walk cycle and will re-use Root  up/down, arms and upper body rotation.)

Say, he makes 6 steps. I don't know if 6 will do or I will have to make 5, 4 or 7 steps. I just made my guess, based on walk cycle. The biggest problem is to figure out the pace. How big the steps are? Let's look at the drawings below: Which pose gives us more exact position of the feet?
I would think it's number 2. Breakdown or Passing position. Which means I will have to start the walk NOT on contact (number1), but on Breakdown. 
I will have 6 Contact positions. Let's divide the Root and Feet Translate Z by 6 then.
Right in-between them are the Breakdowns.
Red marks on frames 0 to 24 are my cycle animation from previous shot. I'm going to re-use them. Yellow markings are the placements for Extremes (or Contacts). 



Next I'm going to quickly make rough breakdowns, just to see which foot is up and which is down. It should like like this:


Important procedure!! 
Select both feet and set keys on all the Extremes and Breakdowns to lock feet positions. 
Make sure Translate Z is on Linear!!
Now we can work with individual feet. Select Right (or Left) Foot. Frame 6 is where the Right Foot is in it's Passing position. On frames 0 and 12 it should be in the same place, right? Let's copy frame 6 to 0 and 12. (Red circles are Breakdown position of Right Foot. Yellow Arrows show direction of copying.)
Compare the Translate Z after copying is done (below). Notice flat region from frame 0 to 12. Yellow drawing is position of the foot on frame 6 Breakdown. R_Leg is selected in Quick Select Set (Yellow Rectangle).
Same procedure is to be done with Left Foot.
1. Go to it's Passing position. 
2. Copy/paste back to previous Extreme and forward to next Extreme.
3. Back to Right Foot and do the same until all steps are done.
The resulting look is like of a staircase. Note the linear character of the curves. 
Now we can get rid of the linear mode.
And the result


All is left to do is to get back to Extremes and Breakdowns and take care of feet positions, up/down of the Root, Hips rotation and in-betweens.
Fixing Extremes and Breakdowns gives us this result. Yellow outline is unfixed position.


As you see, we still need to work on in-betweens. Look at the pic below. Purple are the Feet in Contact position. Yellow - Passing. The in-between is wrong.
1. Front Foot is not on the ground. Should be.
2. Back Foot has slid forward and is OFF the ground. 
But the weight of the character is not shifted to the front foot yet and back foot still supports it. I can't be off the ground and can't slide. So:
We need to plant front foot firmly down and keep back foot where it should be.
Back foot copy/paste (or Drag/n/drop in Timeline) from frame 0 to 3 (Red circle is in-between. Yellow Arrow is direction of copying.  Yellow Rectangle is foot controllers). 
Attention: We need to delete copied Foot controllers (selected blue) on frame 3 and make the back foot rotate around it's toe part. Compare circled sections of the curves on pic1 and pic2
pic1
pic2
Keep on adjusting all the steps, all the in-betweens, and it should end up looking something like this:

All is left to do is to fix knee snappings. I fixed first 2 steps and have no time for the rest. So I'm done.
This method is especially valid when you need to make a character walk on uneven terrain and not in straight line.








Wednesday, October 19, 2011

Walk Cycle



Bring the character and check parenting of head, neck, shoulders, arms, legs and knees.
1. Head. 
    Click on the head controller and check it's parenting in the channel box.
    These pictures below show several possibilities. We have "Parent", "World", "Root", "Chest". Let's turn "Root" on 1 (or World, doesn't matter for us now)
2. Next is the Neck. I'd leave it on the "Parent". Make sure everything else is put to "0".
pic1.                                                           pic2.















3. Shoulders don't have any parenting, but Arms do. Parent them to Root (Root on 1, the rest
on 0.) 
4. Going down the body. Check the legs. We have knees (or Pull Vectors), lets parent them to World (value of 1) and, in case your Translate controllers are locked (gray color), Right mouse click on them, down to "Unlock Selected". Then move the knees away from the character. It will keep them steady. It's enough for us now.
  And finally, the feet are parented to the World. 


















We are ready to go. Let's position our character. Blue colored rectangle is where all my Quick Select Sets are.
Arms down, elbows bent, feet rotated outward (red arrows on pic1). I'd suggest to tilt charactr forward a little, to make him falling and out of balance (pic2).
pic1.                                                                            pic2. 


But what to start with? If we ask a child to draw a walking man. Which picture will most likely be done, number 1 or 2? I think number 2. Makes sense, right? 
Pay attention to rotation of the pelvis and it's a good idea NOT to use Root for it if you can. Norman has "Hip" control that is perfect for the task.
Red arrows on the body show rotation of the hips and counter-rotation of the upper body.
When positioning the feet, don't use RotateX and Z (Blue Arrows). Instead use those foot controllers that are in the red rectangle. If you click on, say, Heel Lift, you can scroll it with Middle Mouse Button.
So, now, when we created our first extreme, we can select all our Quick Select Sets and set our first Key on frame 0 and 24. (Yellow ovals and arrows) Now we need to create similar pose on frame 12 and we'll have necessary Extremes.(Red Arrow)
Take a look at Graph Editor. Maya messed up the curves. Red Arrow points at dangerous "overshoot" and Yellow Arrows point at slanted tangents. We need to create "ease-ins and -outs", flatten our tangents.
Maya 12 has AutoTangent button (red circle) built in. If you use other Maya issues, download autoTangent.
Red Arrow shows the place, where an overshoot used to be. Yellow Arrows point at flattened tangents at the beginning and end of the shot. 
All our Extremes are done.



Now it's time for passing positions (or Breakdowns). Right in-between the Extremes.
"Front foot" must be put flatly on the ground. It's sort of "hovering" above because we have both, Foot Roll and Heel Lift. We need to put both of them on 0. Make sure all Foot controls are on 0. Compare the two pictures below:
Time to position another foot, the one that's "travelling" forward.
Most common mistake is to jump right into it and begin using Ankle controller. DON'T.
See, how, when I used Rotate X, it begins to intersect the ground and needs to be translated up?
I would rather use Foot Roll and move the foot a little back and up. My Translate controllers are in Yellow Rectangle. 
After we did our foot positioning, we need to tweak the root a little. Lets see. The first picture is too tall, the knee locks and he's not standing firmly. Second  is too much down. Third is OK.
pic1.                                      pic2.                                                  pic3.


Turn it up-front and observe. Very important issue is "Weight shift". Picture one shows our character perfectly up-right, but unbalanced. His center of gravity is still right between the feet, but he's standing on only ONE.
So we must move his body so the weight is resting on the grounded foot.  I translated his Root to the Left, but compensated by bending his upper body to the right (red arrows).  Yellow Arrow shows projection of his Center of Gravity. 
pic1.                              pic2.
So we can look at it. Now it doesn't have to wiggle his butt,



 but walk like a sailor, it's up to your tastes.



A walk is only half done without in-betweens, where the ups and downs of the body are. Green spline is Ty, Root's up/down. So far we have Extremes (frames 0, 12, 24), Breakdowns (6, 18) and need to make In-betweens (3, 9, 15, 21).
Bring the Root down on frame 3 (Red circle and yellow arrow down), next in-between on frame 9 is up (yellow circle and arrow up). Green arrows and circles are where next in-betweens supposed to be.
Before our next playblast let's look at the action of the feet.
So far we left the feet travel between Extremes and Breakdowns. Time to tie them to in-betweens.
On frame 3 the forward foot is still up in the air. We need to put it flatly to the ground (red Arrow). And we'll do it with dialing Foot Roll and Heel Lift (Red Oval) to 0.



On the first look we're done. But if you are going to apply this walk to some path, you'll see the feet sliding. We're not done with the In-betweens. Look closer



The back foot is lifted into the air too soon. Front foot is still on it's Heel, not fully supporting the weight, and the back foot is already up in the air. What's supporting the walker? 

Still don't see it? OK.
Look even closer. We are looking at section between frames 12 and 15, while front foot is been brought flat down.
So I would specifically keep the back foot on the ground. Not only that. The back foot is still getting closer to the front. But they both are held by the ground and the distance between them (A and B) should be the same. 
A=B !!! Now we're talking... I mean "Walking".


The last, but not least, thing to do is to check if the feet are traveling the same distance and make sure they travel with constant speed while connected to the ground. 
Select one of the feet and look at Graph Editor. For convenience we can turn the spline into linear mode (select it and click on the button in Red circle).
Watch if the two segments (Green Arrows) are parallel to each other. It's when the foot is in contact with the ground.
Now load both feet Tz and check if they travel the same distance and segments are parallel to each other. 
How to load both feet? Click on one foot controller and Control/click on the other (from Quick Select Sets), then in Graph Editor click on TranslateZ of one foot and Control/click on another. There you are.
Yellow is the one foot's travel and Green is another's. Note that one foot's travel is non-interrupted line, while the other's consists of two segments.

OK, we're almost there. Time to convert the curves back to splines and if we are not careful, we lose our straight segments. Just like below (Yellow lines)
We need to make those segments straight again. Select the keys, then shift/select one tangent's shoulder, shift/select another's, and click the button in red circle (pic1) to get the straight line. (pic2).
pic1.                                                                         pic2.
Same for another foot and remember, it's grounded section of the curve is NOT split into two parts.
We're done as far as the basics are concerned. 

Those folks, who are new to it, should return to the beginning, delete their animation (if you were following these instructions) and attempt to do it again until you can do it on your own in, say, 20 minutes. After this you can continue.

PART 2
Not all  is OK with out walk. The knees are clicking, the arms are dead, the body is stiff, the knees are acting funky.
First I'd look if I can fix the funky knees. It's a tough one. One of the most obscured and important elements affecting the knees are the feet flexing. See how waivy Heel Lift graph is? May not look like much but it can be decisive fix. Just kill those two keys and see if it did anything.
pic1.                                                                                         pic2.
Next let's address over-stretching legs. Especially in the "Highs". I can either lower the root or compensate with the Heel Lift. I want to give the knee a little bend. Just to see if I can get rid of the knee snapping. It's relevant only for those rigs, that, like Norman, are not wisely designed. (fixing the problem can be done with such an ease, I'm stupified to see 99.9% of the rigs out there still suffering from it.)
Then we may make his torso concave on the down position (pic1.) and convex on the up(pic 2.). Don't forget to counter-animate the low back when you Rotate the upper body (pic3.). I'm using multiple spine controls at once (pic4.).
pic1.                                       pic2.                                       pic3.                                       pic4.
Then we may drag the head and break the elbow on the forward swing of the arms. The head delay may be covered in separate post and arm swing is covered brilliantly by Richard Williams in his book "Animator's Survival Kit".  All and all it looks like this and I'm sick and tired of this topic, so I'll retire.
















Friday, October 7, 2011

Quick Select Sets

Before starting Animation, we need to make sure we have access to all the controls.
Often Animators make shelf buttons, but Maya have always had another, excellent tool for it - Quick Select Sets. Let's open Outliner.  Then Create/Sets/Quick Select Set and tear off "Sets".
Then in the camera view, Shift+select Torso controls. I prefer to start with the Head and go down to Hips. With controls selected click on Quick Select Set and in the dialog box, enter Quick Select Set name: I recommend to give it a name "Set1_Torso".

Click OK and look at the Outliner.

































We can see new item Set1_Torso with a "+" in it. Click on the "+" to open the set. We see Spine controls. Now even when the character is positioned like below



We still can access all of it's controls in any order we need.

Continue with Arms, Legs, Hands and Face.
We should end up with long list of Quick Select Sets, but upon closer inspection we'll find it to be not that hard to navigate, especially when we simply close the Sets we don't use. For a walk I'll close Hands and Face. for close up shot I'll close Legs and Hands etc.
Let's look at all the possibilities.







What's more, we can create a hierarchy, sort of Quick Select Set of Quick Select Sets.
Collapse all the new QSSets, select them, go to Create/Sets/Quick Select Set. Give it a name like: "Set1_Old_Man" and look at the Outliner.

Instead of all the QSSets you'll see only one. Open it and there they are.

Below is my usual set up  for blocking.



The last interesting tool is autoTangent. Looks like Maya2012 has it (finally!), but I'm not sure if it's
the same tool. If not, and if your versions of Maya are older, you can download the tool here. Then you can either make a button, or simply drag and drop it into the camera view, then in MEL just type autoTangent and hit Enter.



Now we're ready to start. Take a look at the post "Walk Cycle"