// =========================================================================== // 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: // AEspringTemplate // // Description Name; // Creates the attribute editor controls for spring Node // // Input Value: // nodeName // // Output Value: // None // global proc AEperSpringNew ( string $nodeAttr) { setUITemplate -pst attributeEditorTemplate; rowLayout -nc 1; button -label (uiRes("m_AEspringTemplate.kComponentEditor")) dynSpringCompEd; setParent ..; setUITemplate -ppt; AEperSpringReplace($nodeAttr); } global proc AEperSpringReplace ( string $nodeAttr ) { // $nodeAttr = nodeName.attrName. // string $names[]; tokenize($nodeAttr, ".", $names); // Set the per spring button callbacks. // button -e -c "componentEditorWindow" dynSpringCompEd; } // // Procedure Name: // AEspringTemplate // global proc AEspringTemplate ( string $nodeName ) { editorTemplate -beginScrollLayout; editorTemplate -beginLayout (uiRes("m_AEspringTemplate.kAttributes")) -collapse 0; editorTemplate -beginNoOptimize; editorTemplate -label (uiRes("m_AEspringTemplate.kStiffness")) -addControl "useStiffnessPS"; editorTemplate -label (uiRes("m_AEspringTemplate.kDamping")) -addControl "useDampingPS"; editorTemplate -label (uiRes("m_AEspringTemplate.kRestLength")) -addControl "useRestLengthPS"; editorTemplate -endNoOptimize; editorTemplate -addControl "stiffness"; editorTemplate -addControl "damping"; editorTemplate -addControl "restLength"; editorTemplate -addControl "end1Weight"; editorTemplate -addControl "end2Weight"; editorTemplate -addControl "count"; editorTemplate -addControl "manageParticleDeath"; editorTemplate -suppress "objectPositions"; editorTemplate -suppress "objectVelocities"; editorTemplate -suppress "objectMass"; editorTemplate -suppress "deltaTime"; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AEspringTemplate.kPPAttributes")) -collapse false; editorTemplate -callCustom "AEperSpringNew" "AEperSpringReplace" "stiffnessPS"; editorTemplate -suppress "dampingPS"; editorTemplate -suppress "restLengthPS"; editorTemplate -endLayout; // include/call base class/node attributes // AEshapeTemplate $nodeName; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; }