// =========================================================================== // 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. 6, 1997 // // Description: initializes ik handle portion of 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 ikHandleOptionValues( string $toolName, string $ctxCmd ) { string $current; int $set; int $autoPriorityFlag; // current solver (option menu) string $solvertype = eval($ctxCmd + " -q -solverTypeH " + $toolName); string $solverItems[] = `optionMenuGrp -q -ils ikHandleOptionMenu`; string $menuItemValue; int $i; for( $i = 0; $i < size($solverItems); $i++ ) { $menuItemValue = ikSolverUnlocalize(`menuItem -q -l $solverItems[$i]`); if ($menuItemValue == $solvertype) optionMenuGrp -e -sl ($i+1) ikHandleOptionMenu; } clear($solverItems); // auto priority check box // $set = eval($ctxCmd + " -q -autoPriorityH " + $toolName); if ($set) { checkBoxGrp -e -value1 1 autoPriorityGrp; $autoPriorityFlag = false; } else { checkBoxGrp -e -value1 0 autoPriorityGrp; $autoPriorityFlag = true; } // snap handle $set = eval($ctxCmd + " -q -snapHandleH " + $toolName); if ($set) { checkBoxGrp -e -value1 1 snapHandleGrp; } else { checkBoxGrp -e -value1 0 snapHandleGrp; } // force solver $set = eval($ctxCmd + " -q -forceSolverH " + $toolName); if ($set) { checkBoxGrp -e -value1 1 forceSolverGrp; } else { checkBoxGrp -e -value1 0 forceSolverGrp; } //===================================================== // For maya1.0, there is not superSticky yet. So in UI, // use checkBox to turn on/off sticky. // // Use radioButtonGrp when implementing superSticky. //===================================================== // stickies $current = eval($ctxCmd + " -q -stickyH " + $toolName); if ($current == "sticky") { //radioButtonGrp -e -select 2 stickyGrp; checkBoxGrp -e -value1 1 stickyGrp; } //else if ($current == "superSticky") { // radioButtonGrp -e -select 3 stickyGrp; //} else { //radioButtonGrp -e -select 1 stickyGrp; checkBoxGrp -e -value1 0 stickyGrp; } // priority $set = eval($ctxCmd + " -q -priorityH " + $toolName); intSliderGrp -e -value $set -enable $autoPriorityFlag priority; // weight $fv = eval($ctxCmd + " -q -weightH " + $toolName); floatSliderGrp -e -value $fv handleWeight; // poweight $fv = eval($ctxCmd + " -q -poWeightH " + $toolName); floatSliderGrp -e -value $fv handlePOWeight; return; }