// =========================================================================== // 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: // AEfltLightPointShapeTemplate // // Description Name; // Creates the attribute editor controls for the fltLightPoint Node // // Input Value: // nodeName // // Output Value: // None // // // Procedure Name: // checkFLTDirectionalType // // global proc checkFLTDirectionalType ( string $nodeName ) { int $dirType = `getAttr ($nodeName+".DirectionalType")`; switch ($dirType) { case 0: // The light is Omnidirectional editorTemplate -dimControl $nodeName "DecayRateBox" true; editorTemplate -dimControl $nodeName "DirectionalFalloffExponent" true; editorTemplate -dimControl $nodeName "DirectionalAmbientIntensity" true; editorTemplate -dimControl $nodeName "BackIntensity" true; editorTemplate -dimControl $nodeName "BackColor" true; editorTemplate -dimControl $nodeName "DisplayLobe" true; editorTemplate -dimControl $nodeName "HorizontalLobeAngle" true; editorTemplate -dimControl $nodeName "VerticalLobeAngle" true; editorTemplate -dimControl $nodeName "LobeRollAngle" true; break; case 1: // The light is Unidirectional editorTemplate -dimControl $nodeName "DecayRateBox" false; checkFLTDecayRateBox $nodeName; editorTemplate -dimControl $nodeName "DirectionalAmbientIntensity" false; editorTemplate -dimControl $nodeName "BackIntensity" true; editorTemplate -dimControl $nodeName "BackColor" true; editorTemplate -dimControl $nodeName "DisplayLobe" false; editorTemplate -dimControl $nodeName "HorizontalLobeAngle" false; editorTemplate -dimControl $nodeName "VerticalLobeAngle" false; editorTemplate -dimControl $nodeName "LobeRollAngle" false; break; case 2: // The light is Bidirectional editorTemplate -dimControl $nodeName "DecayRateBox" false; checkFLTDecayRateBox $nodeName; editorTemplate -dimControl $nodeName "DirectionalAmbientIntensity" false; editorTemplate -dimControl $nodeName "BackIntensity" false; editorTemplate -dimControl $nodeName "BackColor" false; editorTemplate -dimControl $nodeName "DisplayLobe" false; editorTemplate -dimControl $nodeName "HorizontalLobeAngle" false; editorTemplate -dimControl $nodeName "VerticalLobeAngle" false; editorTemplate -dimControl $nodeName "LobeRollAngle" false; break; default: error (uiRes("m_AEfltLightPointShapeTemplate.kUndefinedDirectionError")); break; } } // // Procedure Name: // checkFLTDecayRateBox // // global proc checkFLTDecayRateBox ( string $nodeName ) { int $decayRate = `getAttr ($nodeName+".DecayRateBox")`; string $customDecayRateAttr = $nodeName + ".DirectionalFalloffExponent"; switch ($decayRate) { case 0: // No Decay Rate case 1: // Linear Decay Rate case 2: // Quadratic Decay Rate case 3: // Cubic Decay Rate setAttr $customDecayRateAttr $decayRate; editorTemplate -dimControl $nodeName "DirectionalFalloffExponent" true; break; case 4: // Custom Decay Rate editorTemplate -dimControl $nodeName "DirectionalFalloffExponent" false; break; default: error (uiRes("m_AEfltLightPointShapeTemplate.kUndefinedDecayError")); break; } } // // Procedure Name: // checkFLTFadingMode // // global proc checkFLTFadingMode ( string $nodeName ) { int $enableIt = `getAttr ($nodeName+".FadingMode")`; editorTemplate -dimControl $nodeName "RangeMode" (!$enableIt); } // // Procedure Name: // checkFLTFogPunchMode // // global proc checkFLTFogPunchMode ( string $nodeName ) { int $enableIt = `getAttr ($nodeName+".FogPunchMode")`; editorTemplate -dimControl $nodeName "FogScalar" (!$enableIt); } // // Procedure Name: // checkFLTDisplayMode // // global proc checkFLTDisplayMode ( string $nodeName ) { int $dispMode = `getAttr ($nodeName+".DisplayMode")`; if ($dispMode == 0) { // Raster display mode editorTemplate -dimControl $nodeName "MinimumDefocus" true; editorTemplate -dimControl $nodeName "MaximumDefocus" true; editorTemplate -dimControl $nodeName "Calligraphic" true; } else if ($dispMode == 1) { // Calligraphic display mode editorTemplate -dimControl $nodeName "MinimumDefocus" false; editorTemplate -dimControl $nodeName "MaximumDefocus" false; editorTemplate -dimControl $nodeName "Calligraphic" false; } else if ($dispMode == 2) { // Either display mode editorTemplate -dimControl $nodeName "MinimumDefocus" false; editorTemplate -dimControl $nodeName "MaximumDefocus" false; editorTemplate -dimControl $nodeName "Calligraphic" false; } } global proc AEfltLightPointShapeTemplate ( string $nodeName ) { editorTemplate -beginScrollLayout; editorTemplate -beginLayout (uiRes("m_AEfltLightPointShapeTemplate.kLightDirectionality")); editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kType")) -addControl "DirectionalType" "checkFLTDirectionalType"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kDecayRate")) -addControl "DecayRateBox" "checkFLTDecayRateBox"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kCustomDecayRate")) -addControl "DirectionalFalloffExponent"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kFrontIntensity")) -addControl "Intensity"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kAmbientIntensity")) -addControl "DirectionalAmbientIntensity"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kBackIntensity")) -addControl "BackIntensity"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kBackColor")) -addControl "BackColor"; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AEfltLightPointShapeTemplate.kVisibility")); editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kPerspectiveFading")) -addControl "FadingMode" "checkFLTFadingMode"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kDistanceMeasure")) -addControl "RangeMode"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kFogPunch")) -addControl "FogPunchMode" "checkFLTFogPunchMode"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kFogScalar")) -addControl "FogScalar"; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AEfltLightPointShapeTemplate.kLobeAngle")); editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kHorizontal")) -addControl "HorizontalLobeAngle"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kVertical")) -addControl "VerticalLobeAngle"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kRoll")) -addControl "LobeRollAngle"; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AEfltLightPointShapeTemplate.kTransparentFalloff")); editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kLightSizeinPixels")) -addControl "TransparentFalloffPixelSize"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kExponent")) -addControl "TransparentFalloffExponent"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kExponentScale")) -addControl "TransparentFalloffScalar"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kMinimumFalloff")) -addControl "TransparentFalloffClamp"; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AEfltLightPointShapeTemplate.kSize")); editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kMinSizeinPixels")) -addControl "MinimumPixelSize"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kMaxSizeinPixels")) -addControl "MaximumPixelSize"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kSizeDifferenceThreshold")) -addControl "SizeDifferenceThreshold"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kActualSize")) -addControl "ActualSize"; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AEfltLightPointShapeTemplate.kTargetSystemDisplay")); editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kTypeofDisplay")) -addControl "DisplayMode" "checkFLTDisplayMode"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kMinDefocus")) -addControl "MinimumDefocus"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kMaxDefocus")) -addControl "MaximumDefocus"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kCalligraphicDrawOrder")) -addControl "Calligraphic"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kDropOutPriority")) -addControl "Significance"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kSurfaceMaterialCode")) -addControl "SurfaceMaterialCode"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kFeatureID")) -addControl "FeatureId"; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AEfltLightPointShapeTemplate.kRotationAnimation")); editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kRotationAxis")) -addControl "AnimRotateAxis"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kPeriod")) -addControl "AnimationPeriod"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kPhaseDelay")) -addControl "AnimationPhaseDelay"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kEnabledPeriod")) -addControl "AnimationEnabledPeriod"; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AEfltLightPointShapeTemplate.kDisplay")); editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kNormals")) -addControl "DisplayNormals"; editorTemplate -label (uiRes("m_AEfltLightPointShapeTemplate.kLobe")) -addControl "DisplayLobe"; editorTemplate -endLayout; // Suppress unwanted attributes editorTemplate -suppress "LightPointsMin"; editorTemplate -suppress "LightPointsMax"; editorTemplate -suppress "inputLightPoints"; editorTemplate -suppress "cachedLightPoints"; editorTemplate -suppress "LightColors"; editorTemplate -suppress "LightNormals"; editorTemplate -suppress "Flags"; editorTemplate -suppress "DirectionalMode"; editorTemplate -beginLayout (uiRes("m_AEfltLightPointShapeTemplate.kShapeAttributes")); AEsurfaceShapeTemplate $nodeName; editorTemplate -addExtraControls; editorTemplate -endLayout; editorTemplate -endScrollLayout; }