// =========================================================================== // 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: // AErigidSolverTemplate // // Description Name; // Creates the attribute editor controls for the rigidSolver node // // Input Value: // nodeName // // Output Value: // None // global proc AErigidSolverDeleteCacheNew ( string $isDataCached ) { string $nodeName[]; tokenize($isDataCached, ".", $nodeName); setUITemplate -pst attributeEditorTemplate; rowLayout -nc 2 rigidSolverDeleteCacheRow; text -label (uiRes("m_AErigidSolverTemplate.kDeleteCache")) ; button -label (uiRes("m_AErigidSolverTemplate.kDelete")) rigidSolverDeleteChacheButton; setParent ..; setUITemplate -ppt; AErigidSolverDeleteCacheReplace $isDataCached; } global proc AErigidSolverDeleteCacheReplace ( string $isDataCached ) { string $nodeName[]; tokenize($isDataCached, ".", $nodeName); button -e -c ("rigidSolver -e -deleteCache " + $nodeName[0]) rigidSolverDeleteChacheButton; setParent ..; } global proc checkRigidSolverIsDataCached ( string $nodeName ) { int $isDataCachedValue = `getAttr ($nodeName + ".cacheData")`; if ( $isDataCachedValue ) { if (`rowLayout -exists rigidSolverDeleteCacheRow`) rowLayout -e -en 1 rigidSolverDeleteCacheRow; } else { if (`rowLayout -exists rigidSolverDeleteCacheRow`) rowLayout -e -en 0 rigidSolverDeleteCacheRow; } } global proc AErigidSolverTemplate( string $nodeName ) { editorTemplate -beginScrollLayout; editorTemplate -beginLayout (uiRes("m_AErigidSolverTemplate.kRigidSolverAttributes")) -collapse false; editorTemplate -addControl "stepSize"; editorTemplate -addControl "collisionTolerance"; editorTemplate -addControl "scaleVelocity"; editorTemplate -addControl "startTime"; editorTemplate -addControl "currentTime"; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AErigidSolverTemplate.kRigidSolverMethods")) -collapse false; editorTemplate -addControl "solverMethod"; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AErigidSolverTemplate.kRigidSolverStates")) -collapse true; editorTemplate -beginNoOptimize; editorTemplate -addControl "state"; editorTemplate -addControl "friction"; editorTemplate -addControl "bounciness"; editorTemplate -label (uiRes("m_AErigidSolverTemplate.kContactMotion")) -addControl "dynamics"; editorTemplate -addControl "contactData"; editorTemplate -addControl "allowDisconnection"; editorTemplate -addSeparator; editorTemplate -addControl "cacheData" "checkRigidSolverIsDataCached"; editorTemplate -callCustom "AErigidSolverDeleteCacheNew" "AErigidSolverDeleteCacheReplace" "cacheData"; editorTemplate -endNoOptimize; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AErigidSolverTemplate.kRigidSolverDisplayOptions")) -collapse true; editorTemplate -beginNoOptimize; editorTemplate -addControl "displayConstraint"; editorTemplate -addControl "displayCenterOfMass"; editorTemplate -addControl "displayVelocity"; editorTemplate -addControl "displayLabel"; editorTemplate -endNoOptimize; editorTemplate -endLayout; // include/call base class/node attributes AEdependNodeTemplate $nodeName; editorTemplate -suppress "interpenetrate"; editorTemplate -suppress "autoSolverTolerances"; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; }