// =========================================================================== // 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. // =========================================================================== // // provided at the time of installation or download, or which otherwise accompanies global proc ilrUpdateAESurfaceShaderOptions(string $parent, string $node) { string $oldParent = `setParent -q`; setParent $parent; if (`attributeQuery -exists -node $node "ilrGlossyReflections"`) { int $reflEnable = `getAttr ($node + ".ilrGlossyReflections")`; attrFieldSliderGrp -e -enable $reflEnable ilrGlossyMaximumRays; attrFieldSliderGrp -e -enable $reflEnable ilrGlossySharpness; attrControlGrp -e -enable $reflEnable ilrGlossyAnisotropic; int $anisotropicEnable = `getAttr ($node + ".ilrGlossyAnisotropic")` && $reflEnable; attrFieldSliderGrp -e -enable $anisotropicEnable ilrGlossyAngle; attrFieldSliderGrp -e -enable $anisotropicEnable ilrGlossySpreadX; attrFieldSliderGrp -e -enable $anisotropicEnable ilrGlossySpreadY; } if (`attributeQuery -exists -node $node "ilrGlossyRefractions"`) { int $refrEnable = `getAttr ($node + ".ilrGlossyRefractions")`; attrFieldSliderGrp -e -enable $refrEnable ilrGlossyRefrMaximumRays; attrFieldSliderGrp -e -enable $refrEnable ilrGlossyRefrSharpness; attrControlGrp -e -enable $refrEnable ilrGlossyRefrAnisotropic; int $anisotropicEnable = `getAttr ($node + ".ilrGlossyRefrAnisotropic")` && $refrEnable; attrFieldSliderGrp -e -enable $anisotropicEnable ilrGlossyRefrAngle; attrFieldSliderGrp -e -enable $anisotropicEnable ilrGlossyRefrSpreadX; attrFieldSliderGrp -e -enable $anisotropicEnable ilrGlossyRefrSpreadY; } setParent $oldParent; } global proc ilrCreateAESurfaceShaderOptions(string $parent, string $node) { string $oldParent = `setParent -q`; setParent $parent; string $updcmd = "ilrUpdateAESurfaceShaderOptions(\\\"" + $parent + "\\\", \\\"" + $node + "\\\")"; int $reflectionSettingsExist = 0, $refractionSettingsExist = 0, $materialGISettingsExist = 0; if (`attributeQuery -exists -node $node "ilrGlossyReflections"`) { $reflectionSettingsExist = 1; } if (`attributeQuery -exists -node $node "ilrGlossyRefractions"`) { $refractionSettingsExist = 1; } if (`attributeQuery -exists -node $node "ilrGIPrimaryIntensity"`) { $materialGISettingsExist = 1; } if ($reflectionSettingsExist) { frameLayout -label "Reflection" -cll true -cl true; columnLayout -adjustableColumn true; attrControlGrp -label "Glossy Reflections" -attribute ($node + ".ilrGlossyReflections") -changeCommand $updcmd; attrFieldSliderGrp -label "Maximum Rays" -attribute ($node + ".ilrGlossyMaximumRays") ilrGlossyMaximumRays; attrFieldSliderGrp -label "Sharpness" -attribute ($node + ".ilrGlossySharpness") ilrGlossySharpness; attrControlGrp -label "Anisotropic" -attribute ($node + ".ilrGlossyAnisotropic") -changeCommand $updcmd ilrGlossyAnisotropic; attrFieldSliderGrp -label "Angle" -attribute ($node + ".ilrGlossyAngle") ilrGlossyAngle; attrFieldSliderGrp -label "Spread X" -attribute ($node + ".ilrGlossySpreadX") ilrGlossySpreadX; attrFieldSliderGrp -label "Spread Y" -attribute ($node + ".ilrGlossySpreadY") ilrGlossySpreadY; setParent ..; setParent ..; } if ($refractionSettingsExist) { frameLayout -label "Refraction" -cll true -cl true; columnLayout -adjustableColumn true; attrControlGrp -label "Glossy Refractions" -attribute ($node + ".ilrGlossyRefractions") -changeCommand $updcmd; attrFieldSliderGrp -label "Maximum Refr. Rays" -attribute ($node + ".ilrGlossyRefrMaximumRays") ilrGlossyRefrMaximumRays; attrFieldSliderGrp -label "Refr. Blur Angle" -attribute ($node + ".ilrGlossyRefrSharpness") ilrGlossyRefrSharpness; attrControlGrp -label "Refr. Anisotropic" -attribute ($node + ".ilrGlossyRefrAnisotropic") -changeCommand $updcmd ilrGlossyRefrAnisotropic; attrFieldSliderGrp -label "Refr. Angle" -attribute ($node + ".ilrGlossyRefrAngle") ilrGlossyRefrAngle; attrFieldSliderGrp -label "Refr. Blur X Angle" -attribute ($node + ".ilrGlossyRefrSpreadX") ilrGlossyRefrSpreadX; attrFieldSliderGrp -label "Refr. Blur Y Angle" -attribute ($node + ".ilrGlossyRefrSpreadY") ilrGlossyRefrSpreadY; setParent ..; setParent ..; } if ($materialGISettingsExist) { frameLayout -label "Global Illumination" -cll true -cl true; columnLayout -adjustableColumn true; attrFieldSliderGrp -label "Primary Intensity" -attribute ($node + ".ilrGIPrimaryIntensity") -hideMapButton 1 ilrGIPrimaryIntensity; attrFieldSliderGrp -label "Primary Saturation" -attribute ($node + ".ilrGIPrimarySaturation") -hideMapButton 1 ilrGIPrimarySaturation; attrFieldSliderGrp -label "Secondary Intensity" -attribute ($node + ".ilrGISecondaryIntensity") -hideMapButton 1 ilrGISecondaryIntensity; attrFieldSliderGrp -label "Secondary Saturation" -attribute ($node + ".ilrGISecondarySaturation") -hideMapButton 1 ilrGISecondarySaturation; separator; attrFieldSliderGrp -label "Diffuse Boost" -attribute ($node + ".ilrGIDiffuseBoost") -hideMapButton 1 ilrGIDiffuseBoost; attrFieldSliderGrp -label "Specular Scale" -attribute ($node + ".ilrGISpecularScale") -hideMapButton 1 ilrGISpecularScale; attrFieldSliderGrp -label "Emissive Scale" -attribute ($node + ".ilrGIEmissiveScale") -hideMapButton 1 ilrGIEmissiveScale; setParent ..; setParent ..; } setParent $oldParent; ilrUpdateAESurfaceShaderOptions($parent, $node); }