Maya & Python Scripting / Character FX & Animation / Maya / Python
Connecting Blend Shapes to Attributes on other objects | Maya Python 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.
This lesson moves selected facial expressions from custom scalar attributes onto the X and Y translation channels of a visual control. The existing driven-key helper already connects a controller attribute to a blend-shape weight. It is extended so the driver can be an existing channel, and so positive and negative movement can trigger different targets.
The demonstration completes the four directions of the left and right brow controls. It does not finish every facial mapping or the jaw-opening mechanism. The source depends on the existing face-rig script, naming convention and blend-shape setup; the exact Maya release is not stated.
Refactor the existing helper before changing behavior
During 00:00–03:03, repeated attribute-setup lines are moved into the shared connection function. The scene is cleared and the rig rebuilt to confirm the old custom attributes still appear without reported errors.
This establishes a useful checkpoint before the new driver types are introduced. If the refactor already breaks ordinary custom attributes, later translation-channel failures become harder to diagnose. The source still reports warnings, which are not all investigated in this lesson.
The helper already receives the blend-shape node, target/object name and control name. Those identify the deformation endpoint and the control object, but they do not yet allow the control’s driver attribute to have a different name from the facial target.
Separate target identity, driver channel and direction
From 03:03–07:01, two new inputs are added: the driver attribute name and a direction value. Existing calls keep the target’s name as their custom attribute name and receive a positive direction, preserving their original intent.
The driver path can now use a channel such as ty instead of the target name. The facial target still identifies the blend-shape weight; it is not renamed merely because a different control attribute drives it.
The direction controls whether the active driver endpoint is positive or negative. In the existing two-state driven-key construction, the controller’s active value is multiplied by that direction. The target’s active weight remains the expression endpoint. This lets opposite translations activate different target shapes through separate keyed relationships.
After updating the function signature, every call site must supply the new arguments. The instructor catches the missing direction inputs before rebuilding and tests the still-existing custom attributes again.
Avoid creating a custom attribute for an existing channel
During 07:01–12:01, the left brow-raise target is assigned to positive Y translation. The first test produces a malformed control arrangement, with its frame and brow control displaced from the expected grouping.
The helper was still trying to run the custom-attribute creation steps for a driver that now uses an existing translation channel. The instructor adds a condition so those steps run only when the target/object name equals the requested attribute name. That equality identifies the original custom-attribute case in this particular script.
After rebuilding, the control hierarchy is intact and upward movement raises the brow. Downward movement does nothing yet because its target has not been mapped.
Treat the equality test as part of this tool’s naming contract, not a universal way to determine whether any Maya attribute exists. The source demonstrates a repair in this helper; it does not build a general attribute-inspection layer.
Map and test each direction of the left brow
From 12:01–17:02, the left brow’s remaining directions are added and tested incrementally:
- Positive Y drives brow raise.
- Negative Y drives brow drop.
- Negative X drives the inner-raise target.
- Positive X drives the outer-raise target.
The script uses target-specific conditions to choose the channel and sign, while other expressions continue through the existing custom-attribute path. The instructor clears and rebuilds after each addition so the new driven relationships are created from the updated code.
A wrap is introduced during inspection to make the separate brow geometry follow the deformation visibly. That helps assess the mapped motion, but this lesson does not establish the final attachment system for every secondary facial part.
Test one direction at a time and return to neutral between checks. Then inspect combinations. Four individually responsive directions do not by themselves prove that simultaneous targets produce an acceptable facial shape in every diagonal pose.
Mirror the mapping deliberately and reset before rebuilding
During 17:02–19:02, the left-side condition block is copied for the right brow. Target-side tokens are changed and the X directions reversed so the controls produce corresponding inward/outward actions on opposite sides.
The instructor also resets the deformed state before rebuilding, explicitly avoiding carrying the current deformation into the new setup. This is a state-management requirement of the demonstrated construction workflow: build from the intended neutral face, then test the resulting controls.
The source notes a separate interface concern about screen-left versus character-left control placement. Correct target names and signs do not automatically make the screen arrangement intuitive. Inspect which brow each control affects and how inward/outward movement reads to the user.
Preserve custom attributes for expressions beyond the four directions
From 19:02–21:04, both brow controls are tested. Their four demonstrated expressions no longer need additional custom channels because the translations now serve those roles.
Other controls may need more expressions than four directions can represent. The mouth is specifically identified as retaining additional attributes, while the nose has a more limited target set. The instructor plans to choose and connect those mappings between lessons.
Opening the mouth is also deferred: the source has no mouth-open blend target and plans a joint-based mechanism driven by the control. Do not treat that plan as an implemented feature of this lesson.
The completed result is a reusable driver-channel/sign extension and two working brow mappings in the demonstrated scene. Remaining facial assignments, interpolation details and combined-expression deformation quality still require review.