In the previous movie, we split our geometry into separate sections
and created a spline for our torso.
In this movie, we'll create some controls for our shoulders and hip,
and add the ability to twist the torso.
Open the file "3-0- Character_rigging_part3_start.mb"
or continue using your own file from the previous lesson.
We now have a pair of bind joints which we can use to affect our IK Spline's control curve.
While picking these joints is certainly much easier
than trying to pick the curve's control vertices, they still aren't exactly optimal.
We can make it easier to pick these by creating control curves.
Control curves are objects, traditionally NURBS curves,
which allow you to interact with your rig without having to select individual joints
like the bind joints we have here.
Designing control curves is a very subjective process.
Some people prefer them as simple primitive shapes,
while others like to make them into recognizable symbols,
such as elaborate arrows or other signifiers.
Here, we're going to make our shoulder and hip control curves from some basic primitives.
Go to the Create > Polygon Primitives menu and turn "Interactive Creation" off.
Create a polygon cube.
Using the 'V' key and the Move Tool, middle-click the hip_bind_JNT to center the cube on it.
Scale it so it's visible beyond the torso geometry.
Now you can go into component mode and modify the cube so it roughly fits the shape of the hips.
We're going to use this polygon cube as a base for creating our NURBS control.
Why didn't we just create a NURBS cube?
Observe that when we create a NURBS cube,
Maya actually creates a series of individual curves grouped together.
Unfortunately, this means that clicking on the shape selects only that specific curve.
We want a control comprised of only one curve,
which we'll create by tracing the polygon cube with an EP curve.
Open the Create > EP Curve Tool's Settings window.
Set the "Curve Degree" to "1 Linear" to make it angular.
Now, holding 'V' for point snapping, click on one of the cube's corners.
Still holding 'V', click an adjacent corner to draw an edge from one to the other.
Continue clicking corners to rebuild a NURBS version of your control.
Make sure to keep the edges the same as those of the polygon cube.
It's okay if you have to traverse the same edge multiple times
When you're finished, press 'Enter' to complete the curve.
Rename the curve "hip_CTRL" and then delete the polygon version.
If you select your new control with the Move Tool, notice that its pivot is way down at the origin.
Press the 'Insert' key to go into pivot mode, and use point snapping with the middle-mouse button
to move it to the hip joint.
Press the 'Insert' key to exit pivot mode.
Now your hip control is finished!
To create the shoulder control, simply duplicate the hip control and reflect it in the Y-Axis.
Using the same point-snapping technique,
move it up to the shoulder_bind_JNT and rename it "shoulder_CTRL".
Since the shoulders aren't quite as big as the hips,
you can scale it down a bit and then freeze its attributes.
Now before your controls are ready, we need to address the rotation orders.
Rotation Orders are a very important, but often forgotten aspect of rigging.
Correct rotation orders will ensure that your rig is able to reach every desired pose,
and that the axes will always make sense whenever you use your controls.
To see the effect of rotation orders, double-click the Rotate Tool and set it to "Gimbal" mode.
Gimbal mode is a rotational method in which Maya rotates corresponding axes
around the current axis.
This allows the animator to always work in clean axis orientations
as well as dodging flipping problems at 90 degrees that the other rotation modes can cause.
Rotate the controls in Y and note how the perpendicular X axis moves along with it.
However, notice how Z doesn't move at all.
This is because the current rotation order is XYZ, that is,
Maya evaluates the Z rotation first, then the Y, then X.
In other words, an axis in a rotation order always affects the axes in front of it.
That's why the Z axis isn't rotating with Y;
it's because Maya evaluates it before Y rather than after.
Now imagine if you had to rotate your character's hips around, then from side-to-side,
perhaps to help facilitate crossing her legs.
This would be very difficult in our current setup.
The closest we could get is this very awkward unnatural looking twist.
So in order to make this work the way we want,
we'll have to change the rotation order to one where Maya evaluates Z after Y.
And since we still want the X axis to follow the Y axis as well
(to facilitate bending forward and backwards), our two options are ZXY, or XZY.
In this case, we'll choose ZXY.
Why did we choose ZXY? Well, it comes down to the character's movement design,
and most importantly, what the animators prefer. Here we'll allow the hip to bend,
then move side to side, rather than the opposite.
Apply the same rotation order to the shoulder_CTRL,
as well as to hip_bind_JNT and shoulder_bind_JNT.
Now that our rotation orders are set properly,
we'll create a parent constraint from the controls to their respective joints.
Select the shoulder_CTRL and Ctrl + select the shoulder_bind_JNT.
Go to Constrain > Parent.
Apply another Parent constraint between the hip_CTRL and hip_bind_JNT.
Now you can select either of the curves to move the torso!
Aren't these much easier to select than the bind joints?
You'll notice right now that although the forward, backwards, and side bend work as we'd expect,
the torso is unable to twist.
This is because we haven't activated it yet in the IK spline's options.
Select the spine IK handle and open the Attribute Editor.
In the IK Solver Attributes section, under the "Advanced Twist Controls",
turn on the "Enable Twist Controls" option.
Well, our spine is twisted alright, but not exactly the way we expected.
In order for the spline to understand how to twist properly, we need to give it some direction,
in the form of an up-vector, to determine what direction to twist in.
First, set World Up Type to "Object Rotation Up (Start/End)"
This tells Maya to define the "along" vector, perpendicular to the up vector,
using two specific objects.
Since our along vector is the spine itself,
we have a couple of choices we could use as our start and end points.
We could either use the hip and shoulder control curves as points of reference,
or the hip and bind joints themselves.
In this case, we'll use the hip and bind joints,
since less dependency on the control curves will make it easier to swap them out later
if we ever want to.
Now Maya just needs to know which way is up.
Remember when we set the local rotation axes on our spine in the previous movie?
All our local Y axes pointed forward.
Since we want the spline to face forward to match the geometry, that means our up axis,
which is the opposite, is "Negative Y".
Likewise, we created the bind joints as copies of our spine joints.
Remember that the local rotation axes of these joints had Y and Z facing forward respectively,
which means we'll set them --Y and --Z here respectively.
Now use the Rotate Tool to try twisting the spine with either of your controls.
It twists just like we'd expect!
This just about does it for our IK spine.
However, although we can bend and twist the torso as a whole,
we're really lacking some precision controls to manipulate the individual sections of the torso.
In the next movie, we'll build an FK joint chain on top of this IK chain
to give us this degree of control.