Let's do the rig of the Rat Cowboy. We are not going to show the modeling process here as you already know how to model proper characters from the Alien project.
Placing the deforming bones
The first thing that we will need to do for our rig is place the bones that will directly deform our mesh. These are the main bones. In Blender, a rig is contained in an Armature object, so let's go!
Let's begin with the process:
- We will first be sure that our character is placed at the center of the scene with his feet on the x axis.
- Now we can add a new bone that will be placed in an Armature object (press Shift + A and select Armature | Bone).
- Next, we will enter the Edit Mode of our new Armature object, and we will place the bone in the hip location and rename it as
hips
. You can rename a bone in the right panel of the 3D view in the Item subpanel. Be careful to rename just the bone and not the Armature object. - We can now start to extrude the bones of the spine. To do this, we will select the tip of the hips and extrude it (E) twice as far as the base of the neck. It's very important that you don't move these bones on the X axis. We will rename the bones as Spine01 and Spine02 respectively. From the side view, be sure that these bones are slightly bent.
- We will now extrude the left clavicle according to the Rat Cowboy's structure and rename it as Clavicle.L. The .L part is really important here because Blender will understand that this is on the left-hand side and will manage the right-hand side automatically later when mirroring the rig.
- Now, from the tip of the clavicle, we will extrude the bones of the arm. Rename the two bones as TopArm.L and Forearm.L.
- Now it's time to extrude the bone of the hand, starting from the tip of the forearm. Name this as Hand.L.
Note
Please note that if you want to follow the process step by step, you can download the starting file for this chapter on the Packt Publishing website.
- In order to create the finger bones, we will start from a new chain and parent it back to the hand. This will allow us to have bones that are visually disconnected from their parents. To do this, we will place the 3D cursor near the base of the first finger and press Shift + A. Since you can only add bones when you are in the Edit Mode of the Armature, this will automatically create a new bone. We will orient it correctly and move its tip to the first phalange. We will extrude its tip to form the next two bones. It's important to place the bones right in the middle of the finger and on the phalanges so that the finger bends properly. Analyze the topology of the mesh to do this precisely. If you want, you can activate the Snap option (the magnet in the 3D view header) and change its mode from Increment to Volume to automatically place the bones according to the volume of the finger.
- Then we will create the chains for the other fingers and the thumb and rename them as Finger[Which finger]Top.L, Finger[Which finger]Mid.L, and Finger[Which finger]Tip.L.
- We will now need to re-parent them to the hand so, when the hand moves, the fingers follow. To do this, we will select the top bone of each finger (the root of each finger chain) and then select the hand bone (so that it is the active selection) while holding Shift, pressing Ctrl + P, and selecting Keep Offset. Keep Offset means that the bones are going to be parented but they will keeping their original positions (that is, they are not connected to their parent).
- We will now change our cursor location to the left thigh of our character and press Shift + A. We can then place the tip of this bone to the knee location. Also, check the side view and put this tip a little bit forward. We can then extrude a new bone from the knee to the ankle. Rename these bones as Thigh.L and Bottom Leg.L.
- We can then extrude the foot and the toes. Name them as Foot.L and Toes.L.
- The leg chain needs to be parented to the hips. This can be done with Ctrl + P and selecting Keep Offset. Remember to first select the child and then the parent while doing your selection for parenting.
- Now we can add the bones of the tail. We will create a chain of bones starting from the back of the Rat Cowboy to the tip of the tail where the tips and roots of each bone are placed according to the topology of the mesh. Remember to rename the bones properly from Tail01 to Tail07.
- Then we will parent Tail01 to Hips by pressing Ctrl + P and selecting Keep Offset so that the whole tail is attached to the rest of the body.
- The last bones that we will need to extrude are the neck and the head. The neck starts from the tip of the Spine01 bone and goes straight up along the Z axis. Then we will extrude the head bone from the neck tip. We will rename them as Neck and Head.
Now we will have to verify on which axis the bone will rotate. You can display the axes of the bones in the Armature tab of the Properties editor under the Display subpanel. We will need to adjust the roll of each bone (Ctrl + R in the Edit Mode) to align them along the x axis. You can test the rotations by going to the Pose Mode (Ctrl + Tab) and rotating the bones around their x local axis by pressing R and then pressing X twice. Beware, rolls are very important!
Note
The Display options
You can find different display options for your bones in the Display subpanel in the Object Data tab of the Properties editor. A nice way to display the bones is to activate the X-Ray display mode, which allows us to see the bones through the mesh even in Solid shading mode. We can also display the axes of orientation and the name of each bone and change its shape.
For instance, we can use the B-Bone mode that changes the bones to boxes that we can rescale with Ctrl + Alt + S. This is a nice way to display bones that are on top of each other. You can also use the Maximum Draw Type drop-down menu in order to change the shading of your selected object in the Display subpanel in the Object tab of the Properties editor.
The following image will show the placement of the deforming bones of the hand:
Now that we have all the deforming bones that are needed, we are going to add some bones that will help us to control the leg and the foot in a better way.
- We will now add a bone that will be a controller for the Inverse Kinematic (IK) constraint of the leg. We add this to the ankle and align it with the floor. It's important that this bone is disconnected for now. We rename it as LegIK.L.
- Under the Bone tab of the Properties editor, we will uncheck the Deform checkbox so that our bone does not deform our geometry later.
Note
What is an IK constraint?
Usually, when you manipulate bones in the Pose Mode, you rotate each one in order to pose your object, and this method is called FK (Forward Kinematic). The role of an IK constraint is to let Blender calculate the angle between a minimum of two bones according to a target. To better understand what this does, imagine that your foot is a 3D object and you can move it where you want in space. As you can see, your thigh and lower leg will automatically bend with an appropriate angle and direction. That's the whole point of IK!
- Now we are going to tell Blender that this new bone is the target that will control the IK constraint. To do this, we will first select it in the pose mode (Ctrl + Tab) and then select the lower leg bone to make it the active bone. Now we can use the Shift + I shortcut to create a new IK constraint. As you can see, the lower leg bone turns yellow.
- Now we will change the settings of the constraint. The bone Constraints panel is located in the properties editor (a bone with a chain icon) in the Pose Mode. If we select the lower leg bone, we can see our IK constraint located here. As we've used the Shift + I shortcut, all the fields are already filled. The setting that we will change is Chain Length. We set this to two. This will tell Blender to calculate our IK constraint from the bone where the constraint is on the tip to the next bone in the leg chain.
- We can now go back to the Edit Mode (Tab) and add a new floating bone in front of the knee location. This bone will be the target of the knee. Rename it as PollTargetKnee.L.
- Back in the Pose Mode (Ctrl + Tab), we will set this new bone as the Pole Target bone for the IK constraint. We will first select the Armature object and then the bone. After this, we will adjust Pole Angle to reorient the IK constraint so that the leg points to the knee target. In our case, it's set to 90°.
- The next thing to do is to uncheck the stretch option so that the leg can't be longer than it already is.
- Now that we've rigged the leg, it's time to rig the foot. We are going to make an easy foot rig here. But note that a foot rig can be much more complex with a foot roll. In our case, we will first remove the Foot.L parentation. To do this, we go into the Edit Mode, select the parent, press Alt + P, and select Clear parent.
- Now we want to switch the direction of the bone so that its root is located at the toes. To do that, we will select the bone in the Edit Mode, press W, and select Flip Direction. Remember that a bone rotates around its root, so this will give us the ability to lift the foot up on the character's toes.
- Now we can connect the IK target to the foot bone. To do this, we will simply select the child (LegIK.L), select the parent (Foot.L), press Ctrl + P, and select Connected. So now, when we rotate the foot in the Pose Mode, the IK target is going to lift up and the IK constraint will do its job.
- The last thing that we will need to do is create a master bone that will move all our foot bones. In the Edit Mode, we will add a bone that starts from the heel to the toes and rename it as FootMaster.L. We will then parent the toes to this with the Keep Offset option. Then we will parent the foot to the toes with the Keep Offset option. As you can see, if you move the master bone in the Pose Mode, all the bones will follow this. We are done with the foot and the leg rig!
The next important part to rig is the arm. In many rigs, you will have a method to switch between FK and IK for the arms. In our case, we are only going to use IK because it will be quite long and boring to teach how to create a proper IK/FK switch with snaps. When animating the arm with IK, you will have to animate arcs by hand, but this will allow you much more control if you don't have an FK/IK switch.
- We will create a new floating bone that will become our IK target for the arm by duplicating the bone of the hand and clearing its parent. Remember that the target of an IK switch needs to be freely movable! We will rename this bone as HandIK.L.
- Then we will set up our IK constraint by first selecting the target, then the forearm, and then pressing Shift + I. Now, we can change the chain length to two as we did for the leg.
- The next thing to do is add a poll target for the orientation of the elbow. To do this, we will create a floating bone behind the elbow of our left arm, we rename this as ElbowPollTarget.L, and we set this as the poll target of the IK constraint. Also, we will change the Poll Angle to match the correct orientation of the elbow.
- Both the target and the IK target need to have the Deform option turned off.
- The animator will only want to manage one bone for the hand. The bone that will deform the hand is not the target as it needs to be connected to the arm, so we will need to find a way to tell the hand-deforming bone to follow the IK target rotation. If this happens, the animator will only control the target for both arm placement and the hand rotation. To do this, the IK target is going to transfer its rotation to the deform bone. So, we will first select the HandIK.L bone, then the Hand.L bone, and then press Ctrl + Shift + C to open the constraint floating menu and select CopyRotation.
- We are now going to rig the fingers again with a Copy Rotation constraint. The motion that we want to achieve is that, when the base of the finger is rotated around the X local axis, the finger curls. To do this, we will indicate to the mid bone of the finger to copy the rotation of its parent (the top bone) and the tips to copy the rotation of its parent too (the mid bone). We will show the process for the index finger and let you do the rest for the others.
- We will select the Finger1Top.L bone, then the Finger1Mid.L bone, press Ctrl + Shift + C, and select CopyRotation. After this, we will select the Finger1Mid.L bone, then the Finger1Tip.L bone, and create a copy rotation constraint. If we rotate Finger1Top.L on the X local axis, we can see that the finger bends.
- In order to finish the hand, we will disable the Y and Z local rotations of the mid and tip bones of each finger. To disable a rotation on a particular axis, we will open the right panel of the 3D view (N) and change the rotation type from Quaternion to XYZ Euler. Then we can use the lock icon on a particular axis.
Note
What is a Copy Rotation constraint?
As its name implies, the copy rotation constraint will tell an entity to copy the rotation of another entity. The settings of the constraint allow you to choose in which space the rotation will be. The often used spaces are World or Local.
The World space has its axes aligned with the world (you can see them in the left corner of the 3D view).
The Local space has to do with the orientation of an object. For instance, if an airplane has a certain direction, but when it rotates around its fuselage, this takes into account its orientation.
Now it's time to do the hips motion so that it is easier to control for animation. You have done a lot of work until here. Have yourself a cookie, you deserve it!
- To create our hips motion, we will duplicate the hip bone. Also, remember to uncheck the Deform option. We will rename it as HipsReverse.
- Now, we are going to flip the direction of this bone so that the hip deforming bone rotates around its tips (because the root of the hip's reverse bones will be here).
- Now you can test in the Pose Mode that, when you rotate the HipsReverse bone, the hip's deform bone rotates with it.
A rat without a tail is pretty strange, so we will take some time to rig his tail. The technique that we will show here is quite simple but very effective:
- In order to rig the tail of the Rat Cowboy, we will need to add a new bone that controls this in the Edit Mode. To do this, we will extrude the last Tail07 bone so that it is placed at the right location, and we will un-parent it with Alt + P and select Clear Parent. Rename this as TailIK.
- We will now need to create an IK constraint. We will first select the target, then the Tail07 bone (the last in the chain), and press Shift + I.
- Now in the IK constraint settings, we will change the chain length to 7 (to let the IK constraint solve the angles from the tip to the last bone of the tail chain).
- We will check the Rotation option, too. Now, as you can see, the tail is fully rigged and can be placed and rotated through the tail target:
In order to control the head, we will only manipulate the bone of the head, so we will directly begin the rigging of the eyes. We will ensure that the eyes are two separated objects and they have their pivot points at the center to make for good rotation. In our case, we have two half spheres, so we don't waste performance with hidden geometry:
- We will select one of the eyes, and in the Edit Mode (Tab), we will select the outer edge loop. We will press Shift + S to open the Snap menu, then we will select the Cursor to Selected option, and then, in the Object Mode (Tab), we will press Ctrl + Alt + Shift + C and select Origin to 3D cursor. The pivot point must be at the right location. Do not hesitate to test this with a free rotation (R x 2) in the Object Mode. We must repeat the same process for the other eye.
- In the Object Mode, we will select the eyes and the teeth, and then we will parent them to the head bone, but not with the usual method of parenting the bones that we saw earlier. To do this, we will first select the eyes and the teeth, and then the head bone (the armature must be in the Pose Mode). We will press Ctrl + P, and we will select the Bone option.
- We now want to create a controller bone for each eye. We will select the armature, and in the Edit Mode (Tab), with the 3D Cursor in the middle of the eye, we will create a bone (Shift + A). In the Orthographic (5) left (3) view, we will move the controller bone in the front of the character. We need a small distance between the head and the bone controller. We will repeat the same process for the other eye, and we will rename them as EyeTarget.L and EyeTarget.R.
- We will set the eyes to look at their controllers with a Damped Track constraint (Properties | Constraint). We will start with the left eye. We must select the Armature as Target and EyeTarget.L as the bone. Now, we must adjust the rotation by tweaking the Z axis.
Note
The Damped Track constraint
This allows us to constrain a 3D object to always point towards a target on an axis. The 3D object doesn't move, it just rotates on its pivot point depending on the location of the object.
Both the eyes must now follow the EyeTargetMaster movements. Do a test by pressing G.
In order to save time, as in the modeling or the sculpting process, it is often very useful to work with symmetry. There are three ways to do this in an armature.
The first method consists of checking the X-Axis Mirror option in the Armature Options tab in the left panel of the 3D Viewport (T) that allows us to directly create the bones in a symmetry. We must extrude the bones by pressing E while also pressing Shift. This solution doesn't copy the constraints.
The second method is efficient even if it requires some manipulations to get a perfect mirror. Until then, we will place the bones of the arms and legs on the left-hand side with all the constrains that we need and the appropriate names:
- We will select the armature in the Edit Mode, and we will align the 3D cursor at the center (Shift + S and select Cursor to Center).
- In the Header, we will put the Pivot Point options on 3D Cursor.
- Then, we will select every bone of the arm and the leg on the left-hand side.
- We will duplicate them (Shift + D), and we will mirror them by pressing S + X + 1 on the numeric keyboard. Then we will press Enter.
- In the Edit Mode, we will select the bones of the arm and the leg on the right-hand side and flip the names (Armature | Flip Names). This renames all the bones of the left-hand side with the .R termination.
The third method is very interesting. It has been available since Blender 2.75.
Once we have placed and named all the bones with the .L termination and have all the constraints, we will select them in the Edit Mode, and then we will press W and select Symmetrize. This will automatically rename the bones of the right-hand side and the constraints will be copied.
Let's now focus on the gun for a rig.
In order to easily animate the gun, we will need it to be able to follow the hand of our character when the Rat Cowboy uses it, and the gun must be able to follow the holster all the time. To do this, we will use a bone and a Child Of constraint.
Note
The Child Of constraint
This constraint allows us to make an object a parent of another object by weighting their influences. This allows the animator to animate its influence in order to change its parent. This is much better than a classical parentation. This is very useful to make an object follow different objects one after another like a character driving with one hand on the steering wheel and the other hand on the speed box. You can also combine multiple children of the constraints.
- We will begin by taking care to apply the rotation of the gun (press Ctrl + A and select Scale and Rotate).
- We will select our Armature, and in the Edit Mode, we will place the 3D Cursor at the location of the hammer; then we will create a bone (Shift + A) that follows the length of the gun. We will rename this new bone as Gun.
- We will make the gun the parent of the bone by first selecting the gun in the Object Mode, then the Gun bone in the Pose Mode, and then we will press Ctrl + P and select Bone.
- We will then modify the appearance of the bone in B-Bone (Properties | Object Data | Display | B-Bone). We will scale it to make it easier to rig (Ctrl + Alt + S).
- We will check the X-Ray option.
- We will move the gun in the holster by moving and rotating the Gun bone. You can also directly rotate the gun a little bit in order to get the best position.
- We will add two Child Of constraints to the Gun bone. We will uncheck the scale option of both the constraints.
- We will decrease the influence to 0 on both the Child Of constraints.
- With the first Child Of constraint, we will put our Armature as Target with the Hand.L bone in the bone option. We will press the Set Inverse button.
- For the second Child Of constraint, we will put the Holster object as Target, and we will press the Set Inverse button again.
Now, when we place the left hand with HandIK.L near the gun and put the influence of the first Child Of constraint at 1.000 (the influence of the second Child Of constraint must still be at 0), the gun joins the HandIK.L bone and follows it. In order to reposition the gun in the holster, it must be very near to the holster. The influence of the first Child Of constraint must be at 0, and the influence of the second one must be at 1.0 (reversed influences).
Now we are going to rig the holster. As you can see, it is a separate object. We will need to pin it to the belt. In this section, we won't use bones, but they are still a part of the rigging process.
- First, what we are going to do here is create an empty object that will be the parent of the holster. To create an empty object, press Shift + A and select Empty | Plain Axis.
- Now we will select the empty object, and while holding Shift, we will select the belt. We can now enter the Edit Mode of the belt and choose a vertex near the pin of the holster. We can press Ctrl + P and choose Make Vertex Parent. Now when we move the vertex, it moves the empty object!
- The last thing that we need to do is make the holster the parent of the empty object, and the trick is done! Of course, we could have made the holster object a parent of the vertex directly, but it's always nice to have an empty object in between in this kind of situation.
The root bone is also called the master bone; it is the bone that will control the entire skeleton and is the top parent. With this, it is very convenient to place our character and animate it anywhere.
- We will select the Armature, switch in the Edit Mode (Tab), place the Pivot Point at the center of the world (press Shift + S and select Cursor to Center), and then we will add a bone (Shift + A).
- We will make this bone bigger (Ctrl + Alt + S in the B-Bone mode) because it represents the central control element of the Armature. We will flatten it by selecting and moving the tip of the bone. We will rename it as Root.
- In the Edit Mode, we will select the IK bone controllers of the hands, feet, tail, EyeTargetMaster that controls the Eyes, Hips, and Pole Targets at the location of the knees and the elbows; finally, we will select the master bone (so that it is the active selection).
- We will make them parents (press Ctrl + P and select Keep Offset).
- Remember to uncheck the Deform option (Properties | Bone | Deform).
- You can see all the bones follow when you move the Root Bone.