MEL: Look through a light
Here’s a MEL procedure that opens a light or a camera in a new window
Usage: lookThrough( `ls -sl` );
proc lookThrough( string $selection[] ) {
string $shapeType[] = `listRelatives -shapes $selection[0]`;
string $type = nodeType( $shapeType[0] );
if ( $type == "spotLight" || $type == "areaLight" || $type == "volumeLight" || $type == "camera" || $type == "directionalLight" ) {
string $wndName = "";
string $cmdStr;
string $whichPanel = `getPanel -withLabel $selection[0]`;
string $panelType = "modelPanel";
string $panelLabel = $selection[0];
$wndName = $whichPanel + "Window";
if ("" != $whichPanel) {
if (`panel -q -to $whichPanel`) {
showWindow $wndName;
}
else {
$cmdStr = ($panelType + " -e -to " + $whichPanel);
eval $cmdStr;
}
}
else {
$cmdStr = ($panelType + " -l \""+ $panelLabel +"\" -to;");
eval $cmdStr;
$whichPanel = `getPanel -withLabel $selection[0]`;
}
lookThru $whichPanel $selection[0];
}
}
No comments yet