Its time to rig up our character. In this section we will cover how to set up a skeleton for our character and how to skin the mesh to the skeleton. Before we start placing joints it will be important to know that the viewport we use when creating joints will have an influence on how they behave (especially if we decide to use IK handles on the joints). For example if we wanted to create the leg joints we should chose the side view as that will create a joint that is consistent with the way the leg moves. It can get more complicated when it comes to creating the arm joints, you may be tempted to create them in the front view however the way our character is set up the top view will be a better option to ensure the IK is working correctly.
We will set up the legs first. Move to the side view and select the create joints tool. We want to set up the flow of the joint in the order that the joints will be rotated, so we would create the hip joint first as that joint will rotate the knee joint etc.. Set the first joint at the hip and click on the position for the knee joint, the ankle joint and create one for the centre of the foot and finally on at the end of the foot press enter to finish the creating of the joints. The joints have been created on the origin plane, so if we move to the front view we can see that we will need to move the joint into place. Select the hip joint and using the move tool place it at the top of the leg. We still need to rotate the hip joint into place this is where we need to be careful, we can't just select the joint and rotate it as the joints need a transformation of zero in the rotate channels to work correctly. If we select the hip joint and open the attribute editor, there is a tab called joint and near the bottom is a option called joint orient this is how we will rotate the joint. (we can scrub these number by holding down the 'cmd' button and left mouse button drawing left or right in the box) For the leg we will want to rotate the leg in the Z axis until it has lined up with the mesh, open the channel box and you will notice that the rotate channels are still at zero.
We will next create the rest of the hip bone and also the spine. The temptation might be to make these in the front view however will will make these in the side view as the spine will move in a more front and back motion rather than side to side. If we click on the an existing joint when creating a new joint it will use that joint as a starting joint, so we are going to need to create or first joint for the spine above the hip joint and we will move it into position later. Create joints at the waist, cheat and base of the neck. While still in the side view we will create the hip joints again we will make these off to the side and move into place later, create one joint next to the hip and another down where the body ends. (I am going to colour the joints red so you can see them better) Move to the front view and using the "d" key to move the pivot point of the first spine joint and also using the 'v' key for snapping move it to align with the hip joint. By moving the pivot point of the joint means we don't move the whole joint chain. Next move the hip joint into place as well. We now need to join all the joints together by parenting them. Select the hip joint for the leg and then select the hip joint in the centre and press the 'p' key to parent them. Now select the the hip joint and select the first spine joint and parent them. We can do a quick test to make sure the skeleton is moving correctly if we select the hip joint it should move the legs and the spine joint should move the whole skeleton.
Before we move on it will be important to name the joints. (we will use BN for bones and BE for bone at the end of a chain, we also shorten bottom to btm and middle to mdl and so on..) Open the outliner and select the first joint in the hierarchy and we will call it root_BN, the next will be waste_BN, chest_BN, neckBase_BN. The next part of the hierarchy will be the hips and leg, start with hip_mdl_BN, hip_btm_BE, for the leg it will be important to specify it is the left leg so next joint we will name leg_L_hip_BN, leg_L_knee_BN, leg_L_ankle_BN, leg_L_foot_BN and leg_L_foot_BE.
With the joints all named we can mirror our leg joints over to the right side. Select the leg_L_hip_BN and go to the skeleton menu and open the options for mirror joints. First chose the plane we want to mirror across in this case it will be YZ, look at the viewport to figure out why? The next is mirror function and this we will set to behaviour and finally in the section replacement names for duplicate joints type in _L_ in the search for section and _R_ in the replace with section and hit the mirror button. This will mirror the joints across and because we named them properly the right side will be renamed for us.
Save the scene and we will check the rig is working so far, if we select the hip_mdl_BN and rotate it the legs should move, select the root_BN and the whole skeleton should move.
Lets create IK handles for the legs, with nothing selected go to the skeleton menu and open the options for the create IK handle tool. In the options for the create IK handle reset it to original settings and the only thing we will change is the current solver from single-chain solver to rotate-plane solver. Now click on the leg_L_hip_BN and also click on the leg_L_ankle_BN, if you look in the outliner you will see an ikHandle1 has been created. Select the ikHandle1 and use your move tool to check it is working correctly, (if we had created the legs in the front view the legs would not be behaving correctly). Do the same for the right leg.