While it is very likely that any given model will require at least some custom rigging work, it can often be helpful to automate the setup of common subcomponents that occur frequently in many different rigs. In this example, we'll be doing just that and setting up a simple inverse kinematics (IK) system with code.
Although our example will be simple, it will still demonstrate a common issue—the need to accurately position joints to match the specific proportions of a model. As such, the script will have the following two distinct parts:
A preliminary step, where we create locators representing where the various joints will be created.
A secondary step, where we build a skeleton and set up its attributes based on the position of the locators.
By breaking the script into two parts, we allow the user to alter the positions of the locators after they've been created, but before the actual skeleton has been set up. This tends to be a much more effective...