
For my Game Design program’s Capstone year I have taken on the secondary role, “Rigging & Animation”, for Team Voyager, and as such will be chronicling the process of creating an automated rig for both arms and legs.
The purpose of creating an automated rig is to cut-down on the iteration process for creating our First-Person view model, taking into consideration that I am the only person working within Maya for the scope of this project. Alongside this, I anticipate the Character Artist iterating over different designs for the finalized arm and leg meshes.
The Setup

As I required a placeholder mesh to preform these tasks on, I sourced a character from Sketchfab | Credit to “WisherZard” | and removed the portions of the mesh that were irrelevant to this project. Alongside this, I patched the top of the waist as one of our stretch goals for the project is to include lower-body animations.
The Arms | Manual Process
As the process for rigging the arms and legs are incredibly similar in many aspects, I will only cover the arms from this point on for brevity.
To start, I began by rigging a pair of arms by hand. The initial step was to place joints within the mesh, whilst taking care to ensure that any joints that would utilize an IK Handle are entirely planar. After creating the spine joints, I created the left arm and mirrored them over using the Duplicate Joints tool and duplicated them via behavior, allowing for rotation to be mirrored across the limbs.
The next step was to duplicate the shoulder->elbow->wrist joint chain twice, and rename the duplicates to differentiate between a FK chain and an IK chain. The purpose of this is to allow us to toggle IK/FK utilizing the node editor and a custom IKFK attribute on the controls.
Following this, we create circular NURBS curves to act as the FK controllers and create empty parent groups for each to hold transform information. This ensures that the controllers themselves have no translation or rotation history. Then, we parent constrain the respective FK joints to their controllers. An example of the hierarchy at this point looks as such:
└── ctrl_fk_l_shoulder_grp
└── ctrl_fk_l_shoulder
└── ctrl_fk_l_elbow_grp
└── ctrl_fk_l_elbow
└── ctrl_fk_l_wrist_grp
└── ctrl_fk_l_wrist
Now we create two IK controllers, following a similar process as the FK controllers; one for the wrist, and one for the elbow’s pole vector control. (I will touch on the placement of the pole vector controller in the automation section). Following this, we create an IK-Handle between the ik_shoulder and ik_wrist joints, and parent + orient constrain the IK-Handle to the wrist controller. Next we pole vector constrain the IK pole vector control and the IK-Handle. On the IK wrist control, we add a custom bool attribute titled ‘IKFK’, with a default value of ‘False’, as well as ensuring that the attribute is keyable. Following the creation of our custom attribute, we create a duplication of said attribute across all of our controllers, with the wrist designated as the proxy. Using python, the attribute copy looks as such:
def IKFKattrCopy(source, ctrls, attrName="IKFK", isSingle=False):
# add ikfk attr from given controller to selected controllers
mainCtrl = source
if not isSingle:
for ctrl in ctrls:
cmds.addAttr (ctrl, ln = attrName, proxy="%s.%s"%(mainCtrl, attrName), at="bool", keyable=1)
else:
cmds.addAttr (ctrls, ln = attrName, proxy="%s.%s"%(mainCtrl, attrName), at="bool", keyable=1) Now, utilizing the Node Editor, we tie the visibility of the FK and IK controls together with the IKFK attribute, so that only the appropriate controls are displayed at a given time:

As our controllers are now in place, we can begin driving our bind chain (the original shoulder to wrist chain we duplicated). Using the Node Editor, we will connect the IK/FK chain’s individual joints’ rotation attributes into blendColors nodes, and pipe the respective output to the rotation input on the bind chain. For example, the l_shoulder joint will be driven by a blendColors node that receives both the l_fk_shoulder’s rotation in ‘Color 1’ and l_ik_shoulder’s rotation in ‘Color 2’, with the ‘Blender’ attribute connected to our custom IKFK attribute.

Note: This image omits the FK chain inputs in ‘Color 1’ and the IKFK attribute input in ‘Blender’ on the blendColors nodes.
Now we have an arm rig that allows for toggling of IKFK using the custom attribute on any given controller. By swapping the IKFK attribute on any controller, the rig will automatically pull the rotation values from the desired drive chain to the given bind chain, as well as updating the visibility of the controllers.
The Arms | Automation Process
In terms of automation, the largest obstacle to tackle is the lack of persistence of python data between Maya launches/scenes. Whilst there are a few options for devising a solution to this problem (such as Andrew Christophersen’s The Dual Power of Metanodes in Maya), I will be tackling this via Maya’s custom shelves, as I assume the joints will be following my own naming conventions, as well as considering that the scope of this project does not require such a versatile solution. For reference, I will be utilizing PyMel as well as the Maya API (OpenMaya 2).
To start, we will begin creating individual python functions that replicate the exact steps that we took in the manual process. Any tool or process we undertake within Maya will output the resulting MEL script that runs under the hood to preform a given task. Utilizing this, as well as the MEL and Python documentation given by Autodesk, we can convert the manual tasks into script (with a little math). For brevity, I will not list out the entirety of all the helper functions, however, I will place some relevant ones in the relevant scripts section below. This function in particular covers the majority of steps:
def createIKFKRig(bindChain, prefix="l_"):
# create duplicate joint chains
ikChain = dupeJointChain(bindChain[0], bindChain[2], search=prefix, replace=prefix+"ik_")
fkChain = dupeJointChain(bindChain[0], bindChain[2], search=prefix, replace=prefix+"fk_")
# disable visibility of duplicated joint chains
cmds.setAttr(f"{ikChain[0]}.visibility", False)
cmds.setAttr(f"{fkChain[0]}.visibility", False)
# create and store fk controllers
fkCtrls = createControllers(selection=fkChain)
# create and store ik controllers
ikCtrls = []
ikCtrls.append(createController(selection=ikChain[2], removeConstraint=True))
# create and store fk controllers
ik_handle = createIKHandle(ikChain[0], ikChain[2], name=prefix+"ik_handle", newParent=ikCtrls[0])
# create pole-vector locator, spawn controller at loc position, delete locator
ik_pv_loc = create_loc(return_pole_vector_position(ikChain[0], ikChain[1], ikChain[2]), name=prefix+"ik_elbow")[0]
ikCtrls.append(createController(selection=ik_pv_loc, removeConstraint=True))
cmds.delete(ik_pv_loc)
# create pole-vector constraint on the pole-vector controller
# create orient constraint on wrist controller
cmds.poleVectorConstraint(ikCtrls[1], ik_handle)
cmds.orientConstraint(ikCtrls[0], ikChain[-1])
# create IKFK attribute on wrist controller
createIKFKAttr(ikCtrls[0])
# copy IKFK attribute by proxy onto other controls
IKFKattrCopy(ikCtrls[0], fkCtrls)
IKFKattrCopy(ikCtrls[0], ikCtrls[1], isSingle=True)
# create and tie visibility nodes
createControlVisDriver(ikCtrls, fkCtrls, ikCtrls[0], prefix+'arm')
# create and tie blendColors nodes
createBlendDriver(bindChain, ikChain, fkChain, ikCtrls[0])
#
toggleIKFK(bindChain, fkChain, ikChain, fkCtrls, ikCtrls, IKFKattrCtrl=ikCtrls[0])
# return the pertinent data
return ikChain, fkChain, ikCtrls, fkCtrlsNow, when we wish to create a new arm rig, we create a list of the arm’s bind chain joints, and return the data given back from the ‘createIKFKRig()’ function, as such:
# set bind chain joints
l_arm_bindChain = ['l_shoulder', 'l_elbow', 'l_wrist']
# create arm rig, and return pertinent data
l_arm_ikChain, l_arm_fkChain, l_arm_ikCtrls, l_arm_fkCtrls = createIKFKRig(l_arm_bindChain, prefix="l_")In terms of the persistence of data between instances of Maya, we create a custom shelf and create a user script as follows:
# 'Set References' Maya Shelf Script
l_arm_bindChain = ['l_shoulder','l_elbow','l_wrist']
l_arm_ikChain = ['l_ik_shoulder','l_ik_elbow','l_ik_wrist']
l_arm_fkChain = ['l_fk_shoulder','l_fk_elbow','l_fk_wrist']
l_arm_ikCtrls = ['ctrl_l_ik_wrist','ctrl_l_ik_elbow']
l_arm_fkCtrls = ['ctrl_l_fk_shoulder','ctrl_l_fk_elbow','ctrl_l_fk_wrist']Now when we wish to toggle IKFK on the arm, we simply call ‘toggleIKFK()’ with the following parameters:
# 'Toggle L_Arm' Maya Shelf Script
toggleIKFK(l_arm_bindChain, l_arm_fkChain, l_arm_ikChain, l_arm_fkCtrls, l_arm_ikCtrls, IKFKattrCtrl=l_arm_ikCtrls[0])As I anticipate only myself working within Maya for this project, this is a viable solution. For reference, I am not including some of the extraneous data I keep track of, such as a list of the custom nodes we created earlier. Keeping track of this data ensures that when we wish to delete the entirety of a rig’s controls, that the relevant nodes are also destroyed.
The Challenges | Development Log
One of the first challenges I faced was finding a clear and concise workflow to base the automation off of. The most resourceful material I was able to find was Jason Baskin‘s youtube channel, which detailed the manual process of rigging a 3D character. Utilizing this workflow (along with Jason’s endlessly helpful information), I was able to create a basic arm rig manually.
The process of automation for the manual steps was actually rather easy, as I could simply reference the documentation for Maya’s Python scripting, and essentially just repeat the same steps I took during the manual process. Alongside this, there were the countless bugs / issues I had with interacting with the Node Editor, that were all user-error. One unique issue I encountered was the pole-vector position script, as I originally created my own Vector3 struct for doing vector math, and somewhere along the line realized that Maya’s API (OpenMaya) has its own form of Vectors that I could utilize, which saved me quite a bit of headache.
The largest challenges I faced within this process was actually the setup required for the skeleton joints, as the majority of information on the topic is rather surface level. Jason Baskin’s youtube channel did briefly go over the orientation of the joints and the importance of keeping chains planar if they require an IK Handle, however, I found myself working with non-planar joints for quite a while. The result of this was retrying different meshes, different math, and breaking down the entirety of the pole-vector placement math down multiple times to ensure that I am a sane person. After realizing that the joints were non-planar, I recreated the skeleton and finally got the desired effect.
Relevant Scripts | Development Log
This is the script for determining the position in which the pole-vector controller should sit for the elbow/knee. This script in particular is in reference to tdHendrix‘s youtube video “Maya Applied Math – Placing Pole Vectors“, in which we utilize some extra math to ensure that the pole vector position does not clip into the joint chain upon nearing max extension of the IK chain:
# returns a pole vector position given three joints
def return_pole_vector_position(rootJnt, midJnt, endJnt):
start_vec = om.MVector(cmds.xform(rootJnt, q=True, ws=True, t=True))
mid_vec = om.MVector(cmds.xform(midJnt, q=True, ws=True, t=True))
end_vec = om.MVector(cmds.xform(endJnt, q=True, ws=True, t=True))
# gets: the dir from start to end | the dir from mid to start
start_end_mp_vec = (end_vec - start_vec)
point_vec = (mid_vec - start_vec)
# divide the dot-prod of the dir vectors by start to end dir ^^2
scale_val = (start_end_mp_vec * point_vec) / (start_end_mp_vec * start_end_mp_vec)
# project the midpoint line by the result above + the original start vector
proj_vec = start_end_mp_vec * scale_val + start_vec
# get the length of the full chain
root_mid_len = (mid_vec - start_vec).length()
mid_end_len = (end_vec - mid_vec).length()
total_len = root_mid_len + mid_end_len
# loc pos = the normalized dir mid -> projected vector * a scalar + the mid pos
return (mid_vec - proj_vec).normal() * total_len + mid_vecThese functions allow us to align the IK and FK chains to each other, ensuring that we have IK/FK matching when toggling between them. For FK specifically, we copy the translation and rotation values of the IK joints directly to the FK controllers. Whereas for IK matching, we get the pole-vector position that would align with the current state of the FK joint chain, and snap the pole-vector controller to said position and delete the temporary locator. Following this, we copy the translation and rotation values for the wrist controller to the FK wrist controller:
# allign fk chain to ik chain
def alignFK(fkControllers, ikChain):
for fkControl, ikJoint in zip(fkControllers, ikChain):
copyTransforms(ikJoint, fkControl, world=True)
copyRotations(ikJoint, fkControl, world=True)
# align ik chain to fk chain
def alignIK(ikWristControl, ikElbowControl, fkControls, fkChain):
fk_pv_loc = create_loc(return_pole_vector_position(fkChain[0], fkChain[1], fkChain[2]))
copyTransforms(fk_pv_loc, ikElbowControl, world=True)
copyRotations(fk_pv_loc, ikElbowControl, world=True)
copyTransforms(fkControls[2], ikWristControl, world=True)
copyRotations(fkControls[2], ikWristControl, world=True)
cmds.select(fk_pv_loc)
cmds.delete()For actually toggling between IK and FK, we flip the state of the custom IKFK attribute, retrieve the new state, and call ‘alignFK()’ or ‘alignIK()’ depending on the state. Since we are utilizing a node setup for toggling the visibility of the controllers, we do not need to manually toggle the controllers visibility attribute:
# toggles the custom IKFK attribute and updates the driving chain automatically
def toggleIKFK(bindChain, fkChain, ikChain, fkCtrls, ikCtrls):
toggleIKFKAttr(ikCtrls[0])
IKFKAttrVal = getIKFKAttr(ikCtrls[0])
if IKFKAttrVal:
alignFK(fkCtrls, ikChain)
else:
alignIK(ikCtrls[0], ikCtrls[1], fkCtrls, fkChain)As for toggling the drive chain, we utilize this function to force override the connection between the desired drive chain’s joints rotation values and the bind chain:
# connects the given drive chain's rotation attributes to the bind chain
def setDriveChain(bindChain, driveChain, attrName="rotate"):
for bindJoint, driveJoint in zip(bindChain, driveChain):
cmds.connectAttr(f"{driveJoint}.{attrName}", f"{bindJoint}.{attrName}", force=True)