Maya & Python Scripting / Character FX & Animation / Maya / Python
Pole Vector Constraint | Maya Python Auto Rig Tutorial
Written guide

Playing loads YouTube content. YouTube processes data after activation.
Watch on YouTubeIf the player is blocked or unavailable, use Watch on YouTube.
An IK handle places a limb’s end, but the animator also needs to direct its bend. This lesson adds elbow and knee pole-vector controls to the existing Maya auto-rig. It develops the placement manually, translates that process into a helper, repairs several coordinate-space and constraint errors, then incorporates four controls into the master hierarchy.
The source is a long debugging session, not a finished code listing. Its central result is a working placement-and-constraint sequence for the demonstrated skeleton. The exact Maya release is unidentified, and the recording does not establish a universal pole-vector calculation for arbitrary limb proportions or nearly straight chains.
Establish the limb plane before moving the control outward
At 00:01–04:00, the instructor creates a circle and temporarily parent-constrains it to the shoulder, elbow, and wrist with maintain offset disabled. The resulting position places the circle within the plane represented by those three joints in the example. The temporary constraint is then deleted.
Next, an aim constraint points the control toward the elbow. That temporary constraint is also removed, leaving the orientation available for an outward movement along the control’s local X direction. The control is moved away from the arm and used as the target of a pole-vector constraint on the arm’s IK handle.
The manual test checks that applying the constraint does not visibly shift the arm, then moves the control to steer the elbow. That lack of an initial jump is an important observation, but it belongs to this particular bent chain and placement. The lesson does not derive a general vector-projection formula or solve the ambiguity of a perfectly straight limb.
The manual offset is about forty scene units. Its purpose is to put the control at a usable distance from the limb, not to define a fixed distance appropriate for every character scale.
Give pole-vector creation its own helper
During 04:00–11:02, the instructor compares this operation with the existing control-creation function. Ordinary controls align to a joint; the pole-vector control needs a relationship among three joints and an outward displacement. A separate helper is introduced rather than forcing those different inputs into the old call unchanged.
The helper starts with a control name and circle direction, then adds the three joint references needed for placement. The circle radius is fixed inside this helper for the example. Missing arguments and an undefined radius variable are corrected before alignment is attempted.
An arrow-shaped control is considered, but the available snippet is MEL and is not converted during the lesson. The implemented control remains a circle. Likewise, the existing zero and offset grouping conventions are reused, but their placement must be coordinated with the new constraints.
Start by verifying that one correctly named circle is created. If that simple step fails, debug the function signature and input names before adding parent constraints, aim constraints, and movement to the same failing run.
Position the zero group and verify constraint direction
At 11:02–24:01, the helper receives the shoulder, elbow, and wrist names and creates the temporary parent constraint. A missing mc. prefix initially prevents the command from resolving. Once that is corrected, the positioning operation is tested before the next stage is enabled.
The aim operation needs the elbow as the target and the object being aligned as the constrained object. The recording reverses these roles during development, then fixes them. Missing quotes in constructed names also cause trouble. These are separate errors: argument order determines what moves, while string construction determines which scene node is addressed.
The zero/offset hierarchy introduces another distinction. The instructor initially applies operations to the wrong group, then settles on the zero group for the placement and aim. Moving that parent establishes the control’s starting position while allowing the animator-facing control to retain neutral channel values.
The debugging method is worth retaining. The movement and constraint-deletion lines are temporarily commented out so that the intermediate alignment can be inspected. Once the group visibly aims in the right direction, the remaining operations can be restored. Testing the entire chain at once would hide whether a misplaced control came from its initial position, its aim, or its later translation.
Move along the aimed axis without replacing a world coordinate
During 24:01–32:00, the attempted setAttr operation on tx does not produce the intended outward placement. The script needs a displacement along the oriented local axis, not simply an assigned translation-channel value interpreted in the group’s parent space.
The lesson switches to move with a three-component displacement, relative movement, object space, and the world-space-distance option inspected in the command reference. This expresses movement along the group’s current local direction while using the intended distance interpretation.
One more error remains: the target string still ends with .tx. The movement command needs the object to move, not the scalar channel used by the earlier attribute-setting approach. Removing that suffix produces the desired placement.
This is a useful example of why changing commands requires reviewing their argument contract. Replacing setAttr with move while retaining its attribute target does not fully translate the operation. The corrected sequence aligns the zero group, removes the temporary alignment constraints, and moves the group outward, leaving the control itself at zero.
Inspect both the group and the child control after this step. The group should carry the placement, while the control remains ready for the animator to offset from that starting state.
Extend placement to both elbows and both knees
At 32:00–36:01, the left-elbow helper call is copied for the right elbow, with side-specific names adjusted. Existing control-color logic is reused so the new controls follow the rig’s side conventions.
The same helper is then used for the knees with hip, knee, and ankle references. The purpose of the three-joint inputs remains the same, but the chain being described changes. Check every input in a copied call; changing the control label alone cannot turn an elbow placement into a knee placement.
A clean rebuild now produces four positioned controls. At this stage, position and appearance are the verified result. Steering behavior still depends on connecting each one to the appropriate IK handle.
Connect each control to its handle without an unsupported flag
During 36:01–42:09, poleVectorConstraint is added to the constraint stage. The control is the target, and the IK handle is the constrained object. The initial troubleshooting briefly reverses that order, but the instructor confirms that the original target-then-handle order was correct.
The actual command problem is the copied maintain-offset flag. This constraint does not accept the flag used for the earlier parent and aim operations, so it is removed. The left elbow then responds correctly, and the corrected call is duplicated for the right elbow and both knees.
The knee setup exposes a naming mismatch: the script asks for a “foot” handle, but the earlier builder named it as a leg IK handle. Updating the reference to the actual created name fixes that connection. This is a dependency between builder stages, not a reason to rename a random scene object until the error disappears.
For each new constraint, move only its corresponding control and confirm the intended elbow or knee responds. Return it to neutral before testing the next one. This makes crossed left/right references and incorrect handle names easier to identify.
Include the new controls in the master hierarchy
At 42:09–45:06, the elbow and knee control groups are added to the existing master-control parenting operation. A missing comma is repaired, then the tool is run again from its cleared starting state.
The final Outliner is organized beneath the rig’s main group, and the instructor checks that the arm can move and its pole vector can steer the bend without an unwanted placement offset. The result completes this stage of the basic skeleton tool. Reverse-foot and more advanced spine features are mentioned as later work.
Review the completed stage through its separate responsibilities: four correctly named controls, suitable starting placement, zeroed animator-facing channels, correct control-to-handle constraints, and inclusion in the master hierarchy. The recording supports that scoped result. It does not certify every extreme pose, straight-chain configuration, solver choice, or character scale, so those remain necessary tests when adapting the tool to another rig.