Keywords: Animation, Maya, Rigging Tricks

Maya Rigging series of articles:

Caution for Building Controller

The management of transformations between joints (IK, FK and original) and controller is subtle art. When you encounter a deforming or rotation or translation issue, it’s difficult to address it, because there’re many processes on controller building workflow, and the priority for steps are fixed, just one mistake can cause the entire work to go wrong.

Here are the standard flow to create controller to FK system: (for more details, see:[Maya]Rigging 09 - Spine FK)

  1. Duplicate skeleton and cull the unused joints to create IK FK joints.
  2. Parent Constraints on original joints which was driven by IK and FK joints afterward.
  3. Doing Match All Transformations from IK joints and FK joints together to original joints.
  4. Create a control (Curve) at the origin of coordinate axes.
  5. Normalize the scale of controller (Freeze Transformations) before moving to the target joint.
  6. Delete History (Alt + Shift + D) of controller (because history may contains transformation data which will lead to offset issue).
  7. Move the controller to the target joint (or Match All Transforms), tweak the rotation of controller if needed.
  8. Setup the hierarchy of controllers.

    Don’t tweak the transformation (included pivot position and pivot orientation) of controller after setting up the hierarchy. If have to modify transformation, unparent the controller first, then tweak it, setup hierarchy again at last.
    Because the modification to controller’s transformation affects the Offset Parent Matrix of self and child node, which will lead to deformation on joints is the subsequent flow.

  9. Match Pivots from FK controllers to the FK joints.
  10. Do Offset Parent Matrix for all FK joints and all FK controllers.
  11. Create IK FK switch for spine joints, and turn on the FK on all spine constraints, turn off IK on them.
  12. Connect pelvis FK controller’s World Matrix to the Offset Parent Matrix of pelvis_fk joint in Node Edtior.
  13. Connect translate and rotate between spine FK controllers and spine FK joints in Node Editor.

If the controller moved away when you connected controler’s World Matrix to the Offset Parent Matrix of target joint even you have done the steps aboves, check the transformation of parent node if has been zeroed and normalized.

Now you can drive the FK (both FK joints and original joints) using FK controller.

Caution to Controller Pivot

Sometimes we have to modify the transformation of controller’s pivot for better visualization, but this will lead to translation or rotation issue on joints when driven joint using controller.

Following steps are the standard flow to building controller that the pivot had been modified:

1, Adjust the controller’s pivot.

Don’t forget to enable Bake Pivot Rrientation.

2, Unparent the controller if you have set up hierarchy.

We can’t reset Pivots (Local Space and World Space) of controller if controller was placed in hierarchy and the transformation of it’s parent node isn’t zero.
So unparent the controller from parent node to make sure it was placed in world space.

3, Reset the Offset Parent Matrix if it had been modified before.

4, Move the controller to the origin of coordinate axes (world space).

5, Reset Transformations
Modify -> Reset Transformations.

If pivot moved away after Reset Transformations, that means pivot had modified before, you must tweak the controller (included pivot’s position and orientation, controller’s rotation) again manually, then move the controller to the origin of coordinate axes (world space) again.
For more details, see:

6, Freeze Transformations

7, Match Translation: Modify -> Match Transformations -> Match Translation.

8, Match Pivot.
You will see the orientation of pivots between controller and the joint isn’t matched.

Modify -> Match Transformations -> Match Pivots.
Now the orientation of pivot is matched.

9, Offset Parent Matrix to controller and joint.

10, Build the connection in Node Editor.

Finally we can drive the joint using controller.

Zero the Local Space and World Space of Pivot

You might want to tweak the pivot’s position for controller, as shown in following image, left is the controller’s original pivot, right is the target pivot you want.

But after you have modified the pivot position, the Local Space and World Space of pivot was dirty. It's dangerous because it will lead to deformation on joint in the subsequent flow (drive joint from controller using Offset Parent Matrix).

To address this issue, you can move the controller to the origin of coordinate axis of world space, then Freeze Transformations.

Then you can move the controller to the target joint or Match Transformations.

Keep in mind that the Local Space and World Space of pivot must be zeroed when controller was placed in the origin of coordinate axis of world space.
If they’re not zeroed, Reset Transformations on controller, and then tweak you controller (included pivot) again.

FBX Importer: How to import multiple skinned meshes with independent skeleton (not share skeleton)

File -> Import Options

Dual Quaternion Skinning (UE5 support)

This is not advertised almost anywhere; people have resorted to using engine forks just for this feature.

Get Content Examples, and you’ll find it in action in the AnimationDeformer level.

The deformer asset itself is at ExampleContent/AnimationDeformer/AnimBlueprints/DG_DualQuatDeformerDemo.

Origin: UE5 has dual quaternion skinning
https://landelare.github.io/2023/10/10/dual-quaternion-skinning.html

Segment Scale Compensate

If Freeze Transformations on joints:

Then the Segment Scale Compensate will be turned on automatically, and it might lead to translation or rotation issue when import into game engine, e.g. Unity, Unreal.

Script to disable Segment Scale Compensate for all joints.

string $sel[] = `ls -sl`;
string $singleJnt;
for ($singleJnt in $sel)
{
setAttr ($singleJnt + ".segmentScaleCompensate") 0;
}

战国战争史:齐魏桂陵之战
桂陵之战是历史上一次著名截击战,发生在桂陵。(一说山东菏泽东北,一说河南长垣西北)。公元前354年(周显王十五年),魏围攻赵都邯郸,次年赵向齐求救。齐王命田忌、孙膑率军援救。孙膑认为魏以精锐攻邯郸,国内空虚,于是率军围攻魏都大梁,使魏将庞涓赶回应战。孙膑却在桂陵(一说山东菏泽,一说河南长垣)伏袭,打败魏军,并生擒庞涓。孙膑在此战中避实击虚、攻其必救,创造了“围魏救赵”战法,成为两千多年来军事上诱敌就范的常用手段。