• home
  • forum
  • my
  • kt
  • download
  • Part 3: The Spine

    Author: 2007-06-23 18:42:11 From:

    We have already covered creating controls for the legs of our character. We now want to tackle the spine area of the character. This is a source of many headaches for setup artists. The reasoning is that the spine is not an independent joint chain like the legs are. Instead, the spine reacts to the hip movement as well as the chest/arm movement often in an opposite manner.

    Maya¡¯s spline IK handle solution to the spine is one solution to work with. However, I have found it better served when working with an independent joint chain such as a tail or long neck. It¡¯s functionality becomes a little stifled when working with opposing forces such as the hips and chest areas. Plus, the fluid motion of the spine is not restricted to one axis but incorporates all three. This can be difficult to achieve sometimes with the spline handle. Therefore, the approach we will take is one of a combination of constraints along with set driven keys. This reduces controller clutter since we can place many of the driver attributes on one controller.

    Create some control objects:

    First, create a series of controllers starting with a hip controller. Use any object/locator you feel is intuitive (you can duplicate the existing CntrlBody locator). Name the controller CntrlHip and place it behind the root joint. Change its pivot point to the root joint. Group it to itself calling the new group CntrlHipG. This is known as a "freedom node" which we can access later to apply driven keys or expressions to. Take the CntrlHip and duplicate it moving the new controller towards the chest area. Name it CntrlChest. Once again, group the CntrlChest to itself. Have both the pivot points at the center of the object. Make sure the CntrlChestG is a child of the CntrlHip (not the CntrlHipG). Create another controller for the head naming it CntrlHead. Finally, we already have the CntrlBody from the last lesson when linking the ankle controls to the ground plane using a geometry constraint.





    These controllers along with the freedom nodes provide a simple construct from which we will add functionality to the spine.

    Begin with Orient Constraints:

    We will now begin to connect the spine controllers with the spine joints using some constraints. We are going to first focus on the orientation changes of the spine joints then deal with the translation later. Select the CntrlHip then the root joint. Go to Constrain > Orient. This allows the root be easily manipulated in its rotation by the CntrlHip controller.

    Select the CntrlChest then the cervical joint and go Constrain > Orient. Do the same for the CntrlHead and head joint.

    Now rotate the CntrlHip and notice the skeleton respond. Do the same with the CntrlChest. This is the initial layer of control.

    Using Set Driven Key:

    Having the CntrlHip selected create three new attributes (each as float with a min of ¨C10 and a max of 10 with 0 as the default):

    1. SpineRollX
    2. SpineRollY
    3. SpineRollZ

    We will now use the Set Driven Key to connect the spine joint rotations with the corresponding attribute. Go to Animate > Set Driven Key > Set > Options. Have the SpineRollX as the Driver and the lumbar joint¡¯s rotation X as the Driven.



    Keyframe the rotation in X for the lumbar and thoracic joints with the SpineRollX at 0. With the SpineRollX at 10 have the lumbar joint rotate to ¨C80 and the thoracic at 50. Set keyframes for both joints. With the SpineRollX at -10 have the lumbar joint¡¯s rotation in X at 45 and the thoracic¡¯s at -50.



    The positions of the spine seem extreme in the pictures above but you should always set your driven keys a little extended from what you think the character can actually attain as a pose. This way the animator will have the ability to hit any pose required in the storyboards or by the simulation.

    Repeat this same process for the SpineRollZ and SpineRollY attributes setting keys for both the lumbar and thoracic joints as the Driven joints.



    Working on the upper spine:

    We will now do the same process as above with CntrlChest controller. Once again, create three custom attributes (float with min at ¨C10, max at 10 and default at 0). Name them ChestRollX, ChestRollY and ChestRollZ.

    As before, go to Animate > Set Driven Key > Set > Options and have the CntrlChest as the Driver. The joints will we be driving are the thoracic and cervical joints. With the ChestRollX at 10 have the thoracic joint¡¯s rotation in X keyframed at 40 and when the ChestRollX is at ¨C10 have the joint¡¯s rotation keyframed at ¨C40. Continue with the ChestRollY and Z attributes driving the corresponding rotation of the thoracic joint. Remember when posing the thoracic joint in the Y and Z have the rotation a little beyond what you feel the character can actually accomplish.

    Add some rotation on the cervical:

    To add some additional rotation (to be used primarily later in balancing the skeleton out when the hips translate) we will use a set driven key on the cervical joint by accessing the CntrlChest. Have the CntrlChest as the Driver and Driven of the set driven key. For the Driver select the ChestRollZ and the driver as the rotation in Z. When the ChestRollZ is at 10 have the rotation in Z of the ChestCntrl at 30. Set a keyframe. When the ChestRollZ is ¨C10 set the rotation in Z of the ChestCntrl to ¨C30. Notice that even after adding the set driven key to the ChestCntrl you can still rotate it in the Z and have the affect transferred to the clavicle joint via the orient constraint.

    By having the rotation of the actual cervical joint restricted to the CntrlChest by the orient constraint we can manipulate the shoulders independently of the spine. But by adding the additional control on the thoracic joint we have increase the functionality of the skeleton.
    .
    Working with translating the hips:

    We will now take advantage of the concept of "freedom nodes" within Maya. The goal is to have an automatic compensation occur in the chest area whenever the hips translate. This function needs to be a toggle for the animator so the hips can also move independent of the rest of the upper body.

    First, connect the root joint¡¯s translation with the CntrlHip controller. Select the CntrlHip then the root joint and Constrain > Point. This locks down the root¡¯s translation.

    Create a locator and position it with the CntrlHip. Have its pivot point at the root joint. Name it freedomHip, freeze transformations and hide it.



    How we will use the freedomHip:

    We will use the freedomHip to drive the counter balance action of the chest when the hips translate. To do this we need to have the freedomHip have the same driven keys as the CntrlHip. We can then modify the freedomHip¡¯s driven keys to affect the upper spine through an expression. In addition, we will have this function as a toggle the animator can turn on or off through a custom attribute.

    First, add three new attributes to the freedomHip (freedomRollX, freedomRollY and freedomRollZ). Have them as float with the min at ¨C10, max at 10 and the default at 0. Now, create a series of set driven keys on the new attributes exactly the same as we did with the SpineRoll attributes on the CntrlHip. Once finished, we have in essence two sets of attributes controlling the rotation of the lumbar and thoracic joints.

    Toggle Time:

    On the CntrlHip create a custom attribute named Offset with the type as integer and a min of 0, max of 1 and default at 0. This attribute is the toggle to have the skeleton automatically try to balance out the translation of the hips.

    Expression Time:

    In the Expression Editor write the following expression naming it offsetExp:

    if (CntrlHip.Offset > 0)

    {

    freedomHip.freedomRollX = -CntrlHip.translateZ;

    freedomHip.freedomRollZ = CntrlHip.translateX * 1.5;

    CntrlChest.ChestRollZ = CntrlHip.translateX * 4;

    CntrlHipG.rotateZ = CntrlHip.translateX * 10;

    CntrlHipG.rotateX = -CntrlHip.translateZ * 8;

    }

    This expression says that if the Offset attribute is on (a value of 1) have the translation of the CntrlHip affect the value of the freedomRoll attributes thus updating the rotation of the spine joints. To see the effect translate the CntrlHip in both the Z and X.



    Add the shoulderRollExp:

    This expression helps the shoulders compensate for the spine joints rotation in the X axis:



    if (CntrlChestG.rotateX > 0)

    CntrlChestG.rotateX = CntrlHip.spineRollX * 12;

    else

    CntrlChestG.rotateX = CntrlHip.spineRollX * 8;



    The balance expression:

    Now, let¡¯s say we are animating the character walking around. It would be convenient to have the body move automatically whenever the character takes a step. We can accomplish this easily through an expression. Remember though, with any type of automation it is wise to give the animator the ability to turn it on or off. So, with the CntrlBody selected, add a custom attribute called Balance (integer type with a min of 0, max of 1 and default at 0).

    Now create the following expression in the Expression Editor and name it balanceExp:

    if (CntrlBody.Balance > 0)

    {

    CntrlBodyG.translateX = (CntrlLankle.translateX + CntrlRankle.translateX)/2;

    CntrlBodyG.translateZ = (CntrlLankle.translateZ + CntrlRankle.translateZ)/2;

    CntrlBodyG.rotateZ = (-CntrlRankle.translateY * 2.5) + (CntrlLankle.translateY * 2.5);

    CntrlBodyG.rotateX = (-CntrlRankle.translateY * 2) + (-CntrlLankle.translateY * 2);

    CntrlChestG.rotateZ = -CntrlHip.rotateZ/2 + ((CntrlRankle.translateY * 2) + (-CntrlLankle.translateY *2));

    }

    Notice in the expression the use of the "freedom nodes" like the CntrlBodyG is the node that the expression writes to. This way we still have freedom to manipulate the actual CntrlBody node independently of the expression.

    Now turn the Balance attribute on (to 1) and move the CntrlLankle around. Notice the rest of the body trying to compensate and balance itself out.



    These expressions should familiarize you with how to have an attribute or set of attributes "drive" another objects attribute(s). You should now be able to construct some other expressions that involve the body reacting and counteracting to the movement of various joints.

    In addition, you can create some shoulder controls to drive the placement of the shoulder joints independent of the body. Create some controllers and have the shoulder joints point constrained to the controllers. Make sure the controls are children of the cervical joint so they will come along for the spine roll ride.

    To review, we have used a combination of primarily set driven keys using custom attributes and applied some expressions to create a functional and manageable spine setup.

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      Animation (19)
      Modeling (34)
      Character Setup (12)
      Textures and Materials (17)
      Effects (4)
      Tips and Techniques (3)
      Getting Started (3)
      Using Tools and Scripts (0)
      Lighting (5)

    New

    Hot