Mel Keyboard and Snippets

From bernie's
Jump to navigation Jump to search

Existing Shortcuts

  • ctrl-alt-c: copy skin weights
  • ctrl-alt-v: paste skin weights

select similar to current

$nt = nodeType(`ls -sl -tl 1`);
select -r `ls -typ $nt`;

shuffle thru all cameras

string $panel = `getPanel -withFocus`;
string $curCam = `lookThru -q`;
string $curCamShapes[] = `listRelatives -s $curCam`;
$curCamShapes[0] = ($curCamShapes[0]=="")?$curCam:$curCamShapes[0];
string $cameras[] = `ls -typ "camera"`;
int $index = stringArrayFind($curCamShapes[0], 0, $cameras );
int $numCams = (size($cameras)-4);
$index = ($index+1)%$numCams;
lookThru $panel $cameras[$index];
$camObj = `listRelatives -p $cameras[$index]`;
headsUpMessage($camObj[0]+" - "+$index+"/"+$numCams);

ctrl-shift-i

de-isolate selection

string $panel = `getPanel -withFocus`;
isolateSelect -state 0 $panel;

Look Thru Selection

//look thru selection
string $panel = `getPanel -withFocus`;
lookThroughSelected 0 $panel;

Get current cam

string $currentCamera = `lookThru -q`;

Turn thumbnails in hypershade on/off

renderThumbnailUpdate 0;
renderThumbnailUpdate 1;


Cleanup->triangulate->quadrangulate

polyCleanupArgList 3 { "0","2","1","0","1","0","0","0","0","1e-005","0","1e-005","0","1e-005","0","-1","0" };
polyTriangulate -ch 1;
polyQuad  -a 30 -kgb 1 -ktb 1 -khe 1 -ws 1 -ch 1;

Toggle nucleuses on/off

for($n in `ls "nucleus*"`){
setAttr ($n+".enable") ((`getAttr ($n+".enable")`)?0:1);
}

print global variables

string $globalVars[] = `env`;
for($e in $globalVars){
    print("\n---------------------------------------------\n"+$e+":\n");
    eval("print "+$e);
}