// =========================================================================== // 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: // toggleHikFKskeleton // // Description: // Display or hide the FK skeleton associated with the selected // Full-body IK (FBIK) effector or joint. // global proc toggleHikFKskeleton() // // Display or hide the FK skeleton based on the selected // hikEffectors and joints. // { string $jts[] = `ls -sl -type joint`; string $effs[] = `ls -sl -type hikEffector`; if (size($jts) == 0 && size($effs) == 0) { error((uiRes("m_toggleHikFKskeleton.kMustSelectFbik"))); } source loadFullBodyIKFunctions.mel; string $moreEffs[] = getEffectorsForJoints($jts); for ($eff in $moreEffs) { $effs[size($effs)] = $eff; } string $fkJoints[] = getFKJointsForEffectors($effs); string $parents[] = getParentsForFKJoints($fkJoints); // Toggle the visibility for all the joints below the specified parent for ($parentObj in $parents) { string $allFKjts[] = `ls -dag -type joint $parentObj`; if (size($allFKjts) > 0) { int $display = `getAttr ($allFKjts[0]+".visibility")`; $display = !$display; for ($fkj in $allFKjts) { setAttr ($fkj+".visibility") $display; } } } }