jueves, 20 de agosto de 2009

Rigging a Serval

Welcome to Rigging a Serval. For those of you who don’t know, a Serval is a medium-sized African wild cat. Molecular DNA analysis indicates Servals descended from the same ancient Felid ancestor as the Lion, but the Serval maintains its own unique lineage and does not branch from any other cat species, although they appear to share common traits with the Cheetah. However, similar studies have shown the serval to be closely related to the African Golden Cat and the Caracal. (Wikipedia). Before you begin to rig make sure that you model is absolutely centered on the scene. This character is cartoon-like serval. Notice that the arms are stretched in a relaxed position to the sides and that the tail is absolutely straight. This is a very comfortable position to rig, so I highly recommend it for your model. I hope these lessons help you out and good luck! Remember, as you rig your character you should constantly SAVE YOUR FILE!

Lesson 5: Connecting Everything

Select your clavicle joint and do a parent constrain it to the spine, so wherever the spine moves, the arm is connected. Then select the clavicle control and parent it under the top Fk spine control. Do the same for the other side. Next, select your femur then the pelvis and press P to parent it. Connect the femur curve control to the base FK spine control. Do the same for the other side and for the tail.

Next, Make a new control that is going to be named master control. Group it, make it arrowed shape and place it under the character. Five things will be parented to this control: the two feet controls, the two hand controls and the pelvis. With this control we can move our character around, but there is one last step that we need to do. When we translate our character it moves just fine, but when we rotate it the geometry goes a little crazy. So lets create a locator group it and place it behind the character around the height of the head. This locator is known as a roll solver. Parent it under the spine base control and go to the attributes of the of the IK spline. Go to IK solver and click on the option that says twist controls, world up and object up, then in world up object you must down the name of your locator and the problem is fixed.

Now lets mesh the geometry with the joints. On the hypergraph select all your bind joints, the tail joints and the spine joints and the pelvis joint. Click on create and select set. Make a new set and call it bind_joints. With this you can select and deselect your joints by only clicking on your bind_joints set. With you joints selected, shift click the geometry and go to the tab that says skin. There select the bind skin and then the smooth bind. Click on the small option square on the right of it and choose in bind to: selected joints. Then in bind method: closest distance and then click on bind skin. Almost done! Save your file!

Now, our final step is the weigh paint. If you move any control you can observe that the geometry wrecks in some places, so the weigh painting is basically assigning the joints that are the closest to that part on the geometry a weigh influence so that it can deform a little but still look natural. So select you geometry, then the weigh paint tool and begin to paint. To see the deformations you must animate some controllers and fix the problems. To choose the joints that you want to work on go to the advance3d attributes and you can select there the joints that is being worked on, the intensity on the brush, and your brush options such as replace, smooth, add and scale. Recommendation: weigh painting is very tricky, be very careful when you paints because sometimes with out knowing you are placing influence in other parts of the geometry that are not the ones that you wish to affect. Also, if you did one paint brush that didn’t you want do not click ctrl z, Maya and the weigh painting usually make things worse with that command, so just try to fix it. Save your file constantly!



martes, 18 de agosto de 2009

Lesson 4: Rigging the Tail and the Fingers

This rig is very simple. Place the joints from where the tail starts to where it ends. Name the joints and orient them. Then make a nurb control for the tail (name it and group it). Once this is done, add an attribute to the tail control named curlUpCurlDown and set the minimum to 0 (curl down) and then the maximum to 10 (curl up). Save your file!

Open the set driven key window and load as the driven the joints and as the driver the control. When the control is on 0 the tail is curled down, so key all the joints when you rotate them on the Z-axis. When the control is in 10, the tail is curled up. Key every joint and you should have an operating control. You must establish on the value 5 of the control the joints in their original position; so key the original position of the tail as well. Do another set of added attributes that makes the tail curl from right to left and do the set driven key steps to activate the switch. Save your file!


Now we are going to rig the hand. Select the serval geometry and click the magnet symbol to make selection live. This glues the joints over the geometry; when you are done placing the joints deselect the magnet tool. Orient them. Next select each joint, then the wrist bind and press P to parent. Now you have connected your hand to the rest of the arm. Save your file!

To move the fingers, add attributes on the switch control and like the tail, activate the switch to make the fingers curl or move. Remember, when you load up the set driven key the switch control is the driver and the joints are the driven. Save your file!





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!



Lesson 2: How to Rig an Arm

Recommendation: Do not skip ahead on the instructions, every step is crucial to complete a full working rig. You must also know that the explanation for the arm rig and the spine rig will not be as detailed at some points (such as where to place joints and how to do controls) because if you did the leg, you are supposed to know how these small steps are done. 

Lets continue! We are going to start the arm rig!  Place joints on the shoulder, elbow, and wrist. Name them. Remember that the characters arm must be slightly flexed. Now we are going to orient them. This time it’s a little bit different. The orientation on Z (on rotation format) on the shoulder should be with the blue loop vertical so that the arm moves up and down.  The elbow must have the blue loop (Z) horizontal, and  the wrist should have it vertical. That is the correct orientation. Next, duplicate the the elbow joint and slide it down the arm so that the joint is placed between the wrist and the elbow. Erase the duplicated wrist joint and name the new joint forearm.  In the hypergraph rearrange the order of the joints, it should be L_IK_shoulder, L_IK_elbow, L_IK_forearm and L_IK_wrist. Save your file!


Make and IK handle in RPsolver from the shoulder to the forearm. Click on the top modify tab, select evaluate nodes and click on ignore all.  Go to the Hypergraph, select your Ik Handle and the effector. With these two selected go to the port view and move both pivots to the wrists. Click again on modify, evaluate nodes and now select evaluate all. Save your file!

Now we are going to control the elbow. Make a copy of the Ik handle as a guide, add it to a layer and make it non tangible. Create a nurb control in the shape of an arrow (name it L_elbow_ctrl, and group it) and place it just behind the elbow with the point pointing towards the elbow.  Select the nurb curve and the IK handle and constrain them with a pole vector constrain. Move the group of the elbow to place the joints where the guide is, once the Ik elbow is in its right place erase the duplicated joints that worked as our guide. Save your file!

Make a new control (L_Ik_ctrl, group it) and place it on the wrist.  Select the wrist joint then the control group and do an orient constrain. Go to the hypergraph and erase the box that represents the constrain you just did.  If you like you can reshape the curve whichever way you like controlling the vertices of the group of the control. Now select the wrist control and then the forearm joint and do an orient constrain only in X. Finally select the Ik handle and the wrist control and press P. Congratulations, you should have a working Ik system! Save your file!

We are now going to start the FK arm rig, it is very similar to the leg Fk system.  Duplicate your Ik joints and change the names from Ik to Fk. Make a nurb control for every joint (except the forearm) and group them. You must orient them, so for each of them select first the joint, then the group of the control and orient constrain in all XYZ. Group the controls under the shoulder, so that in the hypergraph the order of the controls are, (from top to bottom) shoulder, elbow and wrist. Now select the control and then the joint and do an orient constrain in all XYZ except on the wrist, the wrist orient constrain is only in X.  Make a new joint where the clavicle is supposed to be, name it. Make this joint the father of the shoulder joint. Make a Nurb control for the clavicle, name it, orient constrain it and make this control the father of the other arm controls. Save your file!

Now we are going to make the Bind. Duplicate the joints again and replace Fk for Bind. Just like we did bind for the Ik and the Fk for the leg, do the same steps for the arm. Make a new nurb control for the hand add to it an attribute that will work as a switch between both Ik (minimum 0) and Fk systems (maximum 10). Next we are going to do a Set driven key. Go to animate and click where it says set driven key. The hand control is going to be the driver (just click the hand control and hit load) and the driven are going to be all the constrains that are beneath the bind system (select them all in the hypergraph and click load driven).  On the driver right side click the last option, it should be ikToFkSwitch, then on the driven left side click the first one on the list and select the last two options that appear on the right side.  If your switch is in 0, then key all your driven selections with the IK in 0 and the FK in 1. Then change the switch to ten and key all of your driven with the IK in 1 and the FK in 0.  Congratulations! You have finished your arm rig! Save your file!



Lesson 1: How to Rig a Leg

Welcome! Here is a step by step guide and explains how to do a leg rig with both FK and IK systems. Lets begin. Select your joint tool under the tab that says animation and place a joint on the hip, knee, ankle, ball of foot and on the toe. Use your 4 views to make sure that the joints are placed where you want them to be, also, keep in mind that the joints cant be in a straight line, so make sure that the knees are kind of flexed. Once you’ve done this, open the Hypergraph Hierarchy and name your joints. Remember, we are going to start with the IK system so it is very convenient to use a prefix of the side you are working on, for example, L_IK_knee ( you should name everything that you do). Now we must orient the joints. On the top of the screen, there is a symbol with three blue squares and a red arrow, click it and then click the black question mark on your right. Orient your joints, when you are done, click the button on the left side of the three squares. Remember, once you’ve oriented them you cant move them again, if you do, orient again. Save your file!


Choose the IK Handle tool and make sure that on the IK settings the current solver is ikRPsolver and solver enable, snap enable and sticky should be checked. With this tool selected click from the femur joint to the ankle joint. Name it. Then with the same tool but with the setting on ikSCsolver click from the ankle to the ball and from the ball to the toe. Save your file!


Create a foot controller. Make a nurb circle and hit control group. Move the group and snap it to the ball of the foot. When you are creating controllers always group them. The reason is because we move the controllers to their place thought the group so that the nurb curve is always zero in Translate, Rotate and scale in XYZ. In the Hypergraph select the leg IK, group it and name the group Lift_heel_grp. Move the pivot of the group, in your port view press w and then insert, this way you move the pivot and snap it (pressing V) to the ball of the foot. Now in the Hypergraph select the Ball ik handle and your toe ik handle, group them together and name it Toe_Tap. Move its pivot to the ball of the foot. Now select the two groups and regroup them. Name it Toe_Pivot and place the pivot on the last joint. Regroup it again, name this group Heel_pivot and place pivot to the ankle. Regroup it one more time (no need to name) and place the pivot on the ball of foot. Select this last group and parent it under the foot control. Save your file!

Select the foot controller curve and under channels click edit and select the add attribute option. A box that says long name, there you write liftHeel (the first letter never capitalized, use no space between one word and another, but always capitalize the first letter of the second word) make sure that the data type is float and click add. Do the same for toeTap, standTip, toePivot, heelPivot, knee and offset. Now, open the hypergraph select the foot control and if you place the mouse arrow on the right side of the block that represents the foot control you will see that the arrow changes into a box with a small black arrow. Right click it, select single and with out letting go on the mouse pressed button select toe tap to the toe tap box and connect it to rotate x. do the same for lift heel in rotate x, heel pivot in rotate y, stand tip connected to toe pivot in rotate x, and toe pivot connected to toe pivot in rotate Y. Save the file!

Next we are going to control the knee. Duplicate your IK joints and place them in a layer with V and R selected, these are your guide joints because when we fix the knee the original joint move a little, so these guide joints help us place them where they belong. Open the hypershade, select the average +/- node and make sure that the operation is on sum. Select the average +/- node the foot control and the leg ik. In the hypergraph (with these selected) click on the box on the top that has three rectangular boxes with the center one colored yellow (this way you can work with only your selection visible). Over foot control right click single and choose knee. The knee is connected to the average +/- node in input 1d(0). Right click foot control and choose offset. The offset is connected to average +/- node in input 1D(1). Now, select the average +/- node right click it and connect output 1D to ik handle in twist. Save the file! Congrats, you are done with the IK system.

Lets start the FK system. Select joints from the femur to toe and duplicate. Make sure to delete the effectors since you just need the joints. Replace the names from IK to FK. Make controls with nurb circles for each joint; remember to group them before moving and to name them. When you are done you must orient the controls, so for each, select the FK joint, the group of the corresponding control and orient constrain them. If some of controls change their position click on the group and on portview arrange the desired shape of the control manipulating the vertices of the curve. On the hypergraph you delete the box that represents the orient constrain. Group all the controls, ball to ankle, ankle to knee and knee to femur. Now, we are going to attach the joints to the controls. Do an orient constrain on each, but this time you must select first the control and then the joint. If you like, to visually enhance and to make an easier access to the controls, you can always change their shape or position manipulating the vertices of the group of the control. Now you are done with the FK system. Save your file!

Now we are going to bind both systems. Duplicate the FK joints and replace the name from FK to Bind. Then (working on the hypergraph) select the IK femur and the Bind femur and do an orient constrain. Then select the FK femur, then the Bind femur and do another orient constrain. Do this process this way for all the joints. Do not erase the orient constrain boxes that appear beneath the bind joints in the hypergraph. You need them. Select the foot control and add a new attribute. Name it ikToFkSwitch and place the values maximum 10 and minimum 0. This means that whenever the switch is in 10, the Bind system will be working with the FK system, but when the switch is 0, the bind system will be working with the IK system. Save your file!

Next we are going to do a Set driven key. Go to animate and click where it says set driven key. The foot control is going to be the driver (just click the foot control and hit load) and the driven are going to be all the constrains that are beneath the bind system (select them all in the hypergraph and click load driven). On the driver right side click the last option, it should be ikToFkSwitch, then on the driven left side click the first one on the list and select the last two options that appear on the right side. If your switch is in 0, then key all your driven selections with the IK in 0 and the FK in 1. Then change the switch to ten and key all of your driven with the IK in 1 and the FK in 0. Congratulations! You have finished your leg rig! Save your file!