// =========================================================================== // 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: // AEikSystemTemplate // // Description Name; // Creates the attribute editor controls for the ikSystem node // // Input Value: // nodeName // // Output Value: // None // global proc AEikSystemTemplate( string $nodeName ) { editorTemplate -beginScrollLayout; editorTemplate -beginLayout (uiRes("m_AEikSystemTemplate.kIkSystem")) -collapse false; editorTemplate -callCustom "buildSolverPriorityList" "replaceSolverPriorityList"; editorTemplate -beginNoOptimize; editorTemplate -addControl "globalSnap"; editorTemplate -addControl "globalSolve"; editorTemplate -label (uiRes("m_AEikSystemTemplate.kLegacyIkFkBlend")) -addControl "preMaya2011IKFKBlend"; editorTemplate -endNoOptimize; editorTemplate -endLayout; // include/call base class/node attributes AEdependNodeTemplate $nodeName; editorTemplate -suppress "ikSolver"; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; } global proc buildSolverPriorityList() { textScrollList -nr 8 -ams false -sc "selectSolverItem" -dkc "unselectSolverItem" ikSolverList; ikListSolverTypes(); } global proc replaceSolverPriorityList() {} global proc ikListSolverTypes () { global string $solverList[]; global int $firstSelectedIndex; global int $totalItems; int $i; $solverList = `ikSystem -q -ls`; textScrollList -e -ra ikSolverList; $totalItems = size($solverList); for ( $i = 0; $i < $totalItems; $i++ ) { textScrollList -e -a $solverList[$i] ikSolverList; } $firstSelectedIndex = -1; textScrollList -e -da ikSolverList; setParent ..; } global proc selectSolverItem () { global string $solverList[]; global int $firstSelectedIndex; global int $totalItems; int $currentList[]; int $i; string $temp[]; $currentList = `textScrollList -q -sii ikSolverList`; $i = $currentList[0] - 1; $temp = `textScrollList -q -si ikSolverList`; $solverList = `ikSystem -q -ls`; if ( $temp[0] != $solverList[$i] ) { ikListSolverTypes (); return; } if ( $firstSelectedIndex == -1 ) { textScrollList -e -sii $currentList[0] ikSolverList; $firstSelectedIndex = $currentList[0] - 1; } else { $i = $currentList[0] - 1; ikSystem -e -ls $firstSelectedIndex $i; ikListSolverTypes (); } setParent ..; } global proc unselectSolverItem () { global int $firstSelectedIndex; $firstSelectedIndex = -1; textScrollList -e -da ikSolverList; setParent ..; }