« Welcome | Home | Save Our Soho »
MEL: Look through Light or Camera
By nikos | May 14, 2008
As a Lighting TD I find myself often having to look through different lights to position them correctly in the scene. Here’s a MEL procedure for opening the light (or camera) in a seperate 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];
-
}
-
}
Topics: Maya | No Comments »
Comments are closed.