Skip to content

Instantly share code, notes, and snippets.

@coxevan
Last active August 29, 2015 14:21
Show Gist options
  • Save coxevan/1485a560a33c527eaab3 to your computer and use it in GitHub Desktop.
Save coxevan/1485a560a33c527eaab3 to your computer and use it in GitHub Desktop.
import pymel.core
SKIN_CLUSTER_NAME = 'skinCluster1' # <-- Replace with 'name_of_my_skincluster' but keep the quotes!
# Get the skin cluster from the shape node
skin_cluster = pymel.core.PyNode(SKIN_CLUSTER_NAME)
# Get the objects associated with that skincluster (mostly bones)
influence_list = skin_cluster.influenceObjects()
# Print that to the display and the script editor
print_string = 'Objects (bones) associated with {0} : {1}'.format( skin_cluster.name(), len( influence_list ) )
pymel.core.headsUpMessage( print_string )
print print_string
bone_list_string = '\nBones Associated : START-------- \n '
for bone in influence_list:
bone_list_string = bone_list_string + bone + '\n'
print bone_list_string + '\nBone Associated : END--------'
@coxevan
Copy link
Author

coxevan commented May 24, 2015

Replace skinCluster1 within the quotes with whatever the name of your skin cluster is. You can easily find that in the channel box with the mesh selected. It should be skinCluster1 by default, so unless you changed it, this script should be good to run out of the box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment