Advertisement
Guest User

Max Influence Selector - Maya Python by Mauricio Pachon

a guest
Jul 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.00 KB | None | 0 0
  1. import maya.cmds as cmds
  2.  
  3. '''Runs through a skin cluster and the selected vertices to find if any
  4. of them have more than a certain amount of joints influencing them, then
  5. lists them and selects them'''
  6.  
  7. #Skin cluster you want to check#
  8. sCluster = 'YourSkinClusterHere'
  9. #List anything that has above this value of influence#
  10. ammount = 0.001
  11. #List anything that has more than X ammount of influences#
  12. number = 4
  13.  
  14. aboveInfluence= []
  15. for s in cmds.ls(sl = True, fl = True):
  16.     #Runs through the selected vertices checking for the specified ammount#
  17.     influence = cmds.skinPercent(sCluster, s, ib = ammount, q = True, t = None)
  18.     if len(influence) > number:
  19.         #Puts all that have above X number of joints as influences in a list#
  20.         aboveInfluence.append(s)
  21.         print 'Vertex: ' + s + ' ' + 'No. of Influences: ' + str(len(influence)) + ' ' + 'Influences: ' + str(influence)
  22.  
  23. #Selects all vertices that have met the specified parameters#
  24. cmds.select(aboveInfluence)
  25. print aboveInfluence
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement