Browse the wiki

03. Rigging the neck and head

With the torso rig complete, we have a base to start adding the neck, head, arms and legs. Although you could go in any one of these directions, we’ll tackle the neck and head next.

Introduction

Here we are going to create FK joints and controls for the neck, head, eyelids and ears. For the eyeballs we’ll be using aim constraints so we can lock the eyes on a particular point. There is no reason why you can’t go for an IK neck set up as was done for the spine, if that works better for you. I simply prefer an FK set-up, and in any case, through space-switching we’ll be adding IK-like capabilities to the head.

 001. Creating the head joints

 

Let’s start by creating the main joints for the neck and head. In the side view, activate the Joint tool and, holding down the V key, point snap the root joint to start at the tip of the spine joint chain. Make sure to click slightly away from it, so it creates a new joint chain, rather than parenting itself to the spine. Click again between the neck root joint and the ear, and then make another click just below and in front of the ear. Still in the tool, hold down the Shift key, and make one more click at the top of the head.

Now let’s take care of the orientation of the joints. Select the root joint of the new chain and go Skeleton > Orient Joint (Options). In here, set the Primary Axis to Y, the Secondary Axis to Z and the Secondary Axis World Orientation to Z (+). Rename the joints from root to tip as follows: neck1_jnt, neck2_jnt, head_jnt, and head_end_jnt.

Now we turn to the jaw joints. Create a new joint chain starting from just in front of the ear and ending at the chin. To visually mimic the shape of the actual jaw bone, I actually add an extra joint. With the jaw bone in place, as we’ve done previously, orientate the joints to give you the correct behaviour, and don’t forget to freeze the transformations to zero out the rotate values. Rename the joints from root to tip as follows: lowerJaw1_jnt, lowerJaw2_jnt and lowerJaw_end_jnt.

Next, let’s create an upper set of jaw joints. Although this is not accurate anatomically, I do this so I have something to attach the upper teeth and gums to. So create a new three-joint chain, as illustrated in Fig.01c, and rename the joints from root to tip as follows: upperJaw1_jnt, upperJaw2_jnt, and upperJaw_end_jnt. Again, take care regarding the orientation of the new joint chain using the Joint Orient tool. I actually had the joints rotate in the opposite direction of the lower jaw, so that should the animator rotate them together, they could make the mouth open wider.

Now take both lowerJaw1_jnt and upperJaw1_jnt, and parent them both under head_jnt.

02. Creating the eye joints

 

First we need to find the centre of the eyeball, in order to start our joint chain from that position. To do this, select the left eyeball geometry and, in the Attribute Editor, jump to the left-most tab (the Transform tab) and under Pivots, enable Display Rotate Pivot to reveal a small locator. Activate the Joint tool and in the side view, hold down the V key and point snap the first joint to this locator. With the Shift key held down, create a final joint at the bulge of the cornea.

If you’re following along with the videos, at this stage I rotate the joint to sit in line with the orientation of the eyeball. /Do not/ do this as it makes more work when creating controls for the eyes. In fact, I had to go back and rectify this, and I’d like to save you that inconvenience. Instead, rotate the eyeball geometry to match the orientation of the joints, and leave the joint as it is.

Rename the joints from root to tip: l_eye_jnt and l_eye_end_jnt. Now duplicate l_eye_jnt and put a minus in front of the value in the Translate X attribute to pop it over to the right-hand side. Double check the position sits correctly within the eye. If your model is asymmetrical like mine, you’ll need to slightly offset the position. Rename this joint chain as r_eye_jnt and r_eye_end_jnt. The reason I did not mirror this joint over is so that both eyes will go in the same direction when rotated together rather than creating the cross-eyed look.

Now duplicate either one of the eye joints and pop a 0 into the Translate X attribute to centre it. Rename this joint eyes_root_jnt and parent both, l_eye_jnt and r_eye_jnt under this new joint. Lastly, take eyes_root_jnt and parent it under head_jnt. With the joints in place, duplicate the eye geometry, rename them l_eye_lr_geo and r_eye_lr_geo, and parent them under their respective eye joints.

003. Creating the ear joints

 

Next we come to the ears. Sometimes I don’t rig the ears, but every now and then I do, as small movements added during animation can add a bit more life to a character. In side view, create a three-joint chain from the tragus to the helix. Translate the joint chain to sit within the ear geometry in Perspective view, and then use the Joint Orient tool to set the correct behaviour. Following this, rotate the joints to sit better within the geometry, and go Modify > Freeze Transformations to clean up the rotate channels.

Back in the side view, create a two-joint chain from the tragus to the lobule, and tidy up the position and orientation again. Duplicate the root joint for the initial joint chain we created, and delete all the children joints from this new chain so you have a single floating joint. Position this joint to sit between the existing two joint chains and then go Skeleton > Orient Joint (Options). Enable Orient Joint to World and hit Apply. Then parent the existing two joint chains under this single joint.

We can now independently animate the ear lobe, the main body of the ear, or carry both together. Have a play with the joints to see if you are happy with the behaviour. If not, feel free to try something different.

Now for renaming the joints. Select the parent joint and rename it l_ear_root_jnt. The joint chains will then tail off in the hierarchy. Rename the two-joint chain from root to tip: l_ear_lobe_jnt and l_ear_lobe_end_jnt. Then rename the three-joint chain as follows from root to tip: l_ear1_jnt, l_ear2_jnt and l_ear_end_jnt.

Now select l_ear_root_jnt and go Skeleton > Mirror Joint. Because my model is asymmetrical, I have to manually translate the ear to get it into the correct position. With both ears lined up, parent both l_ear_root_jnt and r_ear_root_jnt under head_jnt.

004. Adding the eyelid joints

 

For the eyelid joints, select and duplicate l_eye_jnt, and then rotate it to line up with the lower eyelid. Now go Modify > Freeze Transformations to clean up the rotation values. Rename this joint, from root to tip: l_lowerLid_jnt and l_lowerLid_end_jnt. Now duplicate l_lowerLid_jnt and rotate that joint chain to fit in line with the upper eyelid. Freeze the transformations again and rename the joints appropriately.

Like we did with the jaw joints, we want to be able to rotate both the upper and lower eyelid joints together, and have them open the eyes wider or close them tighter. To allow for this, select l_upperLid_jnt, rotate it on its axis by 180˚, and then freeze its transformations to pass the rotations to the Joint Orient.

For the right eyelids, due to the asymmetry of the face, I duplicate the l_eye_jnt and repeat the process rather than mirroring the left eyelid joints. As we duplicate the eyelid joints from the eye joints, they should all be parented to the eyes_root_jnt. If not, make sure they are. At this stage, as we did for the torso, chop up the model, rename the pieces, and parent the geometry pieces to the relevant joint.

005. Creating the head controls

 

From the neck up, we are going to be creating all FK controls. Later on, however, we’ll add some space-switching functionality to allow for the behaviour of the head to be changed. Select the neck joints (neck1_jnt and neck2_jnt) and use the createControls.py script to create the controls. Make sure to change the final line to read as below, because we only need to orient-constraint most of the joints to the controls:

21 cmds.orientContraint(ctrl, s, mo=0)

Select the newly created controls, hit F8, and in component mode, edit the shape of the controls to better fit around the model. For the control hierarchy to work correctly, take neck2_ctrl_offset and parent it under neck1_ctrl. Select head_jnt and lowerJaw1_jnt, and run the script again. Edit the shape of the controls and parent lowerJaw1_ctrl_offset under head_ctrl. Then take head_ctrl_offset and parent it under neck2_ctrl.

As we won’t be adding an additional jaw joint, rename lowerJaw1_ctrl to lowerJaw_ctrl to avoid confusion for the animator. Make sure to do the same for the _auto and _offset nodes. Now repeat the same process for the ear controls but leave the eyes alone for now.

The last thing we need to do is point constrain neck1_jnt to neck1_ctrl so that we can connect the neck to the torso. To do this, select neck1_ctrl, Shift-select neck1_jnt, and go Constrain > Point (with the default settings). We could have handled this with just one parent constraint, rather than an orient and point constraint, but I’ll leave that decision to you.

 

006. Fixing the eye joints

007. Creating the eye controls

 

Let’s start by creating the controls for the eyelids. Select l_lowerLid_jnt, l_upperLid_jnt, r_lowerLid_jnt and r_upperLid_jnt, and execute the createControls.py script (set to orient constraint) to create the controls. Now switch to component mode (F8), and position the controls to be more easily selectable. Select all four _offset group nodes for the eyelid controls now and parent them under head_ctrl.

 

Now for the eye ball controls. Start by going Comet > Shape > Plus to create a curve that looks like a locator. Make sure it’s positioned at the World centre. Rename it l_eyeBall_ctrl and then hit Ctrl + G twice to create the control hierarchy. Name the top-most group l_eyeBall_ctrl_offset, and the next down l_eyeBall_ctrl_auto. To position the control, parent it under l_eye_jnt, zero out the Translate and Rotate attributes to snap it into place, and then unparent it. Next, create the control for the right eye.

 

Once you have both sets of eye controls, select the _offset node for both, and in Object mode (it’s very important to set it to Object), translate them both out in front of the character, as illustrated in Fig.06c. In this order, select l_eyeBall_ctrl, Shift-select l_eye_jnt, and go Constrain > Aim (Options). Reset the settings, and then set the Aim Vector to 0, 0, -1 (our joint is pointing at the control down this axis). Then set the Up Vector to 0, 1, 0 and hit Apply. Do the same for the right eye, and you will now be able to translate the new eye controls to drive the rotation of the eyeballs.

Next, we want to create a new control that will carry both individual eye controls together. Start by going Comet > Shapes > square. Rename this to eyes_ctrl, and group it to itself twice. Rename the top-most group eyes_ctrl_offset, and the next group down l_eyes_ctrl_auto. We now want to position this control perfectly between the two eyeball controls. Select both l_eyeBall_ctrl and r_eyeBall_ctrl, Shift-select l_eyes_ctrl_offset, and go Constrain > Point (with Maintain Offset disabled). The control should snap into place.

Now select the pointConstraint1 that lives under l_eyes_ctrl_offset, and delete it. Jump into component mode next, and scale and rotate the shape of the control. To rotate the control with increments, hold down the J key on the keyboard. Select both l_eyeBall_ctrl_offset and r_eyeBall_ctrl_offset, and parent them under l_eyes_ctrl.

 

008. Space switching the eyes

 

At the moment, the eyes do not follow the head control. Let’s add an optional feature that can allow them to do so. Start by creating two locators and renaming them eyes_head_follow_loc and eyes_world_follow_loc. Parent both new locators underneath eyes_ctrl, zero out the translation values, and then unparent them.

 

Select both locators and then add eyes_ctrl_auto to the selection, and go Constrain > Parent. Now take the eyes_head_follow_loc and parent it under head_ctrl. Then select eyes_world_follow_loc, hit Ctrl + G to group it to itself and then rename that group world_follow_loc_grp. Moving the head_ctrl will now carry the eyes_ctrl but only with 50% influence. The other 50% is currently driven by the eyes_world_follow_loc. We’ll use a custom attribute and Set Driven Keys to dictate which mode should have full control over the eyes.

 

Select eyes_ctrl and go Modify > Add Attribute. Here we will create our custom attribute. Give it a Long name of eyesFollow. Set the Data Type to Enum. Then under Enum Names, highlight Green and give it a New name of head. Then highlight Blue and give it a New name of world. In the Channel Box now, you should see our custom attribute. You can also find this in the Attribute Editor.

 

Now go Animate > Set Driven Key > Set. This is the window we will use to drive the attributes of one object with the attributes of another. Select eyes_ctrl and hit the Load Driver button on the Set Driven Key (SDK) UI. This will drop the object into the top-left box and the attributes for that object into the top-right box.

Select eyes_ctrl_auto_parentConstraint1 (under eyes_ctrl_auto) and hit Load Driver. This is the constraint that houses the weighting values that we can use to control whether the eyes should follow the head or not. The constraint should pop into the bottom-left box, and its attributes in the bottom-right.

At this stage, select eyes_ctrl and set the Eyes Follow attribute to Head. Then select eyes_ctrl_auto_parentConstraint1 and set the Eyes World Follow Loc W0 to 0 and leave Eyes Head Follow Loc W1 at 1. Back in the SDK window, highlight eyes_ctrl in the top-left box and Eyes Follow in the top-right box. Then highlight eyes_ctrl_auto_parentConstraint1 in the bottom-left box and both Eyes World Follow Loc W0 to 0 and Eyes Head Follow Loc W1 in the bottom-right box.

Now hit Key on the SDK window. If you select eyes_ctrl_auto_parentConstraint1, you’ll see that the weight attributes are now highlighted in red, indicating that they’ve been keyed. We have now defined that when the Eyes Follow attribute is set to Head, the eyes_ctrl will follow the head. Let’s reverse this next.

 

Set the Eyes Follow attribute to World now. Then select eyes_ctrl_auto_parentConstraint1, and this time set the Eyes World Follow Loc W0 to 1 and the Eyes Head Follow Loc W1 to 0. Back in the SDK window hit Key once more. We have now defined that when the Eyes Follow attribute is set to World, the eyes_ctrl will not follow the head. Test it out before moving on and do get familiar with this SDK window as we will be using it for many, many tasks later on.

009. Space switching the head

 

Now we’ll do a similar thing with the head. This time, we’ll allow the head to follow either the neck, the chest, the COG, or the world. The first thing we need to do is hook the head to the chest. To do this, parent neck1_ctrl_offset under chest_ctrl. Next, create four locators and call them: head_neck_follow_loc, head_chest_follow_loc, head_COG_follow_loc, and head_world_follow_loc.

 

Take all four locators, parent them under head_ctrl, zero out the translate and rotate values (so they pop into the correct place) and unparent them. Select head_ctrl and go Edit > Add Attribute. In the window that pops up, set the Long name to headFollow, the Data Type to Enum, and add the following entries: neck, chest, COG, and world. Now select in this order: head_neck_follow_loc, head_chest_follow_loc, head_COG_follow_loc, head_world_follow_loc, and then head_ctrl_auto, and go Constrain > Orient.

 

The next thing to do is to open up the SDK window. In here, set head_ctrl as the Driver object and the head_ctrl_auto_orientConstraint1 node as the Driven object. Set the Head Follow attribute to Neck, and on the orient constraint node, set all the weights to zero apart from Head Neck Follow Loc W0, which should remain at 1. Once you have done so, hit Key on the SDK window. Then set the Head Follow attribute to chest, zero out all the weights on the orient constraint node except for Head Chest Follow Loc W1, which you should pop up to 1, and then hit Key once more. Continue to do this for the COG and the world attribute.

 

We now need to pop the locators under the relevant control so every goes swimmingly. Start by parenting head_neck_follow_loc under neck_ctrl. Then parent head_chest_follow_loc under chest_ik_ctrl_loc. Parent head_COG_follow_loc under COG_ctrl, and lastly parent head_world_follow_loc under world_follow_loc_grp. Test out the rig at this stage, making sure the head doesn’t wander off as you articulate the torso. Once you’ve tested the head, select all four locators, zero out the visibility in the Channel Box zero, and finally lock the attribute.

 

010. Cleaning up the head rig

 

A bit of housework is in order now. Select neck1_jnt, hit Ctrl + G, and call this group head_jnt_grp. Select eyes_ctrl_offset, hit Ctrl + G, and call this group eyes_ctrl_grp. Now rename torso_doNotTouch_grp to torso_rig_doNotTouch_grp. Select both torso_jnt_grp and head_jnt_grp, hit Ctrl + G, and call this group rig_jnt_grp. Select torso_ctrl_grp, eyes_ctrl_grp, and world_follow_loc_grp, and hit Ctrl + G. Call this group rig_ctrl_grp. Then take torso_rig_doNotTouch_grp, hit Ctrl + G, and call this group rig_doNotTouch_grp. Phew.

If you collapse everything down now, you should have three top level group nodes for the rig: rig_jnt_grp, rig_ctrl_grp, and rig_doNotTouch_grp. At this stage, our rig should be a bit more organised but do make sure to test it out.

Now lock and hide some of the attributes on the controls. Select the eye controls and lock and hide the Scale attributes. Select both neck controls, the head control, ear controls and eyelid controls, and lock and hide the Translate and the Scale attributes. For the jaw control, just lock and hide the Scale attributes. The last thing to do is to color-code the controls, which I’ll leave in your artistic hands.

Next, we’ll rig the shoulders and the arms.

Leave a Comment