Character Setup for Real-Time in Maya 3.0
We have already covered creating a skeleton optimized for real-time not only in its number of joints but also in the way the axes of each joint is oriented. We will now address creating controls for the animator to use when positioning the character. This is in essence digital puppeteering.
The reverse foot:
For gaming and simulation most characters (especially bipeds) have multiple animation cycles involving their legs � walking , running, creeping, �etc. This kind of movement requires a lot of animation devoted to moving the feet. To make this process simple for the animator we will create a reverse foot setup. Keep in mind, there are a myriad of ways to rig a character�s feet for animation.
The premise for the reverse foot lies in that there are essentially four pivot points of the foot � the ankle, heel, ball and toe. We need to have a setup where the animator can have access to al the pivot points. We will construct this setup so the animator will only select one controller and have full access to the pivots.
We want the legs to be controlled by IK primarily. Create a Rotate Plane IK handle from the L_hip to the L_ankle. Name it L_ankleIK. We use the RP Solver to have the ability to control the overall orientation of the leg joints through two means � the twist attribute and the placement of the Pole Vector. Create a Single Chain IK handle from the L_ankle to the L_ball. Name this the L_ballIK.
Now construct the reverse foot. Draw the following joints in order � LCntrlHeel > LCntrlToe > LCntrlBall > LCntrlAnkle.
Put these joints on a layer called Control and change its color. Now we need to have the reverse foot joints drive the joints of the deformation skeleton. To do this first have the IK handles as children to the reverse foot joints. So, select the LCntrlAnkle then the L_ankleIK and go Constrain > Point. Select the LCntrlBall then the L_ballIK and do Constrain > Point.
Now create a poly torus (Radius 1 � Section Radius .5 � Subd Axis 6 � Subd Height � 6). Name it CntrlLankle and make it the parent of the heel joint. Place its pivot point on the ankle joint of the deformation skeleton. This torus represents the ankle�s pivot point. Rotate the torus on the X and notice the leg react accordingly.
Working with Pole Vectors:
Take a polygonal cone and have the point facing away from the character. Move it via vert snap to the knee and move it on the Z in front of the knee. Freeze transformations and name it LPoleVector. With the cone selected, select the L_ankleIK and go Constrain > Pole Vector.
Add a control attribute for the pole vector. On the CntrlLankle add two attributes, the LPVtransX and LPVtransY. Using the Connection Editor, have the LPVtransX value pipe into the translate X of the LPoleVector. Do the same for the LPVtransY.
To have the pole vector keep up with the CntrlLankle, group the cone to itself and move the group�s pivot point to the ankle. Select the CntrlLankle then the LPoleVector and Constrain > Point.
Now, when rotating the CntrlLankle in the Y axis we notice only the ankle joint and below respond. We want the whole leg to respond to this rotation so we will access the twist attribute on the RP IK handle. To do this write the following expression:
L_ankleIK.twist = -CntrlLankle.rotateY;
Now notice the effect when rotating the CntrlLankle in the Y axis.
Creating the heart of the reverse foot � the set driven key:
With the CntrlLankle selected go to Modify > Add Attribute and name the attribute LFootRoll with the min at 0, max at 10 and the default at 5.
Now we will use the LfootRoll as a driver in a set driven key to drive the rotation of the reverse joints to mimic forward movement on the ball and toe plus backward movement on the heel.
Select the CntrlLankle. Go to Animate > Set Driven Key > Set > Options. Select the LFootRoll attribute as the Driver. Select the LCntrlHeel.rotateX as the Driven. Make sure the LFootRoll attribute�s value is set to 5. Set a keyframe. In addition, with the value still at 5, set keyframes on the rotation in X for the other reverse foot joints.
Now set the value of the LFootRoll to 0. Rotate the LCntrlHeel to �38 in the X. Save a key for the heel and all the driven joints.
Set the LFootRoll to 7. Set the rotation in X of the ball and toe joints to 25 and �12 respectively. Set keyframes on all driven joints.