// =========================================================================== // 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 // // Procedures specifying the UI layout for ilrAshikhminShader // in Maya's Attribute Editor // global proc AEilrAshikhminShaderNormalNew(string $attr) { attrNavigationControlGrp -l "Bump Mapping" -dragCallback "AEdragCallback" AEilrAshikhminShaderNormalControl; AEilrAshikhminShaderNormalReplace $attr; } global proc AEilrAshikhminShaderNormalReplace(string $attr) { attrNavigationControlGrp -edit -at $attr AEilrAshikhminShaderNormalControl; } global proc AEilrUpdateAshikhminfShader(string $node) { int $dim = (`getAttr ($node + ".matchSpec")`); editorTemplate -dimControl $node "phongExpURef" $dim; editorTemplate -dimControl $node "phongExpVRef" $dim; editorTemplate -dimControl $node "rotationRef" $dim; editorTemplate -dimControl $node "iorRef" $dim; int $dim2 = !(`getAttr ($node + ".attenuateReflections")`); editorTemplate -dimControl $node "attenuationStart" $dim2; editorTemplate -dimControl $node "attenuationEnd" $dim2; } global proc AEilrUpdateAttEnd(string $node) { float $ae = (`getAttr ($node + ".attenuationEnd")`); float $as = (`getAttr ($node + ".attenuationStart")`); if($ae < $as) { setAttr ($node + ".attenuationEnd") $as; } } global proc AEilrUpdateAttStart(string $node) { float $ae = (`getAttr ($node + ".attenuationEnd")`); float $as = (`getAttr ($node + ".attenuationStart")`); if($as > $ae) { setAttr ($node + ".attenuationStart") $ae; } } global proc AEilrAshikhminShaderTemplate(string $node) { editorTemplate -beginScrollLayout; editorTemplate -beginLayout "Common Material Attributes" -collapse false; editorTemplate -label "Diffuse" -addControl "diffuse"; editorTemplate -callCustom "AEilrAshikhminShaderNormalNew" "AEilrAshikhminShaderNormalReplace" "normalCamera"; editorTemplate -s "normalCamera"; editorTemplate -endLayout; editorTemplate -beginLayout "Specular Material Attributes" -collapse false; editorTemplate -label "Specular" -addControl "specular"; editorTemplate -label "Spread U" -addControl "phongExpU"; editorTemplate -label "Spread V" -addControl "phongExpV"; editorTemplate -label "Rotation" -addControl "rotation"; editorTemplate -label "Fresnel Index" -addControl "ior"; editorTemplate -endLayout; editorTemplate -beginLayout "Reflection Material Attributes" -collapse false; editorTemplate -label "Reflectivity" -addControl "reflectivity"; editorTemplate -label "Match Specular" -addControl "matchSpec" "AEilrUpdateAshikhminfShader"; editorTemplate -label "Spread U" -addControl "phongExpURef"; editorTemplate -label "Spread V" -addControl "phongExpVRef"; editorTemplate -label "Rotation" -addControl "rotationRef"; editorTemplate -label "Fresnel Index" -addControl "iorRef"; editorTemplate -label "Glossy rays" -addControl "maxGlossyRays"; editorTemplate -endLayout; editorTemplate -beginLayout "Environment Material Attributes" -collapse false; editorTemplate -label "Reflected Color" -addControl "reflectedColor"; editorTemplate -label "Attenuate Reflections" -addControl "attenuateReflections" "AEilrUpdateAshikhminfShader"; editorTemplate -label "Attenuation Start" -addControl "attenuationStart" "AEilrUpdateAttStart"; editorTemplate -label "Attenuation End" -addControl "attenuationEnd" "AEilrUpdateAttEnd"; editorTemplate -endLayout; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; // suppressed attributes editorTemplate -suppress "caching"; editorTemplate -suppress "nodeState"; editorTemplate -suppress "version"; //`AEilrUpdateAshikhminfShader`; }