// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // Procedure Name: // AEvolumeLightTemplate // // Description: // Creates the attribute editor controls for the volumeLightNode // // Input Value: // nodeName // // Output Value: // None // global proc AEvolumeLightFogNew (string $fogGeometry) // // Description: // Setup up button that makes fog. // { setUITemplate -pst attributeEditorTemplate; attrNavigationControlGrp -label (uiRes("m_AEvolumeLightTemplate.kLightFog")) -at $fogGeometry -ignoreNotSupported lightFogControl; setUITemplate -ppt; } global proc AEvolumeLightFogReplace (string $fogGeometry) // // Description: // Replace the button with the command to create fog // for the new light. // { attrNavigationControlGrp -edit -at $fogGeometry -ignoreNotSupported lightFogControl; } // // Procedure Name: // AEvolumeLightGlowNew // // global proc AEvolumeLightGlowNew (string $lightGlow) { setUITemplate -pst attributeEditorTemplate; attrNavigationControlGrp -label (uiRes("m_AEvolumeLightTemplate.kLightGlow")) -at $lightGlow -ignoreNotSupported lightGlowControl; setUITemplate -ppt; } // // Procedure Name: // AEvolumeLightGlowReplace // // global proc AEvolumeLightGlowReplace (string $lightGlow) { attrNavigationControlGrp -edit -at $lightGlow -ignoreNotSupported lightGlowControl; } global proc AEvolumeLightUpdateShape( string $nodeName ) { int $method = getAttr($nodeName + ".lightShape"); int $isCone = $method == 3; int $isBox = $method == 0; int $hasPenumb = $isCone || ($method == 2); editorTemplate -dimControl $nodeName "coneEndRadius" (!$isCone); editorTemplate -dimControl $nodeName "arc" ($isBox); editorTemplate -dimControl $nodeName "penumbra" (!$hasPenumb); editorTemplate -dimControl $nodeName "penumbra_Interp" (!$hasPenumb); } // // Procedure Name: // AEvolumeLightUpdateShadow // global proc AEvolumeLightUpdateShadow ( string $nodeName ) { string $nodeAttr = $nodeName + ".useRayTraceShadows"; int $value = `getAttr $nodeAttr`; if ( $value == 1 ) { $nodeAttr2 = $nodeName + ".volumeLightDir"; $value2 = `getAttr $nodeAttr2`; if ($value2 == 2) { editorTemplate -dimControl $nodeName "lightRadius" true; editorTemplate -dimControl $nodeName "lightAngle" false; } else { editorTemplate -dimControl $nodeName "lightRadius" false; editorTemplate -dimControl $nodeName "lightAngle" true; } editorTemplate -dimControl $nodeName "shadowRays" false; editorTemplate -dimControl $nodeName "rayDepthLimit" false; } else { editorTemplate -dimControl $nodeName "lightRadius" true; editorTemplate -dimControl $nodeName "lightAngle" true; editorTemplate -dimControl $nodeName "shadowRays" true; editorTemplate -dimControl $nodeName "rayDepthLimit" true; } } // // Procedure Name: // AEvolumeLightTemplate // // global proc AEvolumeLightTemplate ( string $nodeName ) { AEswatchDisplay $nodeName; editorTemplate -beginScrollLayout; editorTemplate -beginLayout (uiRes("m_AEvolumeLightTemplate.kVolumeLightAttr")) -collapse 0; AElightCommon $nodeName; editorTemplate -addControl "lightShape" "AEvolumeLightUpdateShape"; AEaddRampControl ($nodeName+".colorRange"); editorTemplate -addControl "volumeLightDir" AEvolumeLightUpdateShadow; editorTemplate -addControl "arc"; editorTemplate -addControl "coneEndRadius"; editorTemplate -addControl "emitAmbient"; AEaddRampControl ($nodeName+".penumbra"); editorTemplate -suppress "decayRate"; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AEvolumeLightTemplate.kLightEffects")); editorTemplate -callCustom "AEvolumeLightFogNew" "AEvolumeLightFogReplace" "fogGeometry"; editorTemplate -suppress "fogType"; editorTemplate -suppress "fogRadius"; editorTemplate -addControl "fogIntensity"; editorTemplate -addSeparator; editorTemplate -callCustom "AEvolumeLightGlowNew" "AEvolumeLightGlowReplace" "lightGlow"; editorTemplate -suppress "fogType"; editorTemplate -suppress "objectType"; editorTemplate -suppress "pointWorld"; editorTemplate -suppress "farPointWorld"; editorTemplate -suppress "farPointCamera"; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AEvolumeLightTemplate.kShadows")); editorTemplate -addControl "shadowColor"; // include the depth part of the nonExtendedLightShapeNode first AEnonExtendedLightShapeDepthMapAttr $nodeName; editorTemplate -beginLayout (uiRes("m_AEvolumeLightTemplate.kRaytraceShadowAttr")) -collapse 0; editorTemplate -addControl "useRayTraceShadows" "AEvolumeLightUpdateShadow"; // include the main part of the nonExtendedLightShapeNode AEnonExtendedLightShapeShadowAttr $nodeName; // include the last part of the lightNode AElightCommonShadow2 $nodeName; editorTemplate -endLayout; // include all other inherited attrs AEshapeTemplate $nodeName; //suppressed attributes editorTemplate -suppress "receiveShadows"; editorTemplate -suppress "mentalRayControls"; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; }