3D Rigging: Difference between revisions
Karljahnke (talk | contribs) |
Karljahnke (talk | contribs) |
||
| (24 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
= Maya Rigging Concepts = | = Maya Rigging Concepts = | ||
Introduction | Introduction | ||
| Line 8: | Line 10: | ||
== MEL scripts == | == MEL scripts == | ||
Usage demo for CV Curve Duplication and Quick Parent Constraints. | |||
[[http://sillydragon.com/USA_Demo/Maya_MEL_Script_Demo_Dupe_and_Parent.mp4 Demo on usage of scripts]] | |||
===[[Primitive Maya CV Curves]]=== | |||
Link to MEL script library to create useful primitive CV curves: | |||
[[Primitive Maya CV Curves]] | |||
=== Quick Curve Duplication For Joints === | |||
Control curve duplication and place at selected joints pivot center | Control curve duplication and place at selected joints pivot center | ||
Usage: Select all the joints you want to duplicate a curve and place at the joints center, then select the curve which you want to duplicate last. Then execute the script. I recommend placing this script as a shelf tool. | Usage: Select all the joints you want to duplicate a curve and place at the joints center, then select the curve which you want to duplicate last. Then execute the script. I recommend placing this script as a shelf tool. | ||
<pre> | <pre> | ||
// Get selection in order | // Get selection in order | ||
| Line 47: | Line 63: | ||
</pre> | </pre> | ||
=== Quick Parent Constraints === | |||
Parent constraints applied to joints en masse. | Parent constraints applied to joints en masse. | ||
| Line 78: | Line 96: | ||
</pre> | </pre> | ||
== Parent Constraint == | |||
===Alternative Quick Parent Constraint Using Distance === | |||
Similar to the above quick parent constraint, instead of using the ordered selection method, the script takes the distance between the joint and the curve into account and applies the constraint based on the closest pair. | |||
<pre> | |||
// Get selection | |||
string $sel[] = `ls -sl`; | |||
string $curves[]; | |||
string $joints[]; | |||
// Separate curves and joints | |||
for ($obj in $sel) | |||
{ | |||
string $type = `nodeType $obj`; | |||
if ($type == "joint") | |||
{ | |||
$joints[size($joints)] = $obj; | |||
} | |||
else | |||
{ | |||
// Accept transform nodes with curve shapes | |||
string $shapes[] = `listRelatives -s $obj`; | |||
if (size($shapes) > 0 && `nodeType $shapes[0]` == "nurbsCurve") | |||
{ | |||
$curves[size($curves)] = $obj; | |||
} | |||
} | |||
} | |||
// Validation | |||
if (size($curves) == 0 || size($joints) == 0) | |||
{ | |||
warning "Selection must contain at least one curve and one joint."; | |||
} | |||
else | |||
{ | |||
// Loop through curves | |||
for ($curve in $curves) | |||
{ | |||
vector $curvePos = `xform -q -ws -t $curve`; | |||
float $minDist = 1e10; | |||
string $closestJoint = ""; | |||
// Compare against all joints | |||
for ($joint in $joints) | |||
{ | |||
vector $jointPos = `xform -q -ws -t $joint`; | |||
vector $diff = $curvePos - $jointPos; | |||
float $dist = mag($diff); | |||
if ($dist < $minDist) | |||
{ | |||
$minDist = $dist; | |||
$closestJoint = $joint; | |||
} | |||
} | |||
// Apply constraint | |||
if ($closestJoint != "") | |||
{ | |||
parentConstraint -mo $curve $closestJoint; | |||
} | |||
} | |||
} | |||
</pre> | |||
===Quickly Create Cluster Deformers on a NURBS curve/Spline=== | |||
Use this script to speed up creating Spline IK rigs. Once the Spline IK Curve is created, select the curve and run this script. | |||
Select the curve you want to apply cluster deformers to, then run the script. | |||
<pre> | |||
string $sel[] = `ls -sl -type transform`; | |||
if (size($sel) != 1) | |||
{ | |||
error "Please select exactly one NURBS curve."; | |||
} | |||
string $curve = $sel[0]; | |||
string $shapes[] = `listRelatives -shapes -noIntermediate $curve`; | |||
if (size($shapes) == 0 || `nodeType $shapes[0]` != "nurbsCurve") | |||
{ | |||
error "The selected object must be a NURBS curve."; | |||
} | |||
string $shape = $shapes[0]; | |||
// Number of CVs on the curve. | |||
int $spans = `getAttr ($shape + ".spans")`; | |||
int $degree = `getAttr ($shape + ".degree")`; | |||
int $numCVs = $spans + $degree; | |||
// Create a cluster for every CV. | |||
for ($i = 0; $i < $numCVs; $i++) | |||
{ | |||
string $cv = ($curve + ".cv[" + $i + "]"); | |||
// Get the CV's world-space position. | |||
float $pos[] = `xform -q -ws -t $cv`; | |||
// Create cluster affecting only this CV. | |||
string $cluster[] = `cluster -relative $cv`; | |||
if (size($cluster) >= 2) | |||
{ | |||
// Maya returns the handle and cluster node. | |||
string $handle = $cluster[0]; | |||
string $deformer = $cluster[1]; | |||
// Rename them. | |||
$handle = `rename $handle ("cluster_" + $i + "_handle")`; | |||
$deformer = `rename $deformer ("cluster_" + $i)`; | |||
// Snap the handle to the CV. | |||
xform -ws -t $pos[0] $pos[1] $pos[2] $handle; | |||
} | |||
} | |||
select $curve; | |||
print ("Created and positioned " + $numCVs + | |||
" clusters on " + $curve + ".\n"); | |||
</pre> | |||
==Parent Constraint == | |||
[[https://sillydragon.com/USA_Demo/Maya_Rigging_Constraints_Parent.mp4 Maya – Parent Constraint ]] | [[https://sillydragon.com/USA_Demo/Maya_Rigging_Constraints_Parent.mp4 Maya – Parent Constraint ]] | ||
== Point Constraint == | ==Point Constraint == | ||
[[https://sillydragon.com/USA_Demo/Maya_Rigging_Constraints_Point.mp4 Maya – Point Constraint]] | [[https://sillydragon.com/USA_Demo/Maya_Rigging_Constraints_Point.mp4 Maya – Point Constraint]] | ||
== Orient Constraint == | ==Orient Constraint == | ||
[[https://sillydragon.com/USA_Demo/Maya_Rigging_Constraints_Orient.mp4 Maya – Orient Constraint]] | [[https://sillydragon.com/USA_Demo/Maya_Rigging_Constraints_Orient.mp4 Maya – Orient Constraint]] | ||
== Aim Constraint == | ==Aim Constraint == | ||
[[http://sillydragon.com/USA_Demo/Maya_Rigging_Constraints_Aim.mp4 Maya – Aim Constraint]] | [[http://sillydragon.com/USA_Demo/Maya_Rigging_Constraints_Aim.mp4 Maya – Aim Constraint]] | ||
== Pole Vector == | ==Pole Vector == | ||
[[http://sillydragon.com/USA_Demo/Maya_Rigging_Constraints_Pole_Vector.mp4 Maya – Pole Vector Constraint]] | [[http://sillydragon.com/USA_Demo/Maya_Rigging_Constraints_Pole_Vector.mp4 Maya – Pole Vector Constraint]] | ||
==Cluster Deformer== | |||
[[http://sillydragon.com/USA_Demo/Maya_Cluster_Deformer_Introduction.mp4 Maya - Cluster Deformer]] | |||
= Maya Rigging Assignment Demonstrations = | = Maya Rigging Assignment Demonstrations = | ||
| Line 96: | Line 238: | ||
[[http://sillydragon.com/USA_Demo/Maya_Rigging_Unicycle.mp4 Maya – Rigging a Unicycle]] | [[http://sillydragon.com/USA_Demo/Maya_Rigging_Unicycle.mp4 Maya – Rigging a Unicycle]] | ||
==Toothbrush Rig Demo== | |||
[[http://sillydragon.com/USA_Demo/rigs/toothbrush_2026.ma Download of Maya Toothbrush File]] | |||
[[http://sillydragon.com/USA_Demo/Maya_Rigging_Toothbrush.mp4 Maya - Rigging a Toothbrush]] | |||
==Bouncing Ball Rig Demo== | |||
[[http://sillydragon.com/USA_Demo/Maya_Rigging_Demonstration_Ball.mp4 Maya - Rigging a Bouncing Ball]] | |||
== Bipedal Character Rigging== | == Bipedal Character Rigging== | ||
| Line 174: | Line 324: | ||
== Cartoon Eye Shader Rig == | == Cartoon Eye Shader Rig == | ||
[[http://sillydragon.com/USA_Demo/Maya_Rigging_CartoonEyesMatteShader.mp4 Maya – Rigging/Shader for Eye Rig]] | [[http://sillydragon.com/USA_Demo/Maya_Rigging_CartoonEyesMatteShader.mp4 Maya – Rigging/Shader for Eye Rig]] | ||
== Cartoon Eye Shader Rig Arnold Material == | |||
[[http://sillydragon.com/USA_Demo/Maya_CartoonEyes_Arnold_Switch.mp4 Maya - Rigging Eye Arnold Material with aiSwitch]] | |||
== Cartoony Noodle Arms == | == Cartoony Noodle Arms == | ||
Latest revision as of 10:05, 20 October 2026
Maya Rigging Concepts
Introduction
[Grouping, Parenting, Combining]
[Maya – Introduction to Joints and Bind Skin]
Maya Rigging Tools
MEL scripts
Usage demo for CV Curve Duplication and Quick Parent Constraints.
Link to MEL script library to create useful primitive CV curves:
Quick Curve Duplication For Joints
Control curve duplication and place at selected joints pivot center
Usage: Select all the joints you want to duplicate a curve and place at the joints center, then select the curve which you want to duplicate last. Then execute the script. I recommend placing this script as a shelf tool.
// Get selection in order
string $sel[] = `ls -sl`;
if (size($sel) < 2)
{
warning "Select one or more joints, then a curve LAST.";
}
else
{
// Last selected object is the curve
string $curve = $sel[size($sel) - 1];
// Validate curve transform
if (`nodeType $curve` != "transform")
{
warning "Last selected object must be a curve transform.";
}
else
{
// Loop through selected joints
for ($i = 0; $i < size($sel) - 1; $i++)
{
string $joint = $sel[$i];
// Skip anything that isn't a joint
if (`nodeType $joint` != "joint")
continue;
// Get joint pivot position (world space)
float $pivot[3] = `xform -q -ws -rp $joint`;
// Duplicate curve
string $dup[] = `duplicate -rr $curve`;
// Move duplicate to joint pivot
xform -ws -t $pivot[0] $pivot[1] $pivot[2] $dup[0];
}
}
}
Quick Parent Constraints
Parent constraints applied to joints en masse.
Usage: Select a control curve which will be the driving constraint, then select the joint to be constrained. Repeat the selection in order, curve then joint, for as many joints are going to be constrained. Then execute the script.
// Get ordered selection
string $sel[] = `ls -sl -o`;
int $count = size($sel);
// Need at least one curve-joint pair
if ($count < 2 || ($count % 2) != 0)
{
warning "Selection must be in pairs: curve, joint, curve, joint, etc.";
}
else
{
// Step through selection two at a time
for ($i = 0; $i < $count; $i += 2)
{
string $curve = $sel[$i];
string $joint = $sel[$i + 1];
// Validate types
if (`nodeType $joint` != "joint")
{
warning ("Skipping pair: " + $curve + " → " + $joint + " (second object is not a joint)");
continue;
}
// Apply parent constraint (curve drives joint)
parentConstraint -mo $curve $joint;
}
}
Alternative Quick Parent Constraint Using Distance
Similar to the above quick parent constraint, instead of using the ordered selection method, the script takes the distance between the joint and the curve into account and applies the constraint based on the closest pair.
// Get selection
string $sel[] = `ls -sl`;
string $curves[];
string $joints[];
// Separate curves and joints
for ($obj in $sel)
{
string $type = `nodeType $obj`;
if ($type == "joint")
{
$joints[size($joints)] = $obj;
}
else
{
// Accept transform nodes with curve shapes
string $shapes[] = `listRelatives -s $obj`;
if (size($shapes) > 0 && `nodeType $shapes[0]` == "nurbsCurve")
{
$curves[size($curves)] = $obj;
}
}
}
// Validation
if (size($curves) == 0 || size($joints) == 0)
{
warning "Selection must contain at least one curve and one joint.";
}
else
{
// Loop through curves
for ($curve in $curves)
{
vector $curvePos = `xform -q -ws -t $curve`;
float $minDist = 1e10;
string $closestJoint = "";
// Compare against all joints
for ($joint in $joints)
{
vector $jointPos = `xform -q -ws -t $joint`;
vector $diff = $curvePos - $jointPos;
float $dist = mag($diff);
if ($dist < $minDist)
{
$minDist = $dist;
$closestJoint = $joint;
}
}
// Apply constraint
if ($closestJoint != "")
{
parentConstraint -mo $curve $closestJoint;
}
}
}
Quickly Create Cluster Deformers on a NURBS curve/Spline
Use this script to speed up creating Spline IK rigs. Once the Spline IK Curve is created, select the curve and run this script.
Select the curve you want to apply cluster deformers to, then run the script.
string $sel[] = `ls -sl -type transform`;
if (size($sel) != 1)
{
error "Please select exactly one NURBS curve.";
}
string $curve = $sel[0];
string $shapes[] = `listRelatives -shapes -noIntermediate $curve`;
if (size($shapes) == 0 || `nodeType $shapes[0]` != "nurbsCurve")
{
error "The selected object must be a NURBS curve.";
}
string $shape = $shapes[0];
// Number of CVs on the curve.
int $spans = `getAttr ($shape + ".spans")`;
int $degree = `getAttr ($shape + ".degree")`;
int $numCVs = $spans + $degree;
// Create a cluster for every CV.
for ($i = 0; $i < $numCVs; $i++)
{
string $cv = ($curve + ".cv[" + $i + "]");
// Get the CV's world-space position.
float $pos[] = `xform -q -ws -t $cv`;
// Create cluster affecting only this CV.
string $cluster[] = `cluster -relative $cv`;
if (size($cluster) >= 2)
{
// Maya returns the handle and cluster node.
string $handle = $cluster[0];
string $deformer = $cluster[1];
// Rename them.
$handle = `rename $handle ("cluster_" + $i + "_handle")`;
$deformer = `rename $deformer ("cluster_" + $i)`;
// Snap the handle to the CV.
xform -ws -t $pos[0] $pos[1] $pos[2] $handle;
}
}
select $curve;
print ("Created and positioned " + $numCVs +
" clusters on " + $curve + ".\n");
Parent Constraint
Point Constraint
Orient Constraint
Aim Constraint
Pole Vector
[Maya – Pole Vector Constraint]
Cluster Deformer
Maya Rigging Assignment Demonstrations
Unicycle Rig Demo
[Download of Maya Unicycle File]
Toothbrush Rig Demo
[Download of Maya Toothbrush File]
Bouncing Ball Rig Demo
[Maya - Rigging a Bouncing Ball]
Bipedal Character Rigging
[Starter Maya File For Bipedal Rig]
[Character Rigging Part 1 – Placing Bones]
[Character Rigging Part 2 – Mirroring Bones]
[Character Rigging Part 3 – Custom Control Curves]
[Character Rigging Part 4 – Creating Leg IK (Left)]
[Character Rigging Part 5 – Creating Leg IK (Right) and Pelvis Controls]
[Character Rigging Part 6 – Creating Spine Controls]
[Character Rigging Part 7 – Creating Hand and Arm Controls]
[Character Rigging Part 8 – Creating Hand and Arm Controls (Right)]
[Character Rigging Part 9 – Fixing Mistakes, Linking Spine to Center of Mass]
[Character Rigging Part 10 – Adding Attributes for Knees and Elbows]
[Character Rigging Part 11 – Blendshape Eyes (Concept)]
[Character Rigging Part 12 – Blendshape Eyes (Left)]
[Character Rigging Part 13 – Blendshape Eyes (Right)]
[Character Rigging Part 14 – Controllers for Brow]
[Character Rigging Part 15 – Binding Skin for the Brow]
[Character Rigging Part 16 – Renaming Bones]
[Character Rigging Part 17 – Bind Skin to the Head]
[Character Rigging Part 18 Bind Skin to the Shoe (Left)]
[Character Rigging Part 19 – Bind Skin to the Shoe (Right)]
[Character Rigging Part 20 – Skin Bind to the Leg (Left)]
[Character Rigging Part 21 – Skin Bind to the Leg (Right)]
[Character Rigging Part 22 – Skin Bind for the Pants]
[Character Rigging Part 23 – Skin Bind for the Shirt]
[Character Rigging Part 24 – Skin Bind for Arm (Left)]
[Character Rigging Part 25 – Skin Bind for Arm (Right)]
Miscellaneous Topics
Using IK for Robot Arms and Legs
[Maya – Rigging – Creating and Using IK Robot’s Arms and Legs]
Solution to Wrist Collapsing
[Solution to wrist collapsing ]
Rig a Flip Flop
[How to Rig Flip Flops and Feet (part 1)]
[How to Rig Flip Flops and Feet (part 2)]
Object/World Controller
[Maya – Object/World Controller]
Controller to Swap Between Objects (pick up/drop objects)
Double Link Look For Alternate Demo Video [[1]]
Mouth Texture Swap
[Maya – Rigging/Shader for Mouth Texture Swap ]
Cartoon Eye Shader Rig
[Maya – Rigging/Shader for Eye Rig]
Cartoon Eye Shader Rig Arnold Material
[Maya - Rigging Eye Arnold Material with aiSwitch]