3D Animation (Character): Difference between revisions

From Animation
Jump to navigationJump to search
Line 42: Line 42:
button - label "SET KEY BLOCK" -command "setKeyframe -itt linear -ott step";
button - label "SET KEY BLOCK" -command "setKeyframe -itt linear -ott step";
showWindow;
showWindow;
</pre>
Mirror/swap control curves transforms. Good for swapping hands and feet to alternate mirror positions, like in a copied walkcycle pose.
Usage: Select a control curve (like a left hand), then select the alternate control curve (like a right hand), then execute the script.
<pre>
// Get ordered selection
string $sel[] = `ls -sl -o`;
if (size($sel) != 2)
{
    warning "Select exactly two curvs.";
}
else
{
    string $curveA = $sel[0];
    string $curveB = $sel[1];
    // --------------------------------
    // Store LOCAL transforms (vector attrs)
    // --------------------------------
    float $posA[] = `getAttr ($curveA + ".translate")`;
    float $rotA[] = `getAttr ($curveA + ".rotate")`;
    float $sclA[] = `getAttr ($curveA + ".scale")`;
    float $posB[] = `getAttr ($curveB + ".translate")`;
    float $rotB[] = `getAttr ($curveB + ".rotate")`;
    float $sclB[] = `getAttr ($curveB + ".scale")`;
    // --------------------------------
    // Apply MIRRORED A → B (local space)
    // --------------------------------
    setAttr ($curveB + ".translate")
        (-$posA[0]) $posA[1] $posA[2];
    setAttr ($curveB + ".rotate")
        $rotA[0] (-$rotA[1]) (-$rotA[2]);
    setAttr ($curveB + ".scale")
        $sclA[0] $sclA[1] $sclA[2];
    // --------------------------------
    // Apply MIRRORED B → A (local space)
    // --------------------------------
    setAttr ($curveA + ".translate")
        (-$posB[0]) $posB[1] $posB[2];
    setAttr ($curveA + ".rotate")
        $rotB[0] (-$rotB[1]) (-$rotB[2]);
    setAttr ($curveA + ".scale")
        $sclB[0] $sclB[1] $sclB[2];
}
</pre>
</pre>

Revision as of 13:08, 23 December 2025

Maya Character Rigs

Ball With Tail Rig for beginnings in character animation

[Ball with Tail]

Below is a extremely dated version of a Unicycle Rig. I would do a lot of the elements differently now.

[Unicycle Rig 2018]

Floursack built to be animated strictly FK. Excellent tool to teach Step Key and block animation techniques.

[FlourSack Character Rig 2024]

Beginning rig for learning walkcycles and other animation fundamentals.

[Humanoid stick character with just legs]

3D Stickman character with index finger and group fingers. Solid beginning for animating humanoid characters without the need for dialogue.

[Bipedal humanoid stick character]

Helpful MEL Scripts

Karl's Key Framer Helper

The MEL script below creates a floating window to help with character animation.

Extremely helpful for those indidviduals who are "clickers" instead of those who love keyboard shortcuts.

global string $select[];
$select = {"placeHolder", "otherPlaceHolder"};
window -resizeToFitChildren 1 KarlsCharacterKeyFramer;
columnLayout;
text -label "Make those keyframes";
button - label "Copy keyframes" -command "timeSliderCopyKey";
button - label "Paste keyframes" -command "timeSliderPasteKey false";
button - label "Delete keyframes" -command "timeSliderClearKey";
button - label "Gizmo Object" -command "manipRotateContext -e -mode 0 Rotate; manipMoveContext -e -mode 0 Move";
button - label "Gizmo World" -command "manipRotateContext -e -mode 1 Rotate; manipMoveContext -e -mode 2 Move";
button - label "Graph Editor" -command "GraphEditor";
button - label "Store Selection" -command "$select = `ls -sl`";
button - label "Get Selection" -command "select -r $select";
button - label "SET KEY" -command "setKeyframe";
button - label "SET KEY BLOCK" -command "setKeyframe -itt linear -ott step";
showWindow;

Mirror/swap control curves transforms. Good for swapping hands and feet to alternate mirror positions, like in a copied walkcycle pose.

Usage: Select a control curve (like a left hand), then select the alternate control curve (like a right hand), then execute the script.

// Get ordered selection
string $sel[] = `ls -sl -o`;
if (size($sel) != 2)
{
    warning "Select exactly two curvs.";
}
else
{
    string $curveA = $sel[0];
    string $curveB = $sel[1];
    // --------------------------------
    // Store LOCAL transforms (vector attrs)
    // --------------------------------
    float $posA[] = `getAttr ($curveA + ".translate")`;
    float $rotA[] = `getAttr ($curveA + ".rotate")`;
    float $sclA[] = `getAttr ($curveA + ".scale")`;

    float $posB[] = `getAttr ($curveB + ".translate")`;
    float $rotB[] = `getAttr ($curveB + ".rotate")`;
    float $sclB[] = `getAttr ($curveB + ".scale")`;
    // --------------------------------
    // Apply MIRRORED A → B (local space)
    // --------------------------------
    setAttr ($curveB + ".translate")
        (-$posA[0]) $posA[1] $posA[2];
    setAttr ($curveB + ".rotate")
        $rotA[0] (-$rotA[1]) (-$rotA[2]);
    setAttr ($curveB + ".scale")
        $sclA[0] $sclA[1] $sclA[2];
    // --------------------------------
    // Apply MIRRORED B → A (local space)
    // --------------------------------
    setAttr ($curveA + ".translate")
        (-$posB[0]) $posB[1] $posB[2];
    setAttr ($curveA + ".rotate")
        $rotB[0] (-$rotB[1]) (-$rotB[2]);
    setAttr ($curveA + ".scale")
        $sclB[0] $sclB[1] $sclB[2];
}