// =========================================================================== // 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: // AEnComponentTemplate // // Description Name; // Creates the attribute editor controls for the nComponent Node // // Input Value: // nodeName // // Output Value: // None // global proc AEnCompMapTypeCB(string $node, string $attr) { string $mapAttr = ($attr+"Map"); string $mapTypeAttr = ($node+"."+$attr+"MapType"); int $mapVal = `getAttr $mapTypeAttr`; int $enableVal = ($mapVal == 2); if (`attrNavigationControlGrp -exists $mapAttr`) { attrNavigationControlGrp -edit -at ($node+"."+$mapAttr) -enable $enableVal $mapAttr; } } global proc AEnComponentDimElements( string $nodeName ) { int $el = getAttr( $nodeName + ".elements" ); editorTemplate -dimControl $nodeName "componentType" ($el == 0); editorTemplate -dimControl $nodeName "componentIndices" ($el != 0); } global proc AEnComponentDimCompType( string $nodeName ) { int $ct = getAttr( $nodeName + ".componentType" ); editorTemplate -dimControl $nodeName "tangentStrength" ($ct != 4); } global proc AEnComponentStrengthMapNew (string $attrName ) { setUITemplate -pst attributeEditorTemplate; attrNavigationControlGrp -label (uiRes("m_AEnComponentTemplate.kStrengthMap")) -at $attrName strengthMap; setUITemplate -ppt; } global proc AEnComponentStrengthMapReplace (string $attrName ) { attrNavigationControlGrp -edit -at $attrName strengthMap; string $nodeName = `plugNode $attrName`; AEnCompMapTypeCB($nodeName,"strength"); } global proc AEnComponentGlueStrengthMapNew (string $attrName ) { setUITemplate -pst attributeEditorTemplate; attrNavigationControlGrp -label (uiRes("m_AEnComponentTemplate.kGlueStrengthMap")) -at $attrName glueStrengthMap; setUITemplate -ppt; } global proc AEnComponentGlueStrengthMapReplace (string $attrName ) { attrNavigationControlGrp -edit -at $attrName glueStrengthMap; string $nodeName = `plugNode $attrName`; AEnCompMapTypeCB($nodeName,"glueStrength"); } global proc AEnComponentWeightMapNew (string $attrName ) { setUITemplate -pst attributeEditorTemplate; attrNavigationControlGrp -label (uiRes("m_AEnComponentTemplate.kWeightMap")) -at $attrName weightMap; setUITemplate -ppt; } global proc AEnComponentWeightMapReplace (string $attrName ) { attrNavigationControlGrp -edit -at $attrName weightMap; string $nodeName = `plugNode $attrName`; AEnCompMapTypeCB($nodeName,"strength"); } global proc AEstrengthMapCB(string $node) { AEnCompMapTypeCB($node,"strength"); } global proc AEglueStrengthMapCB(string $node) { AEnCompMapTypeCB($node,"glueStrength"); } global proc AEweightMapCB(string $node) { AEnCompMapTypeCB($node,"weight"); } // //========================================================= // Procedure Name: AEnComponentTemplate // global proc AEnComponentTemplate ( string $nodeName ) { editorTemplate -beginScrollLayout; editorTemplate -beginLayout (uiRes("m_AEnComponentTemplate.kNucleusComponentAttributes")) -collapse 0; editorTemplate -addControl "elements" "AEnComponentDimElements"; editorTemplate -addControl "componentType" "AEnComponentDimCompType"; editorTemplate -addSeparator; editorTemplate -addControl "strength"; editorTemplate -addControl "strengthMapType" "AEstrengthMapCB"; editorTemplate -callCustom "AEnComponentStrengthMapNew" "AEnComponentStrengthMapReplace" "strengthMap"; editorTemplate -addSeparator; editorTemplate -addControl "glueStrength"; editorTemplate -suppress "glueStrengthMap"; editorTemplate -addControl "glueStrengthMapType" "AEglueStrengthMapCB"; editorTemplate -callCustom "AEnComponentGlueStrengthMapNew" "AEnComponentGlueStrengthMapReplace" "strengthMap"; editorTemplate -addSeparator; editorTemplate -addControl "weight"; editorTemplate -addControl "weightMapType" "AEweightMapCB"; editorTemplate -callCustom "AEnComponentWeightMapNew" "AEnComponentWeightMapReplace" "weightMap"; editorTemplate -addSeparator; editorTemplate -addControl "tangentStrength"; editorTemplate -addControl "componentIndices"; editorTemplate -endLayout; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; }