// =========================================================================== // 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: Jan. 7, 1997 // // Description: initializes jointContext tool property sheet // values // // Input Arguments: // toolName - this is the name of the instance of the tool // that the property sheet is modifying. // // Return Value: // None. // global proc setJointRadiusControl (string $scaleCommandArg, string $toolName) { if (`optionVar -exists $scaleCommandArg`) { float $radiusControlVal = `optionVar -query $scaleCommandArg`; //jointCtx -edit ("-"+$scaleCommandArg) $radiusControlVal $toolName; } floatSliderGrp -edit -value `jointCtx -query ("-"+$scaleCommandArg) $toolName` ($scaleCommandArg+"Slider"); } global proc jointToolValues( string $toolName ) { string $parent = (`toolPropertyWindow -q -location` + "|jointTool"); setParent $parent; string $s; int $i; int $select; string $icon = "kinJoint.png"; string $helpTag = "JointTool"; toolPropertySetCommon $toolName $icon $helpTag; // Degrees of Freedom // string $dof = `jointCtx -q -dJ $toolName`; if ("" != match("none", $dof)) { checkBoxGrp -e -v1 off jpDofCheckBoxGrp; checkBoxGrp -e -v2 off jpDofCheckBoxGrp; checkBoxGrp -e -v3 off jpDofCheckBoxGrp; } else { if ("" != match("x", $dof)) { checkBoxGrp -e -v1 on jpDofCheckBoxGrp; } else { checkBoxGrp -e -v1 off jpDofCheckBoxGrp; } if ("" != match("y", $dof)) { checkBoxGrp -e -v2 on jpDofCheckBoxGrp; } else { checkBoxGrp -e -v2 off jpDofCheckBoxGrp; } if ("" != match("z", $dof)) { checkBoxGrp -e -v3 on jpDofCheckBoxGrp; } else { checkBoxGrp -e -v3 off jpDofCheckBoxGrp; } } { // Query the context for the current orient joint settings and ... string $ajo = `jointCtx -q -ajo $toolName`; string $sao = `jointCtx -q -sao $toolName`; // ... update the UI with these values. string $prev = `setParent -q`; setParent $parent; jointOrientSetOrientAxes( $parent, { $ajo, $sao } ); setParent $prev; } // scaleCompensate $select = `jointCtx -q -scJ $toolName`; checkBoxGrp -e -v1 $select scaleCompensate; // symmetry $symmetry = `jointCtx -q -sym $toolName`; string $symmetryAxis = `jointCtx -q -sa $toolName`; if ($symmetry && "" != match("x", $symmetryAxis)) { optionMenuGrp -e -sl 2 "jointSymmetrySettings"; } else if ($symmetry && "" != match("y", $symmetryAxis)) { optionMenuGrp -e -sl 3 "jointSymmetrySettings"; } else if ($symmetry && "" != match("z", $symmetryAxis)) { optionMenuGrp -e -sl 4 "jointSymmetrySettings"; } else { optionMenuGrp -e -sl 1 "jointSymmetrySettings"; } // autoLimits $select = `jointCtx -q -jal $toolName`; checkBoxGrp -e -v1 $select autoLimits; // createIKHandle $select = `jointCtx -q -ikh $toolName`; checkBoxGrp -e -v1 $select createIKHandle; frameLayout -e -en $select -cl ( !$select ) ikHandleFrame; setJointRadiusControl ("smallBoneLength") $toolName; setJointRadiusControl ("smallBoneRadius") $toolName; setJointRadiusControl ("largeBoneLength") $toolName; setJointRadiusControl ("largeBoneRadius") $toolName; // for ikHandleValues. // ikHandleOptionValues( $toolName, "jointCtx" ); //projected centering checkBoxGrp -e -v1 `snapMode -q -meshCenter` projectedCenteringSettings; // Variable bone size $select = `jointCtx -q -vbs $toolName`; checkBoxGrp -e -v1 $select variableBoneSettings; frameLayout -e -en $select -cl ( !$select ) boneRadiusFrame; toolPropertySelect jointTool; }