// =========================================================================== // 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. // =========================================================================== // // // Creation Date: November, 2005 // // Procedure Name: // AEdynamicConstraintTemplate // // Description Name; // Creates the attribute editor controls for the dynamic constraint Node // // Input Value: // nodeName // // Output Value: // None // global proc AEdynamicConstraintDimMethod( string $nodeName ) { editorTemplate -dimControl $nodeName "constraintRelation" true; int $cm = getAttr ($nodeName + ".constraintRelation"); // editorTemplate -dimControl $nodeName "weight" ($cm == 1); editorTemplate -dimControl $nodeName "connectionUpdate" ($cm == 0); editorTemplate -dimControl $nodeName "tangentStrength" ($cm == 0); editorTemplate -dimControl $nodeName "restLengthMethod" ($cm == 0); editorTemplate -dimControl $nodeName "restLengthScale" ($cm == 0); editorTemplate -dimControl $nodeName "localCollide" ($cm == 0); } global proc AEdynamicConstraintDimUpdate( string $nodeName ) { int $cm = getAttr ($nodeName + ".constraintMethod"); int $dim = ($cm == 0); if( !$dim ){ int $cu = getAttr ($nodeName + ".connectionUpdate"); $dim = ($cu == 0); } editorTemplate -dimControl $nodeName "friction" $dim; editorTemplate -dimControl $nodeName "singleSided" $dim; } global proc AEdynamicConstraintDimRestLength( string $nodeName ) { int $rl = getAttr ($nodeName + ".restLengthMethod"); editorTemplate -dimControl $nodeName "restLength" ($rl == 0); } global proc AEdynamicConstraintDimGlue( string $nodeName ) { float $gs = getAttr ($nodeName + ".glueStrength"); editorTemplate -dimControl $nodeName "glueStrengthScale" ($gs == 1.0); } global proc AEdynamicConstraintConMethod( string $nodeName ) { int $cm = getAttr ($nodeName + ".connectionMethod"); editorTemplate -dimControl $nodeName "maxDistance" ($cm != 1); editorTemplate -dimControl $nodeName "connectionDensity" ($cm != 1); editorTemplate -dimControl $nodeName "connectionDensityRange" ($cm != 1); } global proc AEdynamicConstraintDimBend( string $nodeName ) { float $bd = getAttr ($nodeName + ".bend"); editorTemplate -dimControl $nodeName "bendStrength" (!$bd); editorTemplate -dimControl $nodeName "bendBreakAngle" (!$bd); } global proc AEdynamicConstraintDimLocalCollide( string $nodeName ) { float $c = getAttr ($nodeName + ".localCollide"); editorTemplate -dimControl $nodeName "collideWidthScale" (!$c); } // //========================================================= // Procedure Name: AEdynamicConstraintTemplate // global proc AEdynamicConstraintTemplate ( string $nodeName ) { editorTemplate -beginScrollLayout; editorTemplate -addControl "enable"; editorTemplate -beginLayout (uiRes("m_AEdynamicConstraintTemplate.kDynamicConstraintAttributes")) -collapse 0; //editorTemplate -beginNoOptimize; editorTemplate -addControl "constraintMethod"; editorTemplate -addControl "constraintRelation" "AEdynamicConstraintDimMethod"; editorTemplate -addControl "componentRelation"; editorTemplate -addSeparator; editorTemplate -addControl "displayConnections"; editorTemplate -addControl "connectionMethod" "AEdynamicConstraintConMethod"; editorTemplate -addControl "maxDistance"; editorTemplate -addControl "connectionUpdate" "AEdynamicConstraintDimUpdate"; editorTemplate -addControl "connectWithinComponent"; editorTemplate -addControl "connectionDensity"; AEaddRampControl ($nodeName+".connectionDensityRange"); editorTemplate -addSeparator; editorTemplate -addControl "strength"; editorTemplate -addControl "tangentStrength"; editorTemplate -addSeparator; editorTemplate -addControl "glueStrength" "AEdynamicConstraintDimGlue"; editorTemplate -addControl "glueStrengthScale"; editorTemplate -addSeparator; editorTemplate -addControl "bend" "AEdynamicConstraintDimBend"; editorTemplate -addControl "bendStrength"; editorTemplate -addControl "bendBreakAngle"; editorTemplate -addSeparator; editorTemplate -addControl "force"; editorTemplate -addSeparator; // editorTemplate -addControl "weight"; editorTemplate -addControl "restLengthMethod" "AEdynamicConstraintDimRestLength"; editorTemplate -addControl "restLength"; editorTemplate -addControl "restLengthScale"; editorTemplate -addControl "motionDrag"; // editorTemplate -addControl "dropoff"; editorTemplate -addControl "dropoffDistance"; AEaddRampControl ($nodeName+".strengthDropoff"); editorTemplate -addControl "excludeCollisions"; editorTemplate -addControl "damp"; editorTemplate -addControl "localCollide" "AEdynamicConstraintDimLocalCollide"; editorTemplate -addControl "collideWidthScale"; editorTemplate -addControl "friction"; editorTemplate -addControl "singleSided"; editorTemplate -addControl "maxIterations"; editorTemplate -addControl "minIterations"; // editorTemplate -suppress "collisionFlag"; // editorTemplate -endNoOptimize; // the following to be removed after beta2 editorTemplate -suppress "iterations"; editorTemplate -suppress "collide"; // these attrs are obsolete, and have been made non-storable editorTemplate -suppress "isDynamic"; editorTemplate -suppress "dropoff"; // suppress all the attributes that dynamics likes to suppress AEdynBaseTemplate $nodeName; editorTemplate -suppress "componentIds"; editorTemplate -suppress "renderLayerInfo"; AElocatorCommon $nodeName; editorTemplate -endLayout; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; }