// =========================================================================== // 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: // AEroundConstantRadiusTemplate // // Description Name; // Creates the attribute editor controls for the round node // // Input Value: // nodeName // // Output Value: // None // global proc AEedgePairNew( string $plug ) { frameLayout -cl true -cll true -label (uiRes("m_AEroundConstantRadiusTemplate.kEdgeInputs")) -lv true "edgeLayout"; columnLayout; // get the number of elements in this multi attribute // int $numEdgePairs = `getAttr -size $plug`; int $i = 0; for( $i = 0; $i < $numEdgePairs; $i++ ) { frameLayout -cl true -cll true -l ("Edge[" + ($i) + "]") -lv true; string $layout = `columnLayout`; frameLayout -cl false -cll false -lv false -bv false; string $crv = $plug + "[" + $i + "].inputCurveA"; AEmultiInputNew( "inputCurveA", $crv ); setParent $layout; frameLayout -cl false -cll false -lv false -bv false; $crv = $plug + "[" + $i + "].inputCurveB"; AEmultiInputNew( "inputCurveB", $crv ); setParent $layout; setParent ..; setParent ..; } setParent ..; setParent ..; } global proc AEedgePairReplace( string $plug ) { deleteUI edgeLayout; AEedgePairNew( $plug ); } global proc AEradiusNew( string $plug ) { // get the number of elements in this multi attribute // columnLayout "radiusLayout"; int $numRadii = `getAttr -size $plug`; string $fmt = (uiRes("m_AEroundConstantRadiusTemplate.kAttrFieldLabel")); int $i = 0; for( $i = 0; $i < $numRadii; $i++ ) { attrFieldSliderGrp -label (`format -s $i $fmt`) -at ($plug + "[" + $i + "]"); } } global proc AEradiusReplace( string $plug ) { deleteUI radiusLayout; AEradiusNew( $plug ); } global proc AEroundConstantRadiusTemplate ( string $nodeName ) { editorTemplate -beginScrollLayout; editorTemplate -beginLayout (uiRes("m_AEroundConstantRadiusTemplate.kRoundConstantRadius")) -collapse 0; // this will display each radius // editorTemplate -callCustom "AEradiusNew" "AEradiusReplace" "radius"; // this will display the tolerance // editorTemplate -addControl "tolerance"; // this will display each edgePair and its curve inputs // editorTemplate -callCustom "AEedgePairNew" "AEedgePairReplace" "edge"; // include/call base class/node attributes AEabstractBaseCreateTemplate $nodeName; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; // supress attributes so they will not show up in "Extra Atrributes" // editorTemplate -suppress "inputSurface"; editorTemplate -suppress "tolerance"; }