// =========================================================================== // 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: // doRemoveJoint // // Description: // Removes a joint from a skeleton hierarchy, regardless of whether // the skeleton is currently bound to a skin or not. // // Return Value: // none // global proc doRemoveJoint() { string $sl[] = `ls -sl -type joint`; if (size($sl) == 0) { error( (uiRes("m_doRemoveJoint.kSelectAJointToRemove"))); } int $count = 0; for ($obj in $sl) { string $worldMatrixPlug = $obj + ".worldMatrix"; string $skinClusters[] = `listConnections -type skinCluster $worldMatrixPlug`; for($sCluster in $skinClusters) { skinCluster -e -ri $obj $sCluster; } string $bindPoses[] = `dagPose -q -name -bp $obj`; if(size($bindPoses)>0) { for($bindPose in $bindPoses) { dagPose -rm -reset $obj $bindPose; } } removeJoint $obj; } }