// getConnectedJoints 1.0 // Author Gino Dammers - gdammers@xs4all.nl // // Description: Select all joints skinned to the selected Object. // // If you skin your objects using "Selected Joints" instead of "Complete Skeleton", this script // comes in handy when you want to detach a skinned object, add some modifications to the model // and reattach it later on. You would run the script which selects the joints for you.. // This selection you can add to a Quick Selection Set to be used later when you want to reattach the model // // Disclaimer: Use at your own risk // global proc getConnectedJoints() { string $selected[] = `ls -sl`; if (size($selected) == 0) error "Select something first"; else { if (size($selected) > 1) { print ("Script works only on 1 object.. Resuming on first selected > " + $selected[0] + " <...\n"); } string $shapes[] = `listRelatives -shapes $selected[0]`; string $meshes[] = `ls -type "mesh" $shapes`; string $skinClusters[] = `listConnections -t skinCluster $meshes[0]`; if (size($skinClusters) == 0) { error (" > " + $selected[0] + " < Is not attached to any bones... Aborting\n"); } else { string $joints[] = `listConnections -t "transform" $skinClusters[0]`; select -r $joints; } } }