martes, 18 de agosto de 2009

Lesson 3: Rigging the Spine

We are going to start the Spine rig. Now the numbers of joints that you place on your character depends on the design of your character, some need more, some need less joints. For the serval, I only used 8. The last 3 joints on the top are going to be used as neck, so we are only going to do the FK and IK on the first 5. Place the joints and orient them. Select the Ik spline tool (it looks like the joint tool but with a red curve on the side) and on the options make sure that the numbers of spans is up to 2 (this makes a softer curve). To animate it select the curve and put it in vertex mode. Select the deformer tab and click on cluster. Make a cluster for each vertex. Save your file!

Make two nurb controls (IK_base_ctrl, Group it, and IK_top_ctrl, Group it). Snap them, the top control on joint number 5 and the base control to the first spine joint. Now select the first two clusters (the ones at the top) then the control and press P (parent). Do the same for the bottom with the base control. Now select the Ik curve and the last remaining cluster (the one in the middle) and do an orient constrain and a parent constrain. Save your file!

For better control on rotation on Y do an expression. Select the Ik handle (which says twist on one of the attributes) select the window tab, animator editors and select expression. Name the expression spineTwistEXP, and the expression should be ikHandle.twist = IK_top_ctrl.rotateY. If you’ve done this correctly there should be no problem with the rotation on Y. Save your file!

Making the spine stretchy. Select create tab, measure tab, arc length tool. Then select the Ik spine curve and then click arc length. Go to MEL (on the left bottom of Maya) and type in arclen –ch 1; . Now if you select the curve, in the option box to the right you can find the curve info. Make a condition node. The first term is going to be the curve length. Connect the arc length to the condition node. Then the second term is going to be the original curve length value. Make the operation greater or equal to, if the value is less then the result is 1 (false). Choose the multiply divide node and make the operation on divide. Connect the arc length with input1X and then connect the output x with color if true R. Go to the connection editor, load on the left side the condition 1 and on the right load each joint of the spine (remember that we are only working with the first 5), and connect the condition node out color on outcolor R to the joint on scale, scale x. We are done with the IK! Save your file!

Make three joints, from the bottom up to where the IK joint number five is. Name them. Select the base FK joint then the group of the IK and do a parent constrain, do the same for the top FK joint. Now we need to fix the same twist issue with the FK, so make a control for each joint (each in a different group) and name each control: FK_base_ctrl, FK_mid_ctrl and FK_top_ctrl. Now for each, select the joint, then the group of the control and do an orient constrain. In the hypergraph erase the orient constrain box that you just did. Once you are done, you can reshape them the way you like using the vertices of the group of the control. Save your file!

Next, select the base FK control, then the joint and do a parent constrain. Do the same for the top control. Open the expression editor and change the previous expression, add to it. It should look like this ikHandle.twist = IK_top_ctrl.rotateY + FK_base_ctrl.rotateX + FK_mid_ctrl.rotateX + FK_top_ctrl.rotateX . Congratulations, you are finished with the spine! Save your file!



No hay comentarios:

Publicar un comentario