// =========================================================================== // 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: // jointTemplateUtils // // Description: // Utility procs used by AEjointTemplace and AEhikFKJointTemplace // // global proc setJointDOFState ( string $attrJointTypeX, string $attrJointTypeY, string $attrJointTypeZ ) { string $setX; string $setY; string $setZ; string $XYZ; string $nodeName[]; tokenize ($attrJointTypeX, ".", $nodeName); int $jointTypeX = `getAttr $attrJointTypeX`; int $jointTypeY = `getAttr $attrJointTypeY`; int $jointTypeZ = `getAttr $attrJointTypeZ`; // assign the corresponding strings for the joint types if ( $jointTypeX ) $setX = "x"; if ( $jointTypeY ) $setY = "y"; if ( $jointTypeZ ) $setZ = "z"; // put the three values together to be able to excute // the command correctly $XYZ = ( $setX + $setY + $setZ ); // execute the command to lock specific attributes // and manip handles joint -e -dof $XYZ $nodeName[0]; } // // Procedure Name: // AEjointTypeReplace // // global proc AEjointTypeReplace ( string $attrJointTypeX, string $attrJointTypeY, string $attrJointTypeZ ) { connectControl jointTypeBoxes -index 2 $attrJointTypeX; connectControl jointTypeBoxes -index 3 $attrJointTypeY; connectControl jointTypeBoxes -index 4 $attrJointTypeZ; checkBoxGrp -e -cc ("setJointDOFState " + $attrJointTypeX + " " + $attrJointTypeY + " " + $attrJointTypeZ) jointTypeBoxes; } // // Procedure Name: // AEjointTypeNew // // global proc AEjointTypeNew ( string $attrJointTypeX, string $attrJointTypeY, string $attrJointTypeZ ) { checkBoxGrp -ncb 3 -label (uiRes("m_jointTemplateUtils.kDegreesofFreedom")) -label1 (uiRes("m_jointTemplateUtils.kX")) -label2 (uiRes("m_jointTemplateUtils.kY")) -label3 (uiRes("m_jointTemplateUtils.kZ")) jointTypeBoxes; connectControl jointTypeBoxes -index 2 $attrJointTypeX; connectControl jointTypeBoxes -index 3 $attrJointTypeY; connectControl jointTypeBoxes -index 4 $attrJointTypeZ; checkBoxGrp -e -cc ("setJointDOFState " + $attrJointTypeX + " " + $attrJointTypeY + " " + $attrJointTypeZ) jointTypeBoxes; } global proc AEminRotateDampRangeNew( string $attrName ) { setUITemplate -pst attributeEditorTemplate; attrFieldGrp -attribute $attrName -label (uiRes("m_jointTemplateUtils.kMinDampRange")) minRotateDampRangeGrp; setUITemplate -ppt; } global proc AEminRotateDampRangeReplace( string $attrName ) { attrFieldGrp -e -attribute $attrName -label (uiRes("m_jointTemplateUtils.kMinDampRange2")) minRotateDampRangeGrp; } global proc AEmaxRotateDampRangeNew( string $attrName ) { setUITemplate -pst attributeEditorTemplate; attrFieldGrp -attribute $attrName -label (uiRes("m_jointTemplateUtils.kMaxDampRange")) maxRotateDampRangeGrp; setUITemplate -ppt; } global proc AEmaxRotateDampRangeReplace( string $attrName ) { attrFieldGrp -e -attribute $attrName -label (uiRes("m_jointTemplateUtils.kMaxDampRange2")) maxRotateDampRangeGrp; } global proc AEminRotateDampStrengthNew( string $attrName ) { setUITemplate -pst attributeEditorTemplate; attrFieldGrp -attribute $attrName -label (uiRes("m_jointTemplateUtils.kMinDampStrength")) minRotateDampStrengthGrp; setUITemplate -ppt; } global proc AEminRotateDampStrengthReplace( string $attrName ) { attrFieldGrp -e -attribute $attrName -label (uiRes("m_jointTemplateUtils.kMinDampStrength2")) minRotateDampStrengthGrp; } global proc AEmaxRotateDampStrengthNew( string $attrName ) { setUITemplate -pst attributeEditorTemplate; attrFieldGrp -attribute $attrName -label (uiRes("m_jointTemplateUtils.kMaxDampStrength")) maxRotateDampStrengthGrp; setUITemplate -ppt; } global proc AEmaxRotateDampStrengthReplace( string $attrName ) { attrFieldGrp -e -attribute $attrName -label (uiRes("m_jointTemplateUtils.kMaxDampStrength2")) maxRotateDampStrengthGrp; } global proc checkPuppetPartOther( string $nodeName ) { int $val = `getAttr ($nodeName+".type")`; int $dimOther = ($val != 18); editorTemplate -dimControl $nodeName "otherType" $dimOther; }