/* DCG LIGHTER Description: This script generates a toolset used to ease the setup and process of lighting a scene in Autodesk Maya. To Use: - Source the script. - Run the procedure: dcg_lighter_MainGUI() Author: Dorien Gunnels Last Update: 11-12-09 */ //Initialize Global Variables print ("//-----DCG LIGHTER: SETTING GLOBAL VARIABLES-----//\n"); global int $dcg_lighter_globalVar_warningVerbosityLevel; $dcg_lighter_globalVar_warningVerbosityLevel = 2; print ("//----- $dcg_lighter_globalVar_warningVerbosityLevel = " + $dcg_lighter_globalVar_warningVerbosityLevel + "\n"); global int $dcg_lighter_globalVar_autoLookThroughSelectedON; $dcg_lighter_globalVar_autoLookThroughSelectedON = 0; print ("//----- $dcg_lighter_globalVar_autoLookThroughSelectedON = " + $dcg_lighter_globalVar_autoLookThroughSelectedON + "\n"); global int $dcg_lighter_globalVar_printVerbosityLevel; $dcg_lighter_globalVar_printVerbosityLevel = 0; print ("//----- $dcg_lighter_globalVar_warningVerbosityLevel = " + $dcg_lighter_globalVar_printVerbosityLevel + "\n"); global int $dcg_lighter_globalVar_scriptJobALTSNumber; //ScriptJobs will probably never reach this number, used for "off state" of the job $dcg_lighter_globalVar_scriptJobALTSNumber = 123456789; print ("//----- $dcg_lighter_globalVar_scriptJobALTSNumber = " + $dcg_lighter_globalVar_scriptJobALTSNumber + "\n"); //-----PROCEDURES-----\\ /* ||--Look Through Selected Light--|| Description: This procedure uses looks through a selected light using the GUI's modelEditor. --If no light is selected, a warning message is given. --If more than one light is selected, the script will look through the first light that was selected. --If other objects are selected as well as lights, the script will filter the selection and only look through the light. --If many object and many lights are selected, the object are filtered out and the first light is looked through. Arguements: $dcg_lighter_globalVar_warningVerbosityLevel - global int - This value sets which warnings will be displayed. Set in "Verbosity" menu. - 0 - No warnings will be displayed. - 1 - Warnings used by any automated features (ex. "Auto Look Through Light") will not be displayed. - 2 - All warnings are displayed $dcg_lighter_globalVar_autoLookThroughSelectedON - global int - This value checks for the status of the "Auto Look Through Light" checkBox. - 0 - checkBox is off - 1 - checkBox is on $dcg_lighter_globalVar_printVerbosityLevel - global int - This value sets whether or not print statements showing process feedback will be displayed in the script editor. - 0 - No feedback will be given - 1 - Print statements will be displayed. Maya Prodedures used: lookThroughModelPanelClipped - Found in: lookThroughModelPanelClipped.mel - Arguements: object - name of the object to look through panelName - name of the panel to look though object in nearClip - near clipping plane value farClip - far clipping plane value */ global proc dcg_lighter_lookThroughSelectedInModelPanel( int $dcg_lighter_globalVar_warningVerbosityLevel, int $dcg_lighter_globalVar_autoLookThroughSelectedON, int $dcg_lighter_globalVar_printVerbosityLevel) { global int $dcg_lighter_globalVar_warningVerbosityLevel; //Define global variables global int $dcg_lighter_globalVar_printVerbosityLevel; global int $dcg_lighter_globalVar_autoLookThroughSelectedON; string $lights[] = `ls -selection -dagObjects -lights`; //Make a list of all lights in selection and store them under an array called $lights if ( !(size($lights) > 0) ) //Check the size of the $lights array... if the size is 0, there are no selected lights. { if ( $dcg_lighter_globalVar_warningVerbosityLevel > 1) { warning "DCG Lighter: No light selected!"; } } else { if ( size($lights) > 1 ) { if ( $dcg_lighter_globalVar_warningVerbosityLevel > 1) { warning ("More than one light selected. Looking through " + $lights[0]); } } string $selectedLight = $lights[0]; if ($dcg_lighter_globalVar_printVerbosityLevel == 1) { print ("//-----DCG Lighter: looking through: " + $selectedLight + "\n"); } if (!`window -exists dcg_lighter_GUI_lightLooker`) //If "Light Looker" window is not open, open it. { dcg_lighter_lightLookerGUI($dcg_lighter_globalVar_printVerbosityLevel); } lookThroughModelPanelClipped( $selectedLight, "dcg_lighter_guiElem_modelPanel_lightLooker", .001, 1000 ); //Maya procedure (see above description) } } /* ||--Light-Dropper Procedure--|| Description: This procedure creates a light (specified by pressing the light-specific button in the GUI), assigns it the same translation and rotation value as the primary perspective camera, and looks through the light using the modelPanel created in the GUI. Arguements: - $lightTypeFromGUI - int - Each light type button in the GUI is assigned a number. This number will be interpreted to create that type of light. - 1 = Ambient Light - 2 = Directional Light - 3 = Point Light - 4 = Spot Light - 5 = Area Light - 6 = Volume Light - $dcg_lighter_globalVar_printVerbosityLevel - int - Global variable that allows/Disallows print statement feedback. - 0 = No feedback - 1 = Allow feedback */ global proc dcg_lighter_lightDropper(int $lightTypeFromGUI, int $dcg_lighter_globalVar_printVerbosityLevel, string $optionMenuGrp) { global int $dcg_lighter_globalVar_warningVerbosityLevel; global int $dcg_lighter_globalVar_autoLookThroughSelectedON; global int $dcg_lighter_globalVar_printVerbosityLevel; switch ($lightTypeFromGUI) // 1) Interpret $lightTypeFromGUI into a usable MEL command { case 1: string $lightType = "defaultAmbientLight(1, 0.45, 1,1,1, \"0\", 0,0,0, \"1\");"; break; case 2: string $lightType = "defaultDirectionalLight(1, 1,1,1, \"0\", 0,0,0, 0);"; break; case 3: string $lightType = "defaultPointLight(1, 1,1,1, 0, 0, 0,0,0, 1);"; break; case 4: string $lightType = "defaultSpotLight(1, 1,1,1, 0, 40, 0, 0, 0, 0,0,0, 1, 0);"; break; case 5: string $lightType = "defaultAreaLight(1, 1,1,1, 0, 0, 0,0,0, 1, 0);"; break; case 6: string $lightType = "defaultVolumeLight(1, 1,1,1, 0, 0, 0,0,0, 1);"; break; } eval $lightType; int $autoAttributes = `checkBox -query -value dcg_lighter_guiElem_checkbox_useLightAttributesAsDefaults`; if ($autoAttributes = 1) { dcg_lighter_interpretLightAttributes(0); } int $useCamera = `checkBox -query -value dcg_lighter_guiElem_checkBox_placeUsingCamera`; if ( $useCamera == 1) { string $optionMenuGrp_currentItem = `optionMenuGrp -query -value $optionMenuGrp` ; string $cameraTransNode[] = `listRelatives -parent $optionMenuGrp_currentItem`; // 1) Specifically select perspective camera "persp" by name string $perspCamera = $cameraTransNode[0]; // and assign it to $perspCamera if ($dcg_lighter_globalVar_printVerbosityLevel == 1) { print ("//--------DCG Lighter: Dropping light using position of = " + $perspCamera + "\n"); } float $translate[] = `xform -query -translation $perspCamera`; // 2) Query and store the translation data of the persp camera float $rotate[] = `xform -query -rotation $perspCamera`; // 3) Query and store the rotation data of the persp camera if ($dcg_lighter_globalVar_printVerbosityLevel == 1) { print ("//-------DCG Lighter: " + $perspCamera+ " Translate camera = " + $translate[0] + " " + $translate[1] + " " + $translate[2] + "\n"); print ("//-------DCG Lighter: " + $perspCamera + " Rotate camera is " + $rotate[0] + " " + $rotate[1] + " " + $rotate[2] + "\n"); } // 4) Create a volume light move -r $translate[0] $translate[1] $translate[2]; rotate -r $rotate[0] $rotate[1] $rotate[2]; string $lights[] = `ls -selection -dagObjects -lights`; // 5) Select the light string $selectedLight = $lights[0]; float $lightCenterOfIllumination = 45; setAttr ($selectedLight + ".centerOfIllumination") 45; if ($dcg_lighter_globalVar_printVerbosityLevel == 1) { print ("//-------DCG Lighter: Created light = " + $selectedLight + "\n"); print ("//-------DCG Lighter: Set Attribute \"" + $selectedLight + ".centerOfIllumination\" to " + $lightCenterOfIllumination + "\n"); } // as a distance from the light) around which the light rotates // when using the modelPanel. (seen with "Show Manipulator Tool") // 7) Look through the area light } if (`window -exists dcg_lighter_GUI_lightLooker`) { dcg_lighter_lookThroughSelectedInModelPanel( $dcg_lighter_globalVar_warningVerbosityLevel, $dcg_lighter_globalVar_autoLookThroughSelectedON, $dcg_lighter_globalVar_printVerbosityLevel); } } /* Description: Arguements: $nextProc - int - defines the next procedure to execute once the light transform node is found 1 - dcg_lighter_aimLightAtObject */ global proc dcg_lighter_aimLightAtObjectButton() { string $lights[] = `ls -selection -dagObjects -lights`; //Filter light shape nodes from selection if ( size($lights) == 0 ) //If no lights are selected, error { error "DCG Lighter: No lights selected."; } dcg_lighter_aimLightAtObject($lights); } /* Description: Uses a selected light and object. The light will be aimed at the object without changing the actual location of the light. To use, select one light and one object. Currently, I have not added the ability to select multiple lights or multiple objects. Arguements: $lightTransformNode - transform node of the light. */ global proc dcg_lighter_aimLightAtObject(string $lights[]) { float $transXArray[]; float $transYArray[]; float $transZArray[]; //Get Object's transform node string $objects[] = `ls -selection -dag -type mesh -type nurbsSurface -type subdiv`; string $object; for ($object in $objects) { string $objectParents[] = `listRelatives -parent $object`; string $objectTransformNode = $objectParents[0]; float $objectTrans[] = `xform -query -translation $objectTransformNode`; //store translate values $transXArray[size($transXArray)] = $objectTrans[0]; $transYArray[size($transYArray)] = $objectTrans[1]; $transZArray[size($transZArray)] = $objectTrans[2]; } // print $transXArray; //find average translate X int $sizeArray = `size($transXArray)`; float $totalTransX = 0; for ($i = 0; $i < ($sizeArray); $i++ ) { $totalTransX = $totalTransX + $transXArray[$i]; } float $averageTransX = $totalTransX / $sizeArray; // print ("$averageTransX = " + $averageTransX + "\n"); //find average translate Y float $totalTransY = 0; for ($i = 0; $i < ($sizeArray); $i++ ) { $totalTransY = $totalTransY + $transYArray[$i]; } float $averageTransY = $totalTransY / $sizeArray; // print ("$averageTransY = " + $averageTransY + "\n"); //find average translate Z float $totalTransZ = 0; for ($i = 0; $i < ($sizeArray); $i++ ) { $totalTransZ = $totalTransZ + $transZArray[$i]; } float $averageTransZ = $totalTransZ / $sizeArray; // print ("$averageTransZ = " + $averageTransZ + "\n"); string $locator[] = `spaceLocator`; string $locatorParents[] = `listRelatives -parent $locator[0]`; string $locatorTransformNode = $locatorParents[0]; setAttr ($locatorTransformNode + ".translateX") $averageTransX; setAttr ($locatorTransformNode + ".translateY") $averageTransY; setAttr ($locatorTransformNode + ".translateZ") $averageTransZ; string $light; for ($i = 0; $i < size($lights); $i++) { string $lightShape = $lights[$i]; // print ($lightShape + "\n"); string $lightParents[] = `listRelatives -parent $lightShape`; string $lightTransformNode = $lightParents[0]; // print ($lightTransformNode + "\n"); $results = `aimConstraint -offset 0 0 0 -weight 1 -aimVector 0 0 -1 -upVector 0 1 0 -worldUpType "vector" -worldUpVector 0 1 0 $locator $lightTransformNode`; delete $results[0]; //get centerOfIllumination for light //position of light float $lightTrans[] = `xform -query -translation $lightTransformNode`; // print ("//-----$lightTrans = " + $lightTrans[0] + ", " + $lightTrans[1] + ", " + $lightTrans[2] + "\n"); //position of object to look at float $locatorTrans[] = `xform -query -translation $locator`; // print ("//-----$objectTrans = " + $objectTrans[0] + ", " + $objectTrans[1] + ", " + $objectTrans[2] + "\n"); //deltas print ("//----------DELTAS----------//\n"); float $deltaX = ($locatorTrans[0] - $lightTrans[0]); float $deltaY = ($locatorTrans[1] - $lightTrans[1]); float $deltaZ = ($locatorTrans[2] - $lightTrans[2]); print ("//-----$deltaX = " + $deltaX + "\n"); print ("//-----$deltaY = " + $deltaY + "\n"); print ("//-----$deltaZ = " + $deltaZ + "\n"); print ("//----------LIGHT-OBJECT VECTOR----------//\n"); vector $lightToObjectVector = << $deltaX, $deltaY, $deltaZ >>; print ("//-----$lightToObjectVector = " + $lightToObjectVector + "\n"); //get vector length for "centerOfIllumination" attribute float $vectorLength = mag($lightToObjectVector); print ("//-----$lightToObjectVector length = " + $vectorLength + "\n"); setAttr ( $lights[$i] + ".centerOfIllumination") $vectorLength; } delete $locator; } /* ||--Add Hue Falloff to a Light--|| Creates a hue falloff for any selected light based on an object's facing ration to the light. In order for this to work, one must select a specific camera from which to render. Note: This is an automation for the technique presented at: http://www.digitalartform.com/archives/2005/08/hue_falloff_in.html#more To use the script, one must shift+select both the inteded "falloff light" and renderable camera. Once the script is run, a ramp (amongst other nodes) will be connected to the light and camera in the hypershade. The color at the top of the ramp represents the color of the light when the object faces the light. The color gradiates towards the bottom of the ramp as the surface faces away. */ global proc dcg_lighter_lightFalloff(string $optionMenuGrpHueFalloff) { //first, select the light to be made a "color-falloff light" as well as the render-camera //-------create nodes--------// string $camera = `optionMenuGrp -query -value $optionMenuGrpHueFalloff` ; // string $camera[] = `ls -selection -dagObjects -cameras`; string $light[] = `ls -selection -dagObjects -lights`; if (size($light) == 0) { error "DCG Lighter: No Lights Selected! Aborting Hypershade network creation!"; } string $lightName = $light[0]; string $samplerInfo = `shadingNode -asUtility samplerInfo`; string $vectorProduct1 = `shadingNode -asUtility vectorProduct`; string $vectorProduct2 = `shadingNode -asUtility vectorProduct`; string $clamp = `shadingNode -asUtility clamp`; string $falloffRamp = `shadingNode -asTexture ramp`; string $lightInfo = `shadingNode -asUtility lightInfo`; string $multiplyDivide1 = `shadingNode -asUtility multiplyDivide`; string $multiplyDivide2 = `shadingNode -asUtility multiplyDivide`; string $plusMinusAverage = `shadingNode -asUtility plusMinusAverage`; //-------connect nodes, set values-------// connectAttr ($samplerInfo + ".normalCamera") ($vectorProduct1 + ".input1"); //samplerInfo to vectorProduct1// setAttr ($vectorProduct1 + ".input2") -type float3 -0.014 -7.428 -0.071; //set fixed values for vectorProduct1 setAttr ($vectorProduct1 + ".operation") 3; //set vectorProduct1 operation to "vector matrix product" setAttr ($vectorProduct1 + ".normalizeOutput") 1; //turn on "normalize output" for vectorProduct1 connectAttr ($camera + ".worldMatrix") ($vectorProduct1 + ".matrix"); //camerashape to vectorProduct1 connectAttr ($vectorProduct1 + ".output") ($vectorProduct2 + ".input1"); //vectorProduct1 to vectorProduct2 setAttr ($vectorProduct2 + ".normalizeOutput") 1; //turn on "normalize output" for vectorProduct2 connectAttr ($samplerInfo + ".pointWorld") ($multiplyDivide1 + ".input1"); //samplerInfo to multiplyDivide1 setAttr ($multiplyDivide1 + ".input2") -type float3 1 1 1; //set fixed values for multiplyDivide1 setAttr ($multiplyDivide1 + ".operation") 1; //set multiplyDivide1 operation to "multiply" connectAttr ($multiplyDivide1 + ".output") ($plusMinusAverage + ".input3D[1]"); //multiplyDivide1 to plusMinusAverage connectAttr ($lightInfo + ".lightPosition") ($multiplyDivide2 + ".input1"); //lightInfo to multiplyDivide2 setAttr ($multiplyDivide2 + ".input2") -type float3 1 1 1; //set fixed values for multiplyDivide2 setAttr ($multiplyDivide2 + ".operation") 1; //set multiplyDivide2 operation to "multiply" connectAttr ($multiplyDivide2 + ".output") ($plusMinusAverage + ".input3D[0]"); //multiplyDivide2 to plusMinusAverage setAttr ($plusMinusAverage + ".operation") 2; //set plusMinusAverage operation to "subtract connectAttr ($plusMinusAverage + ".output3D") ($vectorProduct2 + ".input2"); //plusMinusAverage to vectorProduct2 connectAttr ($vectorProduct2 + ".output") ($clamp + ".input"); //vectorProduct2 to clamp connectAttr ($clamp + ".outputR") ($falloffRamp + ".vCoord"); //clamp to ramp setAttr ($clamp + ".max") -type float3 1 1 1; //set fixed values for clamp setAttr ($falloffRamp + ".type") 0; //explicitly set ramp to a V Ramp connectAttr ($falloffRamp + ".outColor") ($light[0] + ".color"); //ramp to light connectAttr ($light[0] + ".worldMatrix") ($lightInfo + ".worldMatrix"); //loop light back to lightInfo string $rampNameNoLight = `textFieldGrp -query -text dcg_lighter_guiElem_textFieldGrp_rampName`; print ("Ramp's name before light = " + $rampNameNoLight + "\n"); if (`checkBox -query -value dcg_lighter_guiElem_checkBox_addLightNameToRampName`) { string $rampName = ($lightName + "_" + $rampNameNoLight); print ("Ramp's name = " + $rampName + "\n"); rename $falloffRamp $rampName; } else { rename $falloffRamp $rampNameNoLight; print ("Ramp's name = " + $rampNameNoLight + "\n"); } } /* ||--Set "Warning Verbosity--|| Description: This interprets the currently selected option from the "Warning" section of the "Verbosity" menu amd sets the "Warning Verbosity" appropriately. Arguements: - $level - Interger value given from the GUI. 0 - No warning messages will be displayed 1 - Messages given during a procedure that can be automated will not be shown. This keeps messages from constantly repeating needlessly. For example, if "Auto Look Through Selected" is turned on and all warning messages are shown, the user will constantly see a warning whenever something other than a light is selected. 2 - All warning messages will be shown. */ global proc dcg_lighter_setWarningVerbosity(int $level) { int $dcg_lighter_globalVar_warningVerbosityLevel; switch ($level) { case 0: int $dcg_lighter_globalVar_warningVerbosityLevel = 0; break; case 1: int $dcg_lighter_globalVar_warningVerbosityLevel = 1; break; case 2: int $dcg_lighter_globalVar_warningVerbosityLevel = 2; break; } print ("//-----DCG Lighter: Warning Verbosity Level set to = " + $dcg_lighter_globalVar_warningVerbosityLevel + "\n"); } /* ||--Set "Print Verbosity"--|| Description: This interprets the currently selected option from the "Print" section of the "Verbosity" menu amd sets the "Print Verbosity" appropriately. This procedure is run whenever the "Show Feedback" option in the "Verbosity" menu is changed. When on, various print statements are allowed to run, allowing the user to see constant feedback about what is going on in the script (value changes, current selections, etc.). When turned off, no print statements will be displayed. Note: These are different from warnings. Warnings inform the user of possible times when the script might not perform as expected. Arguements: none */ global proc dcg_lighter_setPrintVerbosity() { global int $dcg_lighter_globalVar_printVerbosityLevel; $dcg_lighter_globalVar_printVerbosityLevel = `menuItem -query -checkBox dcg_lighter_guiElem_menuItem_showFeedback`; print ("//-----DCG Lighter: Print Verbosity Level set to = " + $dcg_lighter_globalVar_printVerbosityLevel + "\n"); } /* ||--ScriptJob Command: Auto Look-Through-Selected--|| Description: After the scriptJob is created, this command will be run every time a selection is changed. The job will first check for the existance of both the Main GUI and the Light Looker window. If both do not exist, the procedure will run as normal by running the "dcg_lighter_lookThroughSelectedInModelPanel" procedure. However, once done, it will run the "dcg_lighter"autoLookThroughSelectedOFF" procedure, thus deleting the scriptJob. This prevents the user from closing the windows and accidently keeping the scriptJob running in the background when it isn't needed. Arguements: none */ global proc dcg_lighter_autoLookThroughSelectedScriptJob() { global int $dcg_lighter_globalVar_warningVerbosityLevel; global int $dcg_lighter_globalVar_autoLookThroughSelectedON; global int $dcg_lighter_globalVar_printVerbosityLevel; global int $dcg_lighter_globalVar_scriptJobALTSNumber; if (!`window -exists dcg_lighter_GUI_main` && !`window -exists dcg_lighter_GUI_lightLooker`) { evalDeferred "dcg_lighter_autoLookThroughSelectedOFF($dcg_lighter_globalVar_scriptJobALTSNumber,$dcg_lighter_globalVar_printVerbosityLevel);"; } dcg_lighter_lookThroughSelectedInModelPanel($dcg_lighter_globalVar_warningVerbosityLevel, $dcg_lighter_globalVar_autoLookThroughSelectedON, $dcg_lighter_globalVar_printVerbosityLevel); } /* ||--"Auto Look-Through-Light" Button ON--|| Description: This procedure is run when the "Auto Look-Through-Light" checkbox is set to ON. Arguements: none */ global proc dcg_lighter_autoLookThroughSelectedON(int $dcg_lighter_globalVar_printVerbosityLevel) { global int $dcg_lighter_globalVar_printVerbosityLevel; global int $dcg_lighter_globalVar_autoLookThroughSelectedON = 1; global int $dcg_lighter_globalVar_scriptJobALTSNumber; $dcg_lighter_globalVar_scriptJobALTSNumber = `scriptJob -event "SelectionChanged" "dcg_lighter_autoLookThroughSelectedScriptJob();"`; if ($dcg_lighter_globalVar_printVerbosityLevel == 1) { print ("//-----DCG Lighter: Creating scriptJob number " + $dcg_lighter_globalVar_scriptJobALTSNumber + "\n"); print ("//-----DCG Lighter: Global Variable \"$dcg_lighter_globalVar_autoLookThroughSelectedON\" = " + $dcg_lighter_globalVar_autoLookThroughSelectedON + "\n"); } } /* ||--"Auto Look-Through-Light" Button OFF--|| Description: This procedure deletes the scriptJob and resets the global variable $dcg_lighter_globalVar_scriptJobSLTSNumber to 123456789. It is run when the "Auto Look-Through-Light" checkbox is set to OFF. It is also run if the Auto Look-Through-Light scripJob is being run and neither the Main GUI nor the Light Looker is currently open. Arguements: none */ global proc dcg_lighter_autoLookThroughSelectedOFF( int $dcg_lighter_globalVar_scriptJobALTSNumber, int $dcg_lighter_globalVar_printVerbosityLevel) { global int $dcg_lighter_globalVar_autoLookThroughSelectedON; $dcg_lighter_globalVar_autoLookThroughSelectedON = 0; scriptJob -kill $dcg_lighter_globalVar_scriptJobALTSNumber; if ($dcg_lighter_globalVar_printVerbosityLevel == 1) { print ("//-----DCG Lighter: Killing scriptJob number " + $dcg_lighter_globalVar_scriptJobALTSNumber + "\n"); print ("//-----DCG Lighter: Global Variable \"$dcg_lighter_globalVar_autoLookThroughSelectedON\" = " + $dcg_lighter_globalVar_autoLookThroughSelectedON + "\n"); } $dcg_lighter_globalVar_scriptJobALTSNumber = 123456789; if ($dcg_lighter_globalVar_printVerbosityLevel == 1) { print ("//-----DCG Lighter: Resetting scriptJob number to " + $dcg_lighter_globalVar_scriptJobALTSNumber + "\n"); } } /* ||--Interpret Light Attributes from GUI--|| Description: Interprets "Light Attributes" either automatically when the light is placed or manually by pressing a "Propagate" button. Arguements: $propagate - int - Was a "Propagate" button pressed? - 0 - Applying all atributes to light - 1 - Light Color - 2 - Intensity - 3 - Illuminates by Default - 4 - Emit Diffuse - 5 - Emit Specular - 6 - Cone Angle - 7 - Penumbra Angle - 8 - Dropoff - 9 - Shadow Color - 10 - Use Depth Map Shadows - 11 - Use Raytrace Shadows */ global proc dcg_lighter_interpretLightAttributes( int $propagate) { global int $dcg_lighter_globalVar_printVerbosityLevel; float $lightColorAttr[] = `colorSliderButtonGrp -query -rgbValue dcg_lighter_guiElem_colorSliderButtonGrp_lightColor`; float $lightColorAttrR = $lightColorAttr[0]; float $lightColorAttrG = $lightColorAttr[1]; float $lightColorAttrB = $lightColorAttr[2]; float $intensityAttr = `floatSliderButtonGrp -query -value dcg_lighter_guiElem_floatSliderButtonGrp_intensity`; int $illuminatesByDefaultAttr = 0; //`checkBox -query -value dcg_lighter_guiElem_checkBox_illuminatesByDefault`; int $emitDiffuseAttr = `checkBox -query -value dcg_lighter_guiElem_checkBox_emitDiffuse`; int $emitSpecularAttr = `checkBox -query -value dcg_lighter_guiElem_checkBox_emitSpecular`; float $coneAngleAttr = `floatSliderButtonGrp -query -value dcg_lighter_guiElem_floatSliderButtonGrp_coneAngle`; float $penumbraAngleAttr = `floatSliderButtonGrp -query -value dcg_lighter_guiElem_floatSliderButtonGrp_penumbraAngle`; float $dropoffAttr = `floatSliderButtonGrp -query -value dcg_lighter_guiElem_floatSliderButtonGrp_dropoff`; float $shadowColorAttr[] = `colorSliderButtonGrp -query -rgbValue dcg_lighter_guiElem_colorSliderButtonGrp_shadowColor`; float $shadowColorAttrR = $shadowColorAttr[0]; float $shadowColorAttrG = $shadowColorAttr[1]; float $shadowColorAttrB = $shadowColorAttr[2]; int $useDepthMapShadowsAttr = 0; //`checkBox -query -value dcg_lighter_guiElem_checkBox_useDepthMapShadows`; int $useRaytraceShadowsAttr = 0; //`checkBox -query -value dcg_lighter_guiElem_checkBox_useRaytraceShadows`; if ($dcg_lighter_globalVar_printVerbosityLevel == 1) { print ("//-----SHOWING ALL LIGHT ATTRIBUTE VALUES-----//\n"); print ("//-----DCG Lighter: Light Color = " + $lightColorAttr[0] + ", " + $lightColorAttr[1] + ", " + $lightColorAttr[2] + "\n"); print ("//-----DCG Lighter: Intensity = " + $intensityAttr + "\n"); print ("//-----DCG Lighter: Illuminates by Default = " + $illuminatesByDefaultAttr + "\n"); print ("//-----DCG Lighter: Emit Diffuse = " + $emitDiffuseAttr + "\n"); print ("//-----DCG Lighter: Emit Specular = " + $emitSpecularAttr + "\n"); print ("//-----DCG Lighter: Cone Angle = " + $coneAngleAttr + "\n"); print ("//-----DCG Lighter: Prenumbra Angle = " + $penumbraAngleAttr + "\n"); print ("//-----DCG Lighter: Dropoff = " + $dropoffAttr + "\n"); print ("//-----DCG Lighter: Shadow Color = " + $shadowColorAttr[0] + ", " + $shadowColorAttr[1] + ", " + $shadowColorAttr[2] + "\n"); print ("//-----DCG Lighter: Use Depth Map Shadows = " + $useDepthMapShadowsAttr + "\n"); print ("//-----DCG Lighter: Use Raytrace Shadows = " + $useRaytraceShadowsAttr + "\n"); } dcg_lighter_setLightAttributes($propagate, $lightColorAttrR, $lightColorAttrG, $lightColorAttrB, $intensityAttr, $illuminatesByDefaultAttr, $emitDiffuseAttr, $emitSpecularAttr, $coneAngleAttr, $penumbraAngleAttr, $dropoffAttr, $shadowColorAttrR, $shadowColorAttrG, $shadowColorAttrB, $useDepthMapShadowsAttr, $useRaytraceShadowsAttr); } /* ||--Set Light Attributes from GUI--|| Description: This procedure is run after the dcg_lighter_interpretLightAttributes procedure. It checks for the propegation setting to see if all attributes should be set to the light or just a single attribute (in the case of pressing the "Propegate" button beside the attribute. Arguements: $propagate - int - Was a "Propagate" button pressed? - 0 - Applying all atributes to light - 1 - Light Color - 2 - Intensity - 3 - Illuminates by Default - 4 - Emit Diffuse - 5 - Emit Specular - 6 - Cone Angle - 7 - Penumbra Angle - 8 - Dropoff - 9 - Shadow Color - 10 - Use Depth Map Shadows - 11 - Use Raytrace Shadows $lightColorAttrR - float - passed from interpreter procedure. $lightColorAttrG - float - passed from interpreter procedure. $lightColorAttrB - float - passed from interpreter procedure. $intensityAttr - float - passed from interpreter procedure. $illuminatesByDefaultAttr - int - passed from interpreter procedure. $emitDiffuseAttr - int - passed from interpreter procedure. $emitSpecularAttr - int - passed from interpreter procedure. $coneAngleAttr - float - passed from interpreter procedure. $penumbraAngleAttr - float - passed from interpreter procedure. $dropoffAttr - float - passed from interpreter procedure. $shadowColorAttrR - float - passed from interpreter procedure. $shadowColorAttrG - float - passed from interpreter procedure. $shadowColorAttrB - float - passed from interpreter procedure. $useDepthMapShadowAttr - int - currently not being used $useRaytraceShadowsAttr - int - currently not being used */ global proc dcg_lighter_setLightAttributes( int $propagate, float $lightColorAttrR, float $lightColorAttrG, float $lightColorAttrB, float $intensityAttr, int $illuminatesByDefaultAttr, int $emitDiffuseAttr, int $emitSpecularAttr, float $coneAngleAttr, float $penumbraAngleAttr, float $dropoffAttr, float $shadowColorAttrR, float $shadowColorAttrG, float $shadowColorAttrB, int $useDepthMapShadowsAttr, int $useRaytraceShadowsAttr) { print ("//-----DCG Lighter: Button Pressed: " + $propagate + "\n"); string $lights[] = `ls -selection -dagObjects -lights`; string $light; for ($light in $lights) { if ($propagate == 0 || $propagate == 1) { if (`attributeExists "color" $light`) { setAttr ($light + ".color") -type double3 $lightColorAttrR $lightColorAttrG $lightColorAttrB; } } if ($propagate == 0 || $propagate == 2) { if (`attributeExists "intensity" $light`) { setAttr ($light + ".intensity") $intensityAttr; } } // if ($propagate == 0 || $propagate == 3) // { // switch ($$illuminatesByDefaultAttr) // { // case 0: // disconnectAttr ($light + ".instObjGroups[0]") defaultLightSet.dagSetMembers[1]; // break; // case 1: // connectAttr -nextAvailable ($light + ".instObjGroups") defaultLightSet.dagSetMembers; // break; // } // } if ($propagate == 0 || $propagate == 4) { if (`attributeExists "emitDiffuse" $light`) { setAttr ($light + ".emitDiffuse") $emitDiffuseAttr; } } if ($propagate == 0 || $propagate == 5) { if (`attributeExists "emitSpecular" $light`) { setAttr ($light + ".emitSpecular") $emitSpecularAttr; } } if ($propagate == 0 || $propagate == 6) { if (`attributeExists "coneAngle" $light`) { setAttr ($light + ".coneAngle") $coneAngleAttr; } } if ($propagate == 0 || $propagate == 7) { if (`attributeExists "penumbraAngle" $light`) { setAttr ($light + ".penumbraAngle") $penumbraAngleAttr; } } if ($propagate == 0 || $propagate == 8) { if (`attributeExists "dropoff" $light`) { setAttr ($light + ".dropoff") $dropoffAttr; } } if ($propagate == 0 || $propagate == 9) { if (`attributeExists "shadowColor" $light`) { setAttr ($light + ".shadowColor") -type double3 $shadowColorAttrR $shadowColorAttrG $shadowColorAttrB; } } } } /* ||--Light-Looker GUI--|| Description: Creates a UI containing the "Light Looker" model panel. Arguements: $dcg_lighter_globalVar_printVerbosityLevel - global int - sets the print verbosity level. */ global proc dcg_lighter_lightLookerGUI( int $dcg_lighter_globalVar_printVerbosityLevel) { global int $dcg_lighter_globalVar_printVerbosityLevel; if (`window -exists dcg_lighter_GUI_lightLooker`) { //if the window already exists, delete it deleteUI dcg_lighter_GUI_lightLooker; } if (`modelPanel -exists dcg_lighter_guiElem_modelPanel_lightLooker`) { //if the window already exists, delete it deleteUI -panel dcg_lighter_guiElem_modelPanel_lightLooker; } window -title "DCG Lighter - LIGHT LOOKER" -resizeToFitChildren yes dcg_lighter_GUI_lightLooker; paneLayout; modelPanel -menuBarVisible false -label "dcg_lightLookerPanel" dcg_lighter_guiElem_modelPanel_lightLooker; window -edit -widthHeight 500 500 dcg_lighter_GUI_lightLooker; showWindow dcg_lighter_GUI_lightLooker; if ($dcg_lighter_globalVar_printVerbosityLevel == 1) { print ("//-----DCG Lighter: Creating/Detatching \"Light Looker\"\n"); } } /* ||--Menu Group Change--|| Description: This is used for feedback only. The same processing of variables is performed in the lightDropper procedure. Arguements: $optionMenuGrp - string - name of the option menu group $dcg_lighter_globalVar_printVerbosityLevel - sets the print verbosity level. */ global proc dcg_lighter_ui_processOptionMenuGrpChange(string $optionMenuGrp, int $dcg_lighter_globalVar_printVerbosityLevel) { global int $dcg_lighter_globalVar_printVerbosityLevel; string $optionMenuGrp_currentItem = `optionMenuGrp -query -value $optionMenuGrp` ; string $cameraTransNode[] = `listRelatives -parent $optionMenuGrp_currentItem`; if ( $dcg_lighter_globalVar_printVerbosityLevel == 1) { print ( "//-----DCG Lighter: \"" + (`optionMenuGrp -query -label $optionMenuGrp`) + "\" optionMenuGrp set to " + $optionMenuGrp_currentItem + ".\n" ) ; print ( "//-----DCG Lighter: Camera transform node = " + $cameraTransNode[0] + ".\n"); } } /* ||--Builds the "Place Using" Menu Group--|| Description: This builds the "Place Using" option menu group. Arguements: $optionMenuGrp - string - name of the option menu group $dcg_lighter_globalVar_printVerbosityLevel - sets the print verbosity level. */ global proc dcg_lighter_ui_buildOptionMenuGrp(string $optionMenuGrp, int $dcg_lighter_globalVar_printVerbosityLevel) { if ( $dcg_lighter_globalVar_printVerbosityLevel == 1) { print ("//-----DCG Lighter: Building \"Place Using:\" Option Menu Group \n"); } string $currentMenuItems[] = `optionMenuGrp -query -itemListLong $optionMenuGrp`; //Deletes the current list of items string $currentMenuItem; for ($currentMenuItem in $currentMenuItems) deleteUI $currentMenuItem; string $nodeType = "camera"; string $objects[] = `ls -type $nodeType`; string $object; for ($object in $objects) { menuItem -parent ($optionMenuGrp + "|OptionMenu") -label $object ; } } /* ||--Menu Group Change for Hue Falloff--|| Description: Processes the menu group in the Hue Falloff tab. Arguements: $optionMenuGrpHueFalloff - string - name of the option menu group $dcg_lighter_globalVar_printVerbosityLevel - sets the print verbosity level. */ global proc dcg_lighter_ui_processOptionMenuGrpChangeFalloff(string $optionMenuGrpHueFalloff, int $dcg_lighter_globalVar_printVerbosityLevel) { global int $dcg_lighter_globalVar_printVerbosityLevel; string $optionMenuGrp_currentItem = `optionMenuGrp -query -value $optionMenuGrpHueFalloff` ; string $cameraTransNode[] = `listRelatives -parent $optionMenuGrp_currentItem`; if ( $dcg_lighter_globalVar_printVerbosityLevel == 1) { print ( "//-----DCG Lighter: \"" + (`optionMenuGrp -query -label $optionMenuGrpHueFalloff`) + "\" optionMenuGrp set to " + $optionMenuGrp_currentItem + ".\n" ) ; print ( "//-----DCG Lighter: Camera transform node = " + $cameraTransNode[0] + ".\n"); } } /* ||--Build "Render Using" Menu Group--|| Description: Builds the "Render Using" menu group in the hue falloff tab. Arguements: $optionMenuGrpHueFalloff - string - name of the option menu group $dcg_lighter_globalVar_printVerbosityLevel - sets the print verbosity level. */ global proc dcg_lighter_ui_buildOptionMenuGrpFalloff(string $optionMenuGrpHueFalloff, int $dcg_lighter_globalVar_printVerbosityLevel) { if ( $dcg_lighter_globalVar_printVerbosityLevel == 1) { print ("//-----DCG Lighter: Building \"Place Using:\" Option Menu Group \n"); } string $currentMenuItems[] = `optionMenuGrp -query -itemListLong $optionMenuGrpHueFalloff`; //Deletes the current list of items string $currentMenuItem; for ($currentMenuItem in $currentMenuItems) deleteUI $currentMenuItem; string $nodeType = "camera"; string $objects[] = `ls -type $nodeType`; string $object; for ($object in $objects) { menuItem -parent ($optionMenuGrpHueFalloff + "|OptionMenu") -label $object ; } } /* ||--Main GUI--|| Description: This procedure builds the main GUI for this tool kit. Arguements: none */ global proc dcg_lighter_MainGUI() { global int $dcg_lighter_globalVar_printVerbosityLevel; string $defaultNodeType = "camera"; //Check to see if the ALTSscriptJob exists (doesn't == 123456789). If it does, delete it // and reset the number to 123456789. global int $dcg_lighter_globalVar_scriptJobALTSNumber; global int $dcg_lighter_globalVar_warningVerbosityLevel; if ( $dcg_lighter_globalVar_scriptJobALTSNumber != 123456789 ) { if ($dcg_lighter_globalVar_warningVerbosityLevel >= 1) { warning ("DCG Lighter: \"Auto Look Through Selected\" scriptJob exists. Killing scriptJob number " + $dcg_lighter_globalVar_scriptJobALTSNumber); } scriptJob -kill $dcg_lighter_globalVar_scriptJobALTSNumber; $dcg_lighter_globalVar_scriptJobALTSNumber = 123456789; if ($dcg_lighter_globalVar_printVerbosityLevel == 1) { print ("//-----DCG Lighter: Resetting scriptJob number to " + $dcg_lighter_globalVar_scriptJobALTSNumber + "\n"); } } //If the window exists, delete it. if (`window -exists dcg_lighter_GUI_main`) { deleteUI dcg_lighter_GUI_main; } //Window commands window -title "DCG Lighter - MAIN" -resizeToFitChildren yes dcg_lighter_GUI_main; menuBarLayout; menu -label "Verbosity"; radioMenuItemCollection; menuItem -label "Show All Warnings" -radioButton on -command ("dcg_lighter_setWarningVerbosity(2)"); menuItem -label "Show Important Warnings" -radioButton off -command ("dcg_lighter_setWarningVerbosity(1)"); menuItem -label "Turn Off Warnings" -radioButton off -command ("dcg_lighter_setWarningVerbosity(0)"); setParent..; setParent..; menuItem -divider true; menuItem -label "Show Feedback" -checkBox off -command ("dcg_lighter_setPrintVerbosity()") dcg_lighter_guiElem_menuItem_showFeedback; menu -label "Help" -helpMenu true; menuItem -label "About..."; setParent ..; scrollLayout; columnLayout -adjustableColumn true; gridLayout -numberOfRowsColumns 4 1 -cellWidthHeight 230 25; button -label "Show/Detach \"Light-Looker\"" -command ("dcg_lighter_lightLookerGUI($dcg_lighter_globalVar_printVerbosityLevel)"); button -label "Look Through Light w/ \"Light Looker\"" -command ("dcg_lighter_lookThroughSelectedInModelPanel($dcg_lighter_globalVar_warningVerbosityLevel, $dcg_lighter_globalVar_autoLookThroughSelectedON, $dcg_lighter_globalVar_printVerbosityLevel)"); checkBox -label "Auto \"Look Through Light\"" -onCommand ("dcg_lighter_autoLookThroughSelectedON($dcg_lighter_globalVar_printVerbosityLevel)") -offCommand ("dcg_lighter_autoLookThroughSelectedOFF($dcg_lighter_globalVar_scriptJobALTSNumber, $dcg_lighter_globalVar_printVerbosityLevel)"); button -label "Point Light(s) At Object(s)" -command ("dcg_lighter_aimLightAtObjectButton();"); setParent ..; frameLayout -label "Create Lights" -borderStyle "etchedIn" -collapsable true -collapse 1; columnLayout -adjustableColumn false; text "Create Light:"; gridLayout -numberOfRowsColumns 2 3 -cellWidthHeight 80 30; button -label "Ambient" -command ("dcg_lighter_lightDropper(1, $dcg_lighter_globalVar_printVerbosityLevel, \"dcg_lighter_guiElem_optionMenuGrp_ltsCameras\")"); button -label "Directional" -command ("dcg_lighter_lightDropper(2, $dcg_lighter_globalVar_printVerbosityLevel, \"dcg_lighter_guiElem_optionMenuGrp_ltsCameras\")"); button -label "Point" -command ("dcg_lighter_lightDropper(3, $dcg_lighter_globalVar_printVerbosityLevel, \"dcg_lighter_guiElem_optionMenuGrp_ltsCameras\")"); button -label "Spot" -command ("dcg_lighter_lightDropper(4, $dcg_lighter_globalVar_printVerbosityLevel, \"dcg_lighter_guiElem_optionMenuGrp_ltsCameras\")"); button -label "Area" -command ("dcg_lighter_lightDropper(5, $dcg_lighter_globalVar_printVerbosityLevel, \"dcg_lighter_guiElem_optionMenuGrp_ltsCameras\")"); button -label "Volume" -command ("dcg_lighter_lightDropper(6, $dcg_lighter_globalVar_printVerbosityLevel, \"dcg_lighter_guiElem_optionMenuGrp_ltsCameras\")"); setParent..; checkBox -label "Use \"Light Attributes\" As Defaults" dcg_lighter_guiElem_checkbox_useLightAttributesAsDefaults; // checkBox -label "Auto adjust based on selection"; checkBox -label "Place light using camera" -value 0 dcg_lighter_guiElem_checkBox_placeUsingCamera; string $optionMenuGrp = `optionMenuGrp -label "Place Using:" -columnAlign 1 "right" -annotation "Place the light using the position and rotation of this camera." dcg_lighter_guiElem_optionMenuGrp_ltsCameras`; button -label "Refresh Camera List" -command ("dcg_lighter_ui_buildOptionMenuGrp(\"" + $optionMenuGrp + "\", $dcg_lighter_globalVar_printVerbosityLevel);"); setParent..; setParent..; frameLayout -label "Light Attributes" -borderStyle "etchedIn" -collapsable true -collapse 1; columnLayout; colorSliderButtonGrp -label "Light Color" -buttonLabel "Propagate" -buttonCommand "dcg_lighter_interpretLightAttributes(1);" -rgb 1 1 1 -columnWidth 4 60 dcg_lighter_guiElem_colorSliderButtonGrp_lightColor; floatSliderButtonGrp -label "Intensity" -field true -value 1.0 -buttonLabel "Propegate" -buttonCommand "dcg_lighter_interpretLightAttributes(2);" -columnWidth 4 60 dcg_lighter_guiElem_floatSliderButtonGrp_intensity; // gridLayout -numberOfRowsColumns 1 2 // -cellWidthHeight 150 25; // checkBox -label "Illuminates by Default" // dcg_lighter_guiElem_checkBox_illuminatesByDefault; // button -label "Propegate" // -width 60 // -command "dcg_lighter_interpretLightAttributes(3)"; // setParent..; gridLayout -numberOfRowsColumns 1 2 -cellWidthHeight 150 25; checkBox -label "Emit Diffuse" -value 1 dcg_lighter_guiElem_checkBox_emitDiffuse; button -label "Propegate" -width 60 -command "dcg_lighter_interpretLightAttributes(4)"; setParent..; gridLayout -numberOfRowsColumns 1 2 -cellWidthHeight 150 25; checkBox -label "Emit Specular" -value 1 dcg_lighter_guiElem_checkBox_emitSpecular; button -label "Propegate" -width 60 -command "dcg_lighter_interpretLightAttributes(5)"; setParent..; // gridLayout -numberOfRowsColumns 1 2 // -cellWidthHeight 150 25; // optionMenu -label "Decay Rate" // -changeCommand "print #1" // dcg_lighter_guiElem_optionMenu_decayRate; // menuItem -label "No Decay"; // menuItem -label "Linear"; // menuItem -label "Quadratic"; // menuItem -label "Cubic"; // button -label "Propegate" // -width 60 // -command ""; // setParent..; floatSliderButtonGrp -label "Cone Angle" -field true -value 40 -buttonLabel "Propegate" -buttonCommand "dcg_lighter_interpretLightAttributes(6)" -columnWidth 4 60 dcg_lighter_guiElem_floatSliderButtonGrp_coneAngle; floatSliderButtonGrp -label "Penumbra Angle" -field true -value 0 -buttonLabel "Propegate" -buttonCommand "dcg_lighter_interpretLightAttributes(7)" -columnWidth 4 60 dcg_lighter_guiElem_floatSliderButtonGrp_penumbraAngle; floatSliderButtonGrp -label "Dropoff" -field true -value 0 -buttonLabel "Propegate" -buttonCommand "dcg_lighter_interpretLightAttributes(8)" -columnWidth 4 60 dcg_lighter_guiElem_floatSliderButtonGrp_dropoff; colorSliderButtonGrp -label "Shadow Color" -buttonLabel "Propagate" -buttonCommand "dcg_lighter_interpretLightAttributes(9)" -rgb 0 0 0 -columnWidth 4 60 dcg_lighter_guiElem_colorSliderButtonGrp_shadowColor; // gridLayout -numberOfRowsColumns 1 2 // -cellWidthHeight 150 25; // checkBox -label "Use Depth Map Shadows" // dcg_lighter_guiElem_checkBox_useDepthMapShadows; // button -label "Propegate" // -width 60 // -command "dcg_lighter_interpretLightAttributes(10)"; // setParent..; // gridLayout -numberOfRowsColumns 1 2 // -cellWidthHeight 150 25; // checkBox -label "Use Raytrace Shadows" // dcg_lighter_guiElem_checkBox_useRaytraceShadows; // button -label "Propegate" // -width 60 // -command "dcg_lighter_interpretLightAttributes(11)"; // setParent..; setParent..; setParent..; frameLayout -label "Hypershade Setups" -borderStyle "etchedIn" -collapsable true -collapse 1 -marginWidth 50; columnLayout -adjustableColumn false; frameLayout -label "Hue Falloff" -borderStyle "etchedIn" -collapsable true -collapse 1; columnLayout -adjustableColumn false -width 500; string $optionMenuGrpHueFalloff = `optionMenuGrp -label "Rendering Using:" -columnAlign 1 "right" -annotation "Select the camera currently being used to render." dcg_lighter_guiElem_optionMenuGrp_renderCamera`; button -label "Refresh Camera List" -command ("dcg_lighter_ui_buildOptionMenuGrpFalloff(\"" + $optionMenuGrpHueFalloff + "\", $dcg_lighter_globalVar_printVerbosityLevel);"); textFieldGrp -label "Ramp Name" -text "hueFalloffRamp" dcg_lighter_guiElem_textFieldGrp_rampName; checkBox -label "Add light's name to Ramp Name" -value 1 dcg_lighter_guiElem_checkBox_addLightNameToRampName; button -label "Add Hue Falloff" -command ("dcg_lighter_lightFalloff(\"" + $optionMenuGrpHueFalloff + "\")"); setParent..; setParent..; setParent ..; setParent ..; setParent..; // the following changeCommands are applied here so that we can be sure to have the full name of the optionMenuGrp optionMenuGrp -edit -changeCommand ("dcg_lighter_ui_processOptionMenuGrpChange(\"" + $optionMenuGrp + "\", $dcg_lighter_globalVar_printVerbosityLevel);") $optionMenuGrp; optionMenuGrp -edit -changeCommand ("dcg_lighter_ui_processOptionMenuGrpChangeFalloff(\"" + $optionMenuGrpHueFalloff + "\", $dcg_lighter_globalVar_printVerbosityLevel);") $optionMenuGrpHueFalloff; dcg_lighter_ui_buildOptionMenuGrp($optionMenuGrp, $dcg_lighter_globalVar_printVerbosityLevel); dcg_lighter_ui_buildOptionMenuGrp($optionMenuGrpHueFalloff, $dcg_lighter_globalVar_printVerbosityLevel); showWindow dcg_lighter_GUI_main; }