Character Rigging

Hi everyone. This little overview sheet is designed to let you know of the new tools (and some old ones too) that r4 has for character animators. So, let's get to it.

BONE OBJECTS

R4 has a new bone object design. Basically, what this means is that bones in r4 are standard geometric primitives. The bone object ias a parametric object with automatic hierarchical assignement implemented. It means that when you create several bone objects, they are already linked and ready for FK manipulation. This design also allows you to use ANY geometric object as a bone object. This means that you can use a linked character's limbs as bones and apply IK solvers directly to them (no more auto-boning or linkig geometry to bones!). Also, bone objects now have squash and stretch, and scaling built into them. If you need a cartooney character to stretch its arms, you can do it just by assigning a sqush property to the affected bones. I'll work into some tutorials to explain this more clearly as my schedule permits.

IK SOLVERS

These are new 'controllers' that allow you to use IK in your bones (I'll referr to any bone object/hierarchy as 'bones' from now on). With R4 we have three IK solvers:


HISTORY DEPENDANT IK SOLVER

This is the solver used in previous versions of max. What it does is calculate limb rotations through the solver's history. This means each time you animate the IK end effector, it looks back into previous keyframes and calculates the limbs rotations based on that. This causes that the futher you go in time, the longer the solver takes to get an IK solution. Therefore, animating becomes a slower process over time.

HISTORY INDEPENDENT IK SOLVER

This is a new solver included in R4. This solver doesn't depend on history, it solves rotations as it goes over time. Animating remains a very fast task. This is the best solver to use when animating characters. It also has a rotate plane helper, which helps us define the orientation of the plane used to place the bones when solving IK. More on this later.

LIMB SOLVER

This solver is primarly geared towards game development. It can only be used on two-bone chains. I haven't really used it, so I can't really comment on it.

WEIGHTED CONSTRAINTS

Constraints are very powerful tools to establish certain relationships between objects. They allow animators to easily animate objects based on other objects transformations. max4 includes the following constraints (from the help file):

Attachment constraint attaches an object's position to a face on another object.
Surface constraint restricts an objects position along the surface of another object.
Path constraint restricts an objects movement along a path. Position constraint causes the constrained object to follow the position of another object.
Link constraint links the constrained object from one object to another.
Look-At constraint constrains an object's orientation so that it's always looking
at another object.
Orientation constraint causes the rotation of the constrained object to follow the rotation of another object.

Most of these constraints were available in previous versions as controllers. The main difference (and a huge one, for that matter), is that constraints are weighted. That is, they allow more than one object to influence the constrained object, and each 'controlling' object has a certain weight (the amount of influence it has) that influences the constrained object. Therefore, any object can react to the influence of several objects.

WIRING

Wiring is a very user-friendly to a kinda expression-wizard interface. However, it goes beyond expressions. How? First, wiring controllers support bi-directional control, as opposed to expression controllers's uni-directional control. Also, they fully support the whole expression syntax, functions and operators, so they allow complex operations to be set. The workflow is pretty easy to set up. Just select one of the objects, bring up the wiring parameters dialogue (or the wire parameters command, either in the animation menu or your quad menu), select the controller to wire "from", select the second object, select the controller to wire "to", select a wiring direction ("to" and "from" becom relative), and hit the "connect" button. There you are. You can alter the expression in the expression window, and hit "update" when you're done. We'll be using a lot of wiring throughout this tutorial.


REACTOR CONTROLLERS

Reactor controllers have been available since R3, but I decided to include them here because we'll also be using them a lot. Basically, a reactor controller is a controller that will generate certain pre-set motion when something else happens in the scene.

ADD CUSTOM ATTRIBUTES

This is one of the features I've enjoyed the most with R4's arrival. The ability to add any kind of attribute to an object. This, combined with wiring, provides a combo of unlimited power (ok,ok. To much Locomotion last week...). We'll add lotsa custom attributes to our characters to be able to control them more efficiently.

SKINNING

Skin has been enhanced a lot in R4. Envelopes provide better initial deformation, shaded views display bone fallofs, and we have new deformers. There are three types of deformers. Joint angle deformers (for areas such as elbows, hips and shoulders),
bulge angle deformers (for areas like biceps), and morph angle deformers (a new in-skin morphing system).

Alright. Let's start this new series of character rigging tutorials. Again, and in the name of simplicity, we'll be using my ol' trusty bipedal character, Astro.

He gladly voluntaired for re-boning, skinning and IK setup (I must mention I also re-modeled his torso, arms and legs. He's now a patch guy). A task that wasn't easy on itself, but very enlighting (in terms of r4's new character features). This experience was made less painful thanks to the invaluable help of some people.

CREDIT WHERE CREDIT IS DUE

A couple of people who contribuited to this IK setup with invaluable information are Paul Neale and Michael B.Comet. Both contributed with a lot of ideas and designs regarding character setup. I'll continue to mention them as it becomes necessary.

WORDS OF CAUTION

1. One thing. I'll be constantly mentioning I align certain objects to other objects. Usually, when I do this, I align both the position AND the orientation. This is extremely important, due to the way rotations work. Refer to the pictures if in doubt.
2. Also, as a suggestion, as I'm working I constantly set locks on my objects. For example, in my rotator objects, I always turn on the move and scale locks in all axes. This is to prevent doing unwanted transformations on my objects (rotators are supposed to only rotate). This is a good working habit, and although I don't mention my lock setting throughout the tutorial, you should to easily inferr which locks to turn on per object.
3. One more thing you should remember THROUGHOUT the whole tutorial... ALL of the IK solvers used in this tutorial have their parent space set to Start Joint. This prevents gimble locking on the chain. REMEMBER to set this one for each solver created UNLESS NOTED OTHERWISE.
4. I use sometimes local euler controllers. These are helpful under certain situations. To determine when you need them, perform the following test. Grab the object you'll rotate. Animate the rotation. Playback. If you notice the object wobbles instead of rotating on the axis its supposed to, you'll be better off using local eulers. Local eulers are no longer supported as part of the UI, but they can be assigned via maxscript. Just copy the following text onto the listener, select it, and drag it onto a toolbar...

local objetos = selection as array


for i = 1 to objetos.count do


(


select objetos[i]


objetos[i].rotation.controller = Local_Euler_XYZ()

To use it, just select the object(s) you'll be assigning local euler controllers, and hit the button. It'll instantly assign local euler controllers to those objects. Swami also wrote a similar script and posted it in the forum, so you might want to check it out. A WARNING HERE! Local euler controllers behave strangely a lot of times. Some of the things you'll notice are gimble locking and reverse-rotations. These, however, can be easily taken care of, and the benefits justify them. There is also another script at scriptspot that changes the axis order for euler controllers. That'd give you a local euler behavior, without the drawbacks. I haven't tried that, but you might want to.

OK. So, let's get started.

THE SKELETON

For Astro's skeleton, I decided to use R4's new bone objects. If you're importing a character made in previous versions of the software (as I did), first delete all skin modifiers before deleting the old bones. I won't go into much detail about the skeleton design, since it's pretty straightforward. In general, create your bones and joints as close as possible to the real thing. If you're building a human skeleton, look into anatomy charts to see where bones lie and how they should be connected. The same for animals, etc. Let's take a look at Astro's skeleton...

SPINE AND NECK

As you can see, the spine was created using a bottom-up approach. That means I started with the joint at the waist, and proceeded towards the neck. You can create the neck and 'head bone' as part of the same chain. The spine will be animated using FK, with some custom controls to aid in the process. Draw the spine in any viewport. Then, turn on the bone's fins to see which way they're facing, and rotate them if necessary (the 'front' fins should be pointing towards the chest, and the 'back' fins towards the back). You may want to use snaps to ensure the spine is really straight. It doesn't matter, since we'll be using FK to animate it. You can delete the small bone created at the tip of it (you won't be using IK with it, so it's not necessary). Remember, always use a clear naming convention here. It's very important to keep cleanliness in your projects, or you'll be VERY sorry later when we start setting up controls for the character. I named my bones like this (from top to bottom): Bone_Spine01 - Bone_Spine02 - ..... - Bone_Spine06. To create the neck, just continue upwards creating two more bones. Mines are A_Bone_neck and A_Bone_head (The A_ prefix I should continue to use refers to this character in particular. This is to avoid confusion when merging more characters onto the scene). The fins you see coming out from the back of the character are used for visual refernce of the character's actual volume (he's got a backpack).

ARMS

The arms are pretty straightforward. Just Draw them from the shoulder to the wrist. It's best to do it in the top viewport.

Then, add a small bone that goes from the middle-top of the chest to the shoulder. This will be the 'clavicle' bone. Draw it somewhere away from the other bones, so that it doesn't become auto-linked to the other chains, and move it to its proper position. I named these bones like this: Bone_clavicleRT - Bone_armRT - Bone_forearmRT. (RT stands for right side. I name the left side bones in the same way but with a LT suffix).

LEGS

Another simple setup. It uses three (ok, four) bones. The ususal three for the leg (thigh, calf, and the small 'tip' bone we need for the IK solver to work), and a bone that goes on top of the chain. This bone will not move, and is only there for skinning purposes, so link the thigh bone to it. I named them A_Bone_skinleg, A_Bone_thigh and A_Bone_calf.

FEET

The feet have a very straight-forward bone setup. Just create one bone from the ankle to the ball of the foot, another from the ball to the toes, and leave the small tip bone there. Just make sure NOT to auto-link the first bone to the leg's calf bone or the IKterminator bone. They're named A_Bone_foot, A_Bone_toes, and A_Bone_IKterminator_foot.

 

HANDS

I used several bone chains here, one for each finger. The chains are born at the wrist, and go all the way up to the fingertips, going through each knuckle (I mean to create a new bone there). The fingers will also be animated with FK, with some automated, pre-made poses. Check the picture to see the complete names for this bones.

That covers pretty much the bone setup. Now, we'll get into the ugly stuff... IK.

Setting up FK - first, let me explain some basic stuff about rigging a character. The goal here is to create a rig that'll allow the animator to create a very broad range of expressive motions, while using very simple and well-laid out controls. The animator should have everything setup, so his work will flow steadily, quickly and, why not, pleasantly. I think I have been able to build a pretty decent rig, packed with lots of power and lots of ease. Nuff said, let's get to it.
We'll first set up FK-animated hierarchies, since it'll be easier to do. Let's start with the spine.

SPINE ROTATORS

Remember my ol' rotator helper objects? (now available in the scripts section). They're back! In new orange flavor! And you'll need some of them for your character (or any other helper object). Ok. I've set two of them at the root of the spine chain. One is orange, and one is red. One will control the hips rotation (red), and the other one will controls the spine's initial rotation. I also use three more, set at different levels of the chain (every two bones). Now, link the bone before each rotator object to the rotator, and the rotator to the following bone (in an upwards direction). The thing is to 'insert' the rotators into the chain. The first rotator should be the parent of the whole chain. The others should be inserted into the chain at their proper levels. Just link them to the bone below them, and link the bone above to them. I named mines something like 'Rotator_spinelow', 'Rotator_spinemid', and 'Rotator_spineup'.

CLAVICLE ROTATORS

These are pretty easy. Just create a rotator, align it with the clavicle bone (pivot-pivot and orientation), and link the clavicle bone (each) to its corresponding rotator. I named mines Rotator_clavRT and Rotator_clavLT (From now on, everytime I mention node names, I'll just mention the generic name. Add the RT or LT suffix as supposed). Then, link both to the last bone in the spine chain (Bone_spine06). I made mines larger and slightly deformed only to make them easier to select.

HIPS ROTATORS

Create another rotator (I made mine slightly bigger and colored in red), Align it with the Rotator_spinelow (align it both in position and orientation). Link the little bones at the beginning of the leg chains (the ones used for skinning) to it.

THE MASTER SPINE CONTROL

Now, create a really big rotator, and align it with the other two. We'll use this one to drive the spine's rotations automatically. The other ones will only be used to fine-tune posing. Name it 'Torso Rotator_autocontrol'.

 

WIRING THE SPINE UP

Alright. Let's wire the spine up. Please first verify that every rotator, and all of the bones in the spine chain, are correctly aligned. By this, I mean that all of them must have exactly the same local coords. If one is misaligned, it might throw off all of the others. Euler rotation controllers (which are the ones I use by default, with the occasional Local Euler in some nodes) are parent-dependant, so please check your alignments. You can correct any misalignment, by selecting the offending node, going to the hierarchy panel, pivot tab, turning on the 'Don't affect children button', and aligining the node. You can also use this button to move bones to their proper positions after creation. That said, let's get on.

Select all three spine rotators, and assign list controllers to their rotation tracks. Assign another euler rotation controller to the 'available' tracks. Name this new euler track something like 'eulerXYZ_auto'. This way, you'll know this controller is a 'driven' controller you can't touch. Set as active the original Euler tracks. Great. Now, select the huge autocontrol rotator, go to the animation menu (I use my quads for this), and select 'Wire parameters-wire parameter'. Select its X rotation track. Drag to the first spine rotator, click on it, and select its X rotation track under the EulerXYZ_auto controller (if you don't know how to wire parameters, please refer to your max docs). The wire parameters dialogue will appear.

On one side, you'll see the tracks for the autocontrol rotator, while on the other you'll see the tracks for the spine rotator object. In both sides, the X Rotation track should be selected already. Click on the arrow going from the autocontrol side to the spine rotator side (the autocontrol will be the 'driver', while the spine rotator will be the 'driven', if you pardon me using another 3d app's terminology). You'll see an expression in the bottom of the dialogue box. Leave it as it is. Click the 'Connect' button. That's it. Now, both nodes should be connected. Without closing the dialogue, select the autorotator object and rotate it in X. The smaller spine rotator should rotate with it. Now, select both Y tracks, and repeat the same operation. Same for the Z tracks.

Once done, close the transform track for the spine rotator object. Navigate down the hierarchy to the next rotator object (this is a track-view like window), open its transform tracks, go to the second Euler controller (EulerXYZ_auto), and select the X track. Select the original X track of the autocontrol object again. Set again the autocontrol object as 'driver', and the spine rotator as 'driven'. Repeat wiring the corresponding tracks of each object (X-X, Y-Y, Z-Z). Repeat ell this with the third rotator. You're done. If you like, you can check the spine now. If everything went ok, when you rotate the autocontrol object in any axis, the spine will bend with it, in a realistci manner. This is what this object is for. However, you can go into the spine rotators and rotate them to fine-tune the pose (that's why we needed two euler tracks. One for automatic rotation, one for manual).

Now, wasn't that easy? The spine is all set up. It's the only part that will be FK animated.(the arms and legs use an IK/FK approach). Let's continue with the arms

ARM IK

Ok. First, before assigning any IK to the arms, we need to go over a few things. First, let me explain a bit about the architecture behind my rig. The arm rig uses some complex controls and behaviours to control both IK behaviour, and inheritances. Take for example, a character doing pushups. You'd like to animate the rotations on the hips and spine, without worrying about the hands sliding all over the place. I've set some inheritance controls so that the wrists can or cannot inherit the arms movement and rotations. It is, however, not as simple (I wish) as setting standard inheritances. I achieved this by using two goals in the arm, and using weighted constraints on the wrists, so that you could alternate between an 'inherit' object, and a 'no-inherit' object. The constraint's weights are controller through a custom attribute I set on my arm control object. This object, which is the one you'll use to move the arm, also has some other custom controls to drive finger curling, IK swivel angles, wrist rotations, etc. That way, I can animate almost anything in my arm rig from this object, without having to select other objects, animate them, re-select the arm control object, etc. This makes animating characters a breeze. Therefore, there are some things we need to do prior to creating anything here, so that the whole thing will work perfectly. Let's get to it.

First, select the last bone in the arm chain (in my case, it'd be the 'Bone_ikterminator_arm' small bone). In the hierarchy panel, pivot tab, turn on the 'Don't affect children' button. Move the bone so that it's pivot point meets exactly the pivot points of the bones that start the hand assembly. This is crucial, or the hand will slide when the torso moves. Ok.

Select the arm bone (not the forearm one). Now, in your perspective view, really zoom in onto the ikterminator bone. Switch to a wireframe view if necesary (the hand bones are most likely getting in the way). Now, with the arm bone still selected, go into the animation menu (I have a toolbar for most of these operations), and select IK Solvers - HI Solver. Now, select the ikterminator bone. You'll see a blue cross at the ikterminator's pivot, and a line running from the cross to the pivot of the arm bone. The line is the IK solver. The blue cross is the goal. Whenever you move the goal, the IK solver will try to rotate the bones encompassed by it in order to meet the goal. These rotations are dependant on something called the rotation plane. You can't see it, but it's there. It's a plane that serves as a 'grond plane' to the IK chain, and it's originally parallel to the bones in the chain (that's why it's very important that the bones are aligned). This plane is controller by something called the swivel angle. By modifying this angle, you rotate the plane, thus rotating the bone chain, using the goal as a pivot. It's very much like moving your elbows while having your hands placed at your waist.

Now that we've gone over some IK basic concepts. Let's rig our arm.
Let's create some nodes we'll need for our arm rig. I used one spline object (just like the rotator, but pointy), and two point objects. Align them to the ikterminator bone (pos and orientation).Ok. Here we go.

Select the rotator (mine is colored purple). Link it to the forearm bone (not the ikterminator bone). In the hierarchies panel, link info tab, turn off the rotate inheritances in all axes. Name it NoInherit_arm.
Select the first point helper. Name it HandOrient. Link it to the NoInherit_arm spline object. Turn off the rotation inheritances. Now, apply an orientation constraint to it. Selec the forearm bone as a first target, and the NoInherit spline obj as a second target. For now, set the forearm's weight at 100, and the NoInherit object's to 0.

Select the second point object. Name it WristControl.Link this one to the HandOrient point object. Now, select each root bone in the arm and link it to the WirstControl obj. Here's a shot of my schematic view.

Click to enlarge

Click to enlarge

Create a new point helper object. Name it Control_arm, and align it with the IK WirstControl obj. Now, add the following custom attributes to it:

Name: Thumb Curl. Type: Float spinner. From -15 to 70, default 0. Object's base level.
Name: Index Curl. Same params as before.
Name: Mid Curl. Same params as before.
Name: Pinky Curl. Same params as before.
Name: Finger spread. Type: Float spinner. From -15 to 15, default 0. Object's base level.
Name: Inherit Arm. Type: Float slider. From 0 to 100, default 0. 4 ticks. Object's base level.
Name: Swivel Angle. Type: Float spinner. From -360 to 360 default 0. Object's base level.

As you might have guessed, most of these are hand-related controls. You'll see how easy is to animate both the arm and hand with these controls. Link the IK chain you created to it.



First, we'll wire the Swivel Angle parameter to the chain's swivel angle. Just select the point object (A_Control_arm), go to Animation/Wire Paramters/Wire Parameter, and select the IK chain (my point object has the cross option turned off so the IK chain underneath can be selected. I used instead the Axis Tripod option). The wire parameters dialogue will appear. Wire the point's object Swivel Angle Parameter to the IK chain's swivel angle parameter. Set the direction from the point object (driver) to the IK chain (driven). In the expression textbox, enclose the current expression in parenthesis, and add the following to the beggining of it... 'degtorad'. This tells the expression to convert the value from degrees to radians. This is necessary to have the results you expect.

Proceed to the next page for more on the arms.

MORE ON THE ARM IK

Ok. Now comes a lot of repetitive work, so I'll just explain it once, and you repeat it as needed. We'll be wiring the finger controls to the fingers. We'll take the Index Curl parameter, for example. But first, let's prep the fingers. Select all of the finger bones, and assign a list controller to each of their Y rotations tracks (I use local euler controllers on them). Now, select the bones that would be the first bone in each finger (say, A_Bone_index_root), and assign to them another list controller to their Z rotation track. Ready. Re-select the control_arm point object, and open up the wire parameters dialogue box. Make sure that in the wire paramters dialogue, you are seeing the control_arm node in one side, and in the other the Bone_index_root node. Select the index curl parameter track in the control_arm side. Select the track marked as 'availble' in the Index_root's Y rotation list controller. Wire from the index_curl parameter to the Y avalible track. In the expression window, add the degtorad expression to it.

Without leaving the wire parameters dialogue, navigate to the next bone in the chain, in this case, A_Bone_index_mid. Repeat the wiring from the index_curl parameter to the bone's avalible controller in it's local Y rotation tracks. Finally, repeat for the last bone in the index finger chain. To test if everything is working ok, grab the control_arm object and in the modify panel play with the index curl spinner. The index finger will bend forward and backwards.

Now, you'll need to do the same for the rest of the fingers, wiring them to their proper parameter in the control_arm object (pinky fingers to the pinky curl parameter). To finish wiring the fingers, let's wire the Finger spread parameter. This parameter goes wired to each of the root bones of the fingers. Specifically, to their available Z rotation track. There is, however, one detail. Since this parameter spreads the fingers (open or close), the expresion value will have to be positive for either the index or pinky finger, and negative for the other. The middle finger needs to remain still (in the case of normal 5-fingered characters, both the mid finger and the ring finger would need to spread a bit). To make one of the values negative, you'd need to add a minus sign before the degtorad expression. In my case, I added it to the index finger, leaving the pinky as it was.

And lastly, the Inherit Arm slider. This slider is intended to make the hand inherit or not the arm's movements and rotations. This is so that you can pin the hand to anything else (a wall or the floor) and remain statick while the rest of the character moves. What this slider does is control automatically the oriantation constraints placed earilier on the HandOrient point object. But we'll use expressions to drive this one.

Select the HandOrient node, and in the motion panel create two expression controllers, one for each weight track in the orientation constraint controller. Open one of the expression controller for the weight0 track, create a scalar variable, and assign it to the Control_Arm's Inherit Arm track. Enter the variable's name you just created as the expression. Do the same for the second expression, but in the expression window enter the following expression... 100-variable.

This way, the slider will automatically drive the weight on both constraint controllers, interpolating correctly from 0 to 100 and 100 to 0.

Lastly, so you can control everything from the Control arm Node, wire its x,y and z rotation's to the WristControl x,y and z rotations. This way, you can rotate the arm control object, and the wrist will rotate (so you won't have to worry about having another node tim animate). If one of the rotations is reversed, enter a minus sign before the expression in the wire parameters dialogue (test by rotating the Control Arm node). 

There you go. Your arm should be fully functional and working properly.  

LEG IK

Let's now set up the legs for our character. Before doing so, it's very important to understand how legs work, and how certain basic motions are achieved, like walking, jumping, turning and pivoting.

If you stand up and walk a few steps (please do if you can), you'll notice that the walk cycle uses different pivots at different stages of each step. You start using the ankle, then the heel, then the ball, and then the toes. This requires leg setups to have several pivot points that work independently, but also as a group. This makes crucial to know not only where to place pivots, but how to link them together so that they'll work as expected. Take some time watching yourself in the mirror doing several actions, and watch carefully how your legs and feet move and act during each motion. You'll notice that this is perharps one of the most complicated areas of motion.

Ok. Now that you've got a grasp of how your leg moves let's begin.

Rigging the leg it's pretty straightforward. Just create a HI IK solver that goes from the thigh bone (Bone_thigh) to the leg's little end bone (Bone_ikterminator_leg). That's it. You can grab the goal and move it, and your leg should move properly. Remember to set the IK solver's parent space to Start Joint. Name this solver IKchain_ankle

Now, let's create the IK solvers for the feet. Select the first bone in the chain (Bone_foot), and create an HI IK solver that ends at the next bone (Bone_toes). Create a second HI IK solver from Bone_toes to Bone_ikterminator_foot. If any of the bones go whacko and become strangely rotated, adjust the IK solver's swivel angle (mines are at 0). Name these solvers IKChain_ball and IKchain_toes. Set the IKchain_ball's parent space to IK goal (this is the ONLY solver set this way). The reason for this is because if we don't do it this way, the foot will twist when rotated on the world Z axis. Let's continue.

It's time to start placing the helper objects (points and splines) that will drive the rotations of the foot. There are a lot of controls involved here, some of which I've managed to automate using custom attributes, wiring, etc.

Place two point objects. One at the ankle and one at the ball of the foot. Name them FootControl and Pivot_ankle respectively. Aligin them pivot-pivot with the following nodes:

FootControl - Bone_IKterminator_leg. (Position).
Pivot_ankle - Bone_foot. (Position and orientation).

I've changed the display attributes on mines. Select the FootControl point, and set its absolute rotation values to [0,0,0].

Now, create three rotators and two point obejcts more. Position one of the point objects EXACTLY at the heel of the foot. Name it Pivot_heel. Place the second point object at the ankle. Name it LocalRotation. Place one rotator at the ankle. Name it Rotator_foot. The next one goes at the ball, and it's named Rotator_toes. The last one goes at the pivot of the ikterminator bone of the foot. It's named Rotator_rollfoot. Align them as follows:

Pivot_heel - Bone_toes (orientation)
LocalRotation - Bone_foot (position and orientation)
Rotator_foot - Bone_foot (position and orientation
Rotator_toes - Bone_toes (position and orientation)
Rotator_rollfoot - Bone_ikterminator_foot (position and orientation)

There you go. Let's start the linking process.

Prevoius point objects hidden for better viewing (above)

Ok. Link the IKchain_toes to the Rotator_toes. Link the IKchain_ankle to the Pivot_ankle. Link all three, the Rotator_toes, Pivot_ankle, and the IKchain_ball to the Rotator_rollfoot. Link the Rotator_rollfoot to the Picot_heel. Link the Pivot_heel to the LocalRotation. Link this one to the FootControl.

Select the Rotator_foot object, and link it directly to the Bone_ikterminator_leg. Then, link the Bone_foot to it. Turn off all of its inheritances, and lock the Y and Z rotation axis for it.

Everything is set. Now, here are the instructions on how to use it. First, grab the Rotator_toes and rotate it on Z (local). You'll see the toes go up or down. Very nice. You can actually lock the remaining rotation axis, since you'll only rotate it on Z. Also, lock the move axis too (all). Now, select the Rotator_foot node. Rotate it on X (local). Lock off the remaining axis. This control only 'twists' the foot. Something very important if your character does karate (yoko-geri anyone?). Now grab the Rotator_rollfoot node. Rotate it on Z (local). You'll see the whole leg move when you rotate it upwards. This is indeed nice. You get a complete foot rolling motion. This will aid a lot in the creation of walk cycles. You can also rotate it on Y (local). Grab the Pivot_ankle node and rotate it on Z (local). You'll notice it does the same thing, but it excludes the toes from the motion, leaving them locked to the ground. The Pivot_heel does the same, but at the heel point. Select now the LocalRotation node. This node controls the foot rotation on 'local' coordiunates. Rotate it and see (just lock the X axis... that one is controlled by the Rotator_foot node). You may rotate it in Z and Y. Lastly, select the FootControl noe. This one rotates the foot on 'world' coordinates (since it's aligned to the world). Rotate it. If you move it, the whole leg, foot should also move. You may notice the motion is far from perfect. There are some things we need to adjust to contiue.

First, select the two IK chains in the foot, and turn off the Use swivel angle at the IK solver properties rollout (motion panel). We don't need swivel angles for these solvers. Now, select the ControlFoot object, and add the following custom attributes to it...

Foot Roll: Float spinner. From -5 to 10 default 0.
Inherit Swivel: Float slider. From 0 to 1 default 1
Swivel Angle: Float spinner. From -360 to 360 default 0.

There we go. The Swivel Angle attribute will adjust the leg's swivel angle. A lot of people use separate objects for this. I like to use CA's whenever possible. It keeps things clean, and I can get a lot of commands in the same place.

The inherit swivel attribute will play an important role in leg-foot interaction. It will determine if the whole foot should inherit the rotation caused by adjusting the leg's swivel angle. Most of the time, you'll want this on. But there are times where you might want to move the character's knees without disturbing the feet. That's what this slider does.

And lastly, the Foot roll control will make the whole foot perform a pre-programmed progresive roll. This is a very complex motion, and we'll be controlling it from this spinner only. Let's get going.

Let's do the Foot Roll thing first. Here, we'll make use of a very powerful tool max has... reactor controllers. Reactor provide with a very powerful and procedural way of controlling motion. Basically, what they do is control any animatable attribute within an object basend on any other animatable attribute in any object. The user just sets certain conditions to be met, and the controller will update itself accordingly. You can even customize the reaction by using custom cuves to have non-uniform reactions. Way to beautiful to describe accurately... you'll need to experience it (if you've never used these controllers, I strongly suggest going into the docs and reading all there is about them, and doing the examples in your docs).



Ok. First, lets go over what the Foot Roll control will do. It'll do a motion that goes from having the foot in a pre-step pose to a finished roll just before you lift the foot.

That's why this attribute goes from -5 to 10. At -5 the foot is rotated backwards on its heel pivot. At 10 it's fully rotated forward on its toes. At 0 it remains at its neutral pose. There are some additional motions going up in between, but let's start doing it.

MORE ON THE LEG IK

First, we'll need to assign the reactor controllers. Select the Pivot_heel point. Assign a list controller to its Z rotation track. Assign a reactor controller to the track labeled 'Available'. When prompted to select the React to object, select the Foot Roll attribute in the FootControl object. Leave the reactor's properites dialogue box open. Repeat the above operation for the Pivot_ankle and Rotator_footroll objects. Once you have the three reactor dialogue boxes open, do the following.

If you stand up and walk a few steps (please do if you can), you'll notice that the walk cycle uses different pivots at different stages of each step. You start using the ankle, then the heel, then the ball, and then the toes. This requires leg setups to have several pivot points that work independently, but also as a group. This makes crucial to know not only where to place pivots, but how to link them together so that they'll work as expected. Take some time watching yourself in the mirror doing several actions, and watch carefully how your legs and feet move and act during each motion. You'll notice that this is perharps one of the most complicated areas of motion.

Animate the FootRoll attribute so that at frame 0, it has a value of -5. At frame 10, it's value should be 0. At frame 20, a value of 5, and at frame 30 a value of 10. Go back to frame 0.

Go into the reactor dialogue for the Pivot_heel object. One reaction has already been created. Rename it to Pre Roll. Press the Set Reaction Value button, and adjust the state spinner. As you adjust it, you'll see the foot roll on its heel. Adjust it until you get a pre-roll pose you like. Then, move the time slider to frame 10 (when the Foot Roll has a value of 0). Create a new reaction, and name it Neutral. Click on the Set Reaction Value button, and enter a value of 0 in the State spinner. This will return the foot to its neutral state. You can close
this dialogue box if you wish.

So far, you've already created the pre-roll motion. Move the timeslider and see your foot rotate on its heel automatically. Regoice yourself... (just kidding here...). Let's continue.

At frame 10 (you should still be there), go into the Pivot_ankle reactor controller dialogue box. Re-name the current reaction to Neutral. Click on the Set Reaction Value button, and enter a value of 0 in the State spinner. Now, move to frame
20. Create a new reaction named Mid Roll. Click on the Set Reaction Value button, and start adjusting the State spinner. You'll see your foot roll on its ball. When you get the angle you like, close the dialogue box. Go into the last reactor controller dialogue box, rename the current reaction to Mid Roll, click on the Set Reactions Value button, and enter a value of 0 in the State spinner. Move to frame 30, and create a new reaction. Name it Full Roll. Click on the Set Reaction Value button, and start asjusting the State spinner. You'll see the foot roll on its toes. Adjust as desired. Close the dialogue box.

Go back to frame 0 and move the time slider (alternatively, adjust the Foot Roll spinner on the FootControl object interactively). Watch your character do a complete foot roll. This is a fully automated foot roll.

As last minute touchups, select again the three nodes involved (one by one), go to their rotation tracks, and set as active the bezier float contoller in the list controller of their Z rotation track. This will allow you to animate the objects interactively while keeping the automated controls active underneath. We'll do that constantly.



Ok. We got the first control all set up. Let's get going with the third. ???, you might say. What about the third. We'll leave that one for the last. The third control is the Swivel Angle custom attribute. This one is set up just the same way as the arm. Since we've already done this, I won't go into details. Just wire this attribute to the IKchain_ankle's swivel angle. You're done (don't forget the degtorad expression!!!).

EVEN MORE ON THE LEG IK

Now, let's go to the second attribute. The inherit swivel. This is actually just a fake. Whai I did was create a script controller that controls the FootControl's Z rotation based on the value of this slider. If the slider is at 1, the FootControl (and thus the whole foot) will rotate with the leg. If its value is 0, it won't rotate. It's really simple to set up, so let's start doing it.

Select the FootControl point object, and assing a script controller to its Y rotation track. The script controller window will appear. There will be a number on it. TAKE NOTE OF THAT NUMBER! You may insert a line or two before it. Then, enter the following script...

First, select the two IK chains in the foot, and turn off the Use swivel angle at the IK solver properties rollout (motion panel). We don't need swivel angles for these solvers. Now, select the ControlFoot object, and add the following custom attributes to it...

dependsOn $A_FootControlRT.swivel_angle $A_FootControlRT.inherit_swivel

-degtorad($A_FootControlRT.swivel_angle * $A_FootControlRT.inherit_swivel)-1.57074

Notice that the actual names of the nodes involved don't match mines. Remember I add a LT or RT suffix to each node depending on what part of the character it is (RT= right, LT=left), and that I add a prefix depending on the character so that I won't have duplicate names when merging characters together (A_ = Astro). Just adjust the names as needed, but these MUST match the ones of your objects, or you'll get undefined errors when evaluating the script. Substitute the number I've got at the end of the script (-1.57074) with the one the script controller window gave you when it opened (it can be a positive or negative number). Press evaluate. If you don't get any errors, adjust the swivel angle. You'll notice that the knee rotates, but the foot doesn't. This is because there seems to be an issue with script controllers referrencing attributes located in the same object they're in. To have the controller update itself, move the slderbar a bit. You'll see the foot react. If it rotates in the opposite direction, erase the minus sign before the degtorad expression in the script. Close the window. Now, convert this script controller into a list controller (the scrip controller will be inside of it), assign a bezier floar controller to the available track and set it as active.

There is another node that needs to react to the inherit swivel, adn it's the Rotator_foot object. Now, this one is a little bit tricky, because it's not aligned to the leg. However this doesn't mean it won't work. Here's how it's done.

Select the rotation track on this object (I used a local euler controller). Convert it onto a list controller. Assign another euler controller at the avalialble track. Name this controller something like EulerXYZ_auto. Now, assign script controllers to both the X and Y tracks. Enter the exact same script you have above to these controllers. The difference will be that you won't need to add or substract a number from the expression, since the controller gave you a value of 0 when it was assigned. The only difference between both tracks is that you should enter a number at the end of the expression for the X track. This is the script I have:

dependsOn $A_FootControlRT.swivel_angle $A_FootControlRT.inherit_swivel

degtorad($A_FootControlRT.swivel_angle * $A_FootControlRT.inherit_swivel)/1.7

So, how did I get that 1.7? By eyeballing. What does it do? It compensates for the misaalignement between the leg's oriantation and the foot's. If you don't add that number, you'll see the Rotator over-rotate in response to the swivel angle. This division compensates and makes the Rotator rotate properly. By the way, for some strange reason, this object won't react interactively. Just scrub the time slider to force an update.
 
There you are. You've got everything all wired up now. We need still to add some more controls so that our foot behaves solidly as one single unit, so let's take that last stretch.

Select the LocalRotation node, and assign an expression controller to its X rotation track. Take note of the number that appears at the expression window. Create a scalar variable, and assign it to the Rotator_foot's X rotation track. In the expression window, enter the variable's name and add or subbstract the number the expression gave you from it. Close the window. Turn this expression controller into a list controller, assign a bezier controller to the available track, and set it as active.


So, we're done. Your foot (and at this point, the whole puppet) must be ready and steady. I always try my rigs by doing a small short animation where the rig is really stressed. If your rig breaks, you need to work on it. If it does the job, you're ready to go into production. But before you jump into doing Toy Story 3, let's do the last touch ups to the rig.

ANIMATABLE PIVOT POINTS

What we'll do is add some link constraints to the puppet, so we can controll it much better. I'm not even going to explain the procedure, but here's what I did and why.

So, what is this all about? Obviously, you'll want to keep the hands and feet independent from the body when animating, so why link them to it? First, it allows me to place my character with more ease. When you merge a character onto a new scene, most of the time you'll need to move him. This way, I just move the COM, and the hands and feet go with it. When I start animating, I just add another object as a new target (most of the times I add the floor), and animate. Also, it works when the character needs to fly. By having the hands and legs linked to the COM, I can concentrate of the flying without worrying of having nodes stay behind. And the third advantage is that if my character needs to yield, say, a daito (a sword you hold with both hands), I can link both hands to it and animate the sword, instead of linking the sword to one hand, animating the hand, and having to match the other hand to the sword (this also applies to carrying a box).



And what about the COM? Well, by linking it to two different objects (the two Points we added) at different times, you can have an animatable pivot point. What if you want the character to do a backflip, land on one finger, and rotate several times on it while twisiting a-la break dance? Easy. When you're done with the backflip, just place the pivot at the point of his finger as he lands, link the COM to it, and animate the pivot rotating. The whole character will rotate at that point (I also use the ground as a target for the constraint when I need no extra pivot). I don't add the pivots and the pivot constraint until my character is already on stage, so you might want to skip that on your character files, and leave it for the scene files.

I hope you enjoyed creating this rig. As you can see, character rigging is an art onto itself, and I must say I enjoy rigging characters as much as I enjoy animating them. I've uploaded my rig file, so you can take a look at it, disect it, modify it, etc. I hope this was of any help, and that you'll be able to rig anything else you come up with. Have fun, and let me know how you liked this. Luck!!

DOWNLOAD THIS TUTORIAL'S RIG

Enter content...

Fetching comments...

Post a comment