// =========================================================================== // 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 ilrUpdateAEDisplacementShaderOptions(string $parent, string $node) { string $oldParent = `setParent -q`; setParent $parent; if (`attributeQuery -exists -node $node "ilrDisplacementMethod"`) { int $pt = `getAttr ($node + ".ilrDisplacementMethod")`; int $mt = !$pt; // micro triangles text -e -enable $mt ilrMTLabel; attrFieldSliderGrp -e -enable $mt ilrMTMaxTriangles; attrControlGrp -e -enable $mt ilrMTLod; int $lodEnable = `getAttr ($node + ".ilrMTLod")` && $mt; attrFieldSliderGrp -e -enable $lodEnable ilrMTLodMultiplier; attrFieldSliderGrp -e -enable $mt ilrMTMaxRayOffset; // pre-tesselation text -e -enable $pt ilrPTLabel; attrFieldSliderGrp -e -enable $pt ilrPTMaxSubdivs; attrFieldSliderGrp -e -enable $pt ilrPTEdgeLength; attrFieldSliderGrp -e -enable $pt ilrPTEdgeHeight; attrControlGrp -e -enable $pt ilrDispNormals; int $dispNormalsEnable = `getAttr ($node + ".ilrDispNormals")` && $pt; attrFieldSliderGrp -e -enable $dispNormalsEnable ilrDispNormalsThreshold; // autobounds int $enable = !`getAttr ($node + ".ilrAutoBounds")`; attrFieldSliderGrp -e -enable $enable ilrLowerBound; attrFieldSliderGrp -e -enable $enable ilrUpperBound; } setParent $oldParent; } global proc ilrCreateAEDisplacementShaderOptions(string $parent, string $node) { string $oldParent = `setParent -q`; setParent $parent; string $updcmd = "ilrUpdateAEDisplacementShaderOptions(\\\"" + $parent + "\\\", \\\"" + $node + "\\\")"; if (`attributeQuery -exists -node $node "ilrDisplacementMethod"`) { attrControlGrp -label "Method" -attribute ($node + ".ilrDisplacementMethod") -changeCommand $updcmd; attrFieldSliderGrp -label "Displacement Scale" -attribute ($node + ".ilrDisplacementScale"); attrControlGrp -label "Smooth Base Mesh" -attribute ($node + ".ilrSmoothBaseMesh"); separator; text -label " Rendertime Micro Triangles" -align "left" -font "smallBoldLabelFont" ilrMTLabel; attrFieldSliderGrp -label "Max Triangles Per Edge" -attribute ($node + ".ilrMTMaxTriangles") ilrMTMaxTriangles; attrControlGrp -label "Enable LOD" -attribute ($node + ".ilrMTLod") -changeCommand $updcmd ilrMTLod; attrFieldSliderGrp -label "LOD Quality" -attribute ($node + ".ilrMTLodMultiplier") ilrMTLodMultiplier; attrFieldSliderGrp -label "Max Ray Offset" -attribute ($node + ".ilrMTMaxRayOffset") ilrMTMaxRayOffset; separator; text -label " Pre-Tesselation" -align "left" -font "smallBoldLabelFont" ilrPTLabel; attrFieldSliderGrp -label "Max Subdivision" -attribute ($node + ".ilrPTMaxSubdivs") ilrPTMaxSubdivs; attrFieldSliderGrp -label "Edge Length" -attribute ($node + ".ilrPTEdgeLength") ilrPTEdgeLength; attrFieldSliderGrp -label "Edge Height" -attribute ($node + ".ilrPTEdgeHeight") ilrPTEdgeHeight; attrControlGrp -label "Smooth Normals" -attribute ($node + ".ilrDispNormals") -changeCommand $updcmd ilrDispNormals; attrFieldSliderGrp -label "Smooth Normals Threshold" -attribute ($node + ".ilrDispNormalsThreshold") ilrDispNormalsThreshold; separator; text -label " Displacement Bounds" -align "left" -font "smallBoldLabelFont"; attrControlGrp -label "Calculate Bounds Automatically" -attribute ($node + ".ilrAutoBounds") -changeCommand $updcmd; attrFieldSliderGrp -label "Lower Bound" -attribute ($node + ".ilrLowerBound") ilrLowerBound; attrFieldSliderGrp -label "Upper Bound" -attribute ($node + ".ilrUpperBound") ilrUpperBound; } setParent $oldParent; ilrUpdateAEDisplacementShaderOptions($parent, $node); }