0

Creating a Character Rig – Part 15: Dual knee solution (Advanced)


In the previous movie, we set up a no-flip knee, ideal for walk and run cycles. In this movie, we’ll alter it into a dual knee solution for greater versatility. Start by opening the file “15-0-Character_Rigging_part15_start.mb” or by using your own file from the previous lesson. Our current scene uses a no-flip setup along with a custom attribute to control the knee’s orientation. While this is great to avoid leg flips due to the foot control moving past the knee locator, aiming the knee with a custom attribute may not be the most intuitive method for the animator. For these scenarios, we’d like to bring back our original pole vector solution, where we could aim the knee using a control in the workspace. However, we’d like to do this without losing all the advantages of our easy-to-use no-flip knee. The solution is to set up both types of knees, then create a switch allowing animators to choose whether they want a no-flip knee or an aimable pole vector knee. To make this possible, we’ll combine a few of the different rigging techniques we’ve learned so far. Just like we’re using an FK joint chain and an IK joint chain to drive the result joints, we can actually create two sets of joints to drive the IK leg as well. Then we’ll create a blend attribute on our leftLeg_settings_CTRL to switch between them, exactly as we did with the IK/FK switching in part 11 of this series. Note that this dual knee setup will be independent of the foot rig which we’ll build in upcoming movies. First we’ll want to duplicate the existing IK leg twice, to set up our “no flip” knee and “pole vector” knee. However, if we did this using the Duplicate command, we’d have to rebuild our two knee solutions from scratch. Instead, select the entire IK leg and foot control and perform a Duplicate Special operation. Reset the settings, then make sure to turn the “Duplicate Input Graph” on. This duplicates all your joints, plus their connections to the other objects we selected (such as IK handles and the knee locator). Now let’s clean this up a little bit. Under the original IK foot_CTRL, we’ll need to delete leftLeg_HDL and leftLeg_IK_lengthEnd_LOC since this is now just a generic leg that will be driven by our two knee solutions. We’ll also delete the noFlip_knee_GRP for this generic IK leg as well as any remaining length measurement locators. We’ll leave the IK handles controlling the foot’s ball and toe, as both knee solutions will drive the same foot rig. Now rename the new duplicated joints and their leg IK handle, effector, knee, pole vector constraint, and length nodes with the identifier “noFlip”. Parent the leftLeg_noFlip_HDL, lengthEnd_LOC, and noFlip_knee_GRP, under the generic IK foot_CTRL. Then delete the duplicated leftFoot_CTRL, as well as the left ball and toe joints. Remember, our noFlip leg is only a knee solution and has no bearing on the foot. We’ll also need to use the Connection Editor to hook up the leftFoot_CTRL’s “Knee Twist” attribute to the noFlip_knee_GRP’s Rotate Y attribute since we deleted the old one. Now that we have our generic IK leg and no flip leg set up, duplicate the noFlip leg, its IK handle, length locators, and knee group one more time with the Duplicate Special command. As you may have guessed, we’ll rename all these new nodes with “pv” for our pole vector knee. And as before, we’ll re-parent the IK handle, lengthEnd locator, and knee group to the generalized IK foot control, then delete the extra duplicated foot control and IK joints. However, for the pole vector knee, we’ll unparent the knee control locator from the leftFoot_CTRL. Delete the leftover group since it’s empty now. Now we need to return this locator back to its original start position. Select the leftLeg_pv_HDL and set the “Twist” values back to 0. Then select the leftKnee_pv_LOC and set its “Translation” to 0. Excellent, now both knees are set up. You just need to create a blend between them and the generic IK thigh, shin, and foot joints. We’re going to skip past that step here, but feel free to consult the scene file linked below as well as part 11 of this series if you’re having trouble. When finsihed, you should have six additional blend color nodes, three for rotation and three for translation. Now we’ll create a new custom attribute to blend between the two knee solutions. Select the leftLeg_settings node and create a new custom attribute. Rather than referring to these as “no-flip” and “pole vector” solutions, we’re going to call them “Auto” and “Manual” knees, to make things simpler for the animator. Name the attribute autoManualKneeBlend, then turn on “Override nice name”, and use the nice name “Auto / Manual Knee Blend”. Set “Minimum” to 0 and “Maximum” to 1. Connect it to all the blend color nodes via the Connection Editor to drive all the “blender” attributes just as we did before. Now in Auto mode we can control the knee via the “Knee Twist” attribute, while in Manual mode we can control it with the leftKnee_CTRL. You can hide all the IK legs in the workspace. Finally, consider our manual knee control right now. It’s just a locator. It would be nice if we could change this over to a NURBS curve, so that if we wanted to hide all the controls in the scene we could just deactivate the NURBS display. Let’s trace this curve from a polygon pyramid, which will be easier to distinguish from other controls with its pointy shape. Scale the pyramid up and rotate it so it points down the Z axis. Also, move it in Z so its base falls on the X axis. Now, with the EP Curve Tool in “Linear” mode, trace a NURBS version. Rename the curve “leftKnee_CTRL” and point snap it to the same spot as the current leftKnee_pv_LOC. Freeze its transformations… …and parent the leftKnee_pv_LOC under it, then hide it from the workspace. Then add the new control to the legs_IK_LYR. There, this is much nicer to look at. However, one thing stands out. Although we can now aim the knee where we want, we can’t plant it as precisely as the other IK controls. In the next movie, we’ll add the ability to snap the knee directly to the control.

Bernard Jenkins

Leave a Reply

Your email address will not be published. Required fields are marked *