LinkedIn
Twitter
Vimeo

Hotkeys/Scripts

Default Commands in Maya:

Toggle Playback (MEL)
togglePlayback;
Exists in the Hotkey Editor as well.


Start Timeline Scrub (MEL)
storeLastAction( "restoreLastContext " + `currentCtx` );setToolTo TimeDragger
Exists in the Hotkey Editor as well. After setting the Hotkey you want for it, click the dropdown arrow next to the X and make sure “On Press” is selected

End Timeline Scrub
invokeLastAction
Exists in the Hotkey Editor as well. After setting the Hotkey you want for it, click the dropdown arrow next to the X and make sure “On Release” is selected

Go To First Frame of Timeline (MEL)
currentTime -e `playbackOptions -query -min`
Exists in the Hotkey Editor as well.

Go To Last Frame of Timeline (MEL)
currentTime -e `playbackOptions -query -max`
Exists in the Hotkey Editor as well.

Open Graph Editor (MEL)
GraphEditor;
Exists in the Hotkey Editor as well.

Open Outliner (MEL)
Outliner;
Exists in the Hotkey Editor as well.

Open Hypergraph Hierarchy (MEL)
HypergraphHierarchyWindow;
Exists in the Hotkey Editor as well.

Custom Scripts:

Display:

Toggle Hide Nurbs Curves (MEL)
string $panel = `getPanel -wf`;
modelEditor -e -nurbsCurves (!`modelEditor -q -nurbsCurves $panel`) $panel;
 
$currentPanel = `getPanel -withFocus`;
string $panelType = `getPanel -to $currentPanel`;
if ($panelType == "modelPanel")
{
modelEditor -e -locators ( !`modelEditor -q -locators $currentPanel` ) $currentPanel;
}
updateModelPanelBar $currentPanel;

Toggle XRay For Mesh (MEL)
$currentPanel = `getPanel -withFocus`;
string $panelType = `getPanel -to $currentPanel`;
if ($panelType == "modelPanel")
{
modelEditor -e -xray ( !`modelEditor -q -xray $currentPanel` ) $currentPanel;
}
updateModelPanelBar $currentPanel;

Toggle XRay for Joints/Control Rig (MEL)
$currentPanel = `getPanel -withFocus`;
string $panelType = `getPanel -to $currentPanel`;
if ($panelType == "modelPanel")
{
modelEditor -e -jointXray ( !`modelEditor -q -jointXray $currentPanel` ) $currentPanel;
}
updateModelPanelBar $currentPanel;

Toggle Title Bar (MEL)
$state = !`window -titleBar true $gMainWindow -q`;
window -e -titleBar $state $gMainWindow;

Toggle UI Clutter (MEL)
ToggleStatusLine;
ToggleShelf;
ToggleCommandLine;
ToggleToolbox;
ToggleModelEditorBars;
ToggleOutliner;
$state = !`window -mbv true $gMainWindow -q`;
window -e -mbv $state $gMainWindow;
toggleMenuBarsInPanels $state;

Layers:

Zero Key Active Layer (MEL)
{
string $lLayers[]=getSelectedAnimLayer("AnimLayerTab");
layerEditorZeroKeyAnimLayer($lLayers);
}

Merge All Layers (MEL)
{
animLayerMerge( `ls -type animLayer` );
}

Create Additive Layer From Selected (MEL)
{
string $layername = `animLayer  Additive`;
setAttr ($layername+".ghostColor")18;
setAttr ( $layername + ".rotationAccumulationMode") 0;
setAttr ($layername + ".scaleAccumulationMode") 1;
animLayer -e -addSelectedObjects $layername;
string $Layers[]=getSelectedAnimLayer("AnimLayerTab");
for ($obj in $Layers)
{  animLayerEditorOnSelect $obj 0;  }
animLayerEditorOnSelect $layername 1;
}

Create Override Layer From Selected (MEL)
{
string $layername = `animLayer  Override`;
setAttr ($layername+".ghostColor")19;
setAttr ( $layername + ".rotationAccumulationMode") 0;
setAttr ($layername + ".scaleAccumulationMode") 1;
animLayer -edit -override 1 $layername;
animLayer -e -addSelectedObjects $layername;
string $Layers[]=getSelectedAnimLayer("AnimLayerTab");
for ($obj in $Layers)
{  animLayerEditorOnSelect $obj 0;  }
animLayerEditorOnSelect $layername 1;
}

Add Selected to Layer (MEL)
{
string $lSelection[]=`ls -selection`;
string $addToLyr[] = getSelectedAnimLayer("AnimLayerTab");
 
layerEditorAddObjectsAnimLayer($lSelection, $addToLyr, 0);
}

Select Objects in Layer (MEL)
{
string $layers[] = getSelectedAnimLayer("AnimLayerTab");
layerEditorSelectObjectAnimLayer($layers);
}

Bake Selected Onto An Override Layer (MEL)
{
string $topLayer = `animLayer "Baked_Override"`;
animLayer -edit -override true $topLayer;
setAttr ($topLayer+".ghostColor")19;
 
string $Layers[]=getSelectedAnimLayer("AnimLayerTab");
for ($obj in $Layers)
{  animLayerEditorOnSelect $obj 0;  }
animLayerEditorOnSelect $topLayer 1;
 
string $selection[] = `ls -sl`;
 
float $start = `playbackOptions -query -min`;
float $end = `playbackOptions -query -max`;
int $freq = 1;
int $last;
 
ogs -pause;
refresh -su on;
 
bakeResults -simulation true -t ($start+":"+$end)
-sampleBy $freq
-disableImplicitControl true
-destinationLayer $topLayer
-preserveOutsideKeys true
-sparseAnimCurveBake false
-removeBakedAttributeFromLayer false
-bakeOnOverrideLayer true
-minimizeRotation true
-controlPoints false
-shape true
$selection;
 
filterCurve;
refresh -su off;
ogs -pause;
 
// Find and goto last frame
string $lastFrame = `playbackOptions -query -max`;
currentTime $lastFrame;
 
// Set a zero key
string $lLayers[]=getSelectedAnimLayer("AnimLayerTab");
layerEditorZeroKeyAnimLayer($lLayers);
}

Timeline Controls:

Copy Next Key (MEL)
{
copyKey -t (`findKeyframe -timeSlider -which next`);
pasteKey -t `currentTime -query`;
}

Copy Previous Key (MEL)
{
copyKey -t (`findKeyframe -timeSlider -which previous`);
pasteKey -t `currentTime -query`;
}

Copy Key From Timeline (MEL)
timeSliderCopyKey;

Paste Key From Timeline (MEL)
timeSliderPasteKey false;

Delete Key From Timeline (MEL)
timeSliderClearKey;

Add Inbetween (MEL)
timeSliderEditKeys addInbetween;

Remove Inbetween (MEL)
timeSliderEditKeys removeInbetween;

Bake Keys (MEL)
ogs -pause;
refresh -su on;
performBakeSimulation( 0 );
delete -sc;
filterCurve;
refresh -su off;
ogs -pause;

Frame Your Selected Red Frame Range on the Timeline (MEL)
$start = `playbackOptions  -q -minTime`;
$end = `playbackOptions -q -maxTime`;
 
setPlaybackRangeToHighlight;

Reset Frame Range (MEL)
playbackOptions -minTime $start;
playbackOptions -maxTime $end;

Selection:

Cycle Rotation Order (MEL)
{
RotateTool;
int $RotateStyle = `manipRotateContext -q -mode Rotate`;
 
switch ($RotateStyle)
{
case 0:
headsUpMessage ("World");
manipRotateContext -e -mode 1 Rotate;
break;
 
case 1:
headsUpMessage ("Gimbal");
manipRotateContext -e -mode 2 Rotate;
break;
 
case 2:
headsUpMessage ("Local");
manipRotateContext -e -mode 0 Rotate;
break;
 
default:
headsUpMessage ("Gimbal");
manipRotateContext -e -mode 1 Rotate;
break;
}
 
}

Cycle Translation Order (MEL)
{
MoveTool;
int $MoveStyle = `manipMoveContext -q -mode Move`;
 
switch ($MoveStyle)
{
case 4:
headsUpMessage ("World");
manipMoveContext -e -mode 2 Move;
break;
 
case 2:
headsUpMessage ("Local");
manipMoveContext -e -mode 1 Move;
break;
 
case 1:
headsUpMessage ("Object");
manipMoveContext -e -mode 4 Move;
break;
 
default:
headsUpMessage ("World");
manipMoveContext -e -mode 2 Move;
break;
}
}

Reset Rotations On Selected (MEL)
string $array[] = `ls -sl`;
for ($item in $array) {
setAttr ($item + ".rotateX") 0;
setAttr ($item + ".rotateY") 0;
setAttr ($item + ".rotateZ") 0;
}

Reset Translation on Selected (MEL)
string $array[] = `ls -sl`;
for ($item in $array) {
setAttr ($item + ".translateX") 0;
setAttr ($item + ".translateY") 0;
setAttr ($item + ".translateZ") 0;
}

Snap Selected to Another Object (MEL)
string $sel[] = `ls -sl`;
$driver = $sel[0];
$driven = $sel[1];
 
if (`getAttr -l ($sel[1]+".rotateX")` == true) {
string $pointCons[] = `pointConstraint -w 1 $driver $driven`;
refresh;
 
float $tx = `getAttr ($sel[1]+".translateX")`;
float $ty = `getAttr ($sel[1]+".translateY")`;
float $tz = `getAttr ($sel[1]+".translateZ")`;
 
delete $pointCons;
 
setAttr ($sel[1]+".translateX") $tx;
setAttr ($sel[1]+".translateY") $ty;
setAttr ($sel[1]+".translateZ") $tz;
}
else {
string $parentCons[] = `parentConstraint -w 1 $driver $driven`;
refresh;
 
float $tx = `getAttr ($sel[1]+".translateX")`;
float $ty = `getAttr ($sel[1]+".translateY")`;
float $tz = `getAttr ($sel[1]+".translateZ")`;
float $rx = `getAttr ($sel[1]+".rotateX")`;
float $ry = `getAttr ($sel[1]+".rotateY")`;
float $rz = `getAttr ($sel[1]+".rotateZ")`;
 
delete $parentCons;
 
setAttr ($sel[1]+".translateX") $tx;
setAttr ($sel[1]+".translateY") $ty;
setAttr ($sel[1]+".translateZ") $tz;
setAttr ($sel[1]+".rotateX") $rx;
setAttr ($sel[1]+".rotateY") $ry;
setAttr ($sel[1]+".rotateZ") $rz;
}
 
setKeyframe -breakdown 0 -hierarchy none -controlPoints 0 -shape 0 {$sel[1]};

Run Euler Filter (MEL)
{
string $A[] = `ls -sl`;
performEulerFilter graphEditor1FromOutliner;
filterCurve $A.rotateZ $A.rotateY $A.rotateX;
}

Constraints:

Parent Consraint With Offset (MEL)
doCreateParentConstraintArgList 1 { "1","0","0","0","0","0","0","1","","1" };
parentConstraint -mo -weight 1;

Parent Consraint With No Offset (MEL)
doCreateParentConstraintArgList 1 { "0","0","0","0","0","0","0","1","","1" };
parentConstraint -weight 1;

Point Consraint With Offset (MEL)
doCreatePointConstraintArgList 1 { "1","0","0","0","0","0","0","1","","1" };
pointConstraint -mo -weight 1;

Orient Consraint With Offset (MEL)
doCreateOrientConstraintArgList 1 { "1","0","0","0","0","0","0","1","","1" };
orientConstraint -mo -weight 1;

Point and Orient Consraint With No Offset (MEL)
doCreatePointConstraintArgList 1 { "0","0","0","0","0","0","0","1","","1" };
pointConstraint -offset 0 0 0 -weight 1;
doCreateOrientConstraintArgList 1 { "0","0","0","0","0","0","0","1","","1" };
orientConstraint -offset 0 0 0 -weight 1;

Cameras:

Create Orthographic Cameras (MEL)
{
{
string $bottom[] = `camera -n bottom`; viewSet -bo $bottom[0];
rename "bottom1" "bottom";
hide bottom;
}
 
{
string $left[] = `camera -n left`; viewSet -ls $left[0];
rename "left1" "left";
hide left;
}
 
{
string $right[] = `camera -n right`; viewSet -rs $right[0];
rename "right1" "right";
hide right;
}
 
{
string $back[] = `camera -n back`; viewSet -b $back[0];
rename "back1" "back";
hide back;
}
}

Toggle Switch Between Front and Back Cameras (MEL)
string $currentPanel = `getPanel -withFocus`;
string $cam = `modelPanel -q -cam $currentPanel`;
if($cam == "front" || $cam == "back"){
$cam = ($cam == "front")? "back" : "front";
}else{
$cam = ($cam == "front")? "back" : "front";   
}
modelPanel -e -cam $cam $currentPanel;

Toggle Switch Between Left and Right Cameras (MEL)
string $currentPanel = `getPanel -withFocus`;
string $cam = `modelPanel -q -cam $currentPanel`;
if($cam == "left" || $cam == "right"){
$cam = ($cam == "left")? "right" : "left";
}else{
$cam = ($cam == "left")? "right" : "left";   
}
modelPanel -e -cam $cam $currentPanel;

Toggle Switch Between Top and Bottom Cameras (MEL)
string $currentPanel = `getPanel -withFocus`;
string $cam = `modelPanel -q -cam $currentPanel`;
if($cam == "front" || $cam == "back"){
$cam = ($cam == "front")? "back" : "front";
}else{
$cam = ($cam == "front")? "back" : "front";   
}
modelPanel -e -cam $cam $currentPanel;

Switch To Perspective (MEL)
dR_DoCmd("viewPersp")

Graph Editor:

Did you know that you can have Hotkeys in just the Graph Editor? In the Hot Key Editor, switch the dropdown menu for”Edit Hotkeys For:” to “Editors” and then next dropdown menu to “Graph Editor.” This is really great for quckly changing tangent types, making sure Copy/Paste is set, or even creating a new Delete Key so that you don’t have to reach across the keyboard.