cwisbg

Get highest Group

Aug 19th, 2012
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. #cwisbg
  2. # Get highest Group
  3. """
  4.  
  5. or s.root()
  6.  
  7.  
  8. """
  9. from pymel.core import *
  10. sl=selected()
  11. def getHiGrp(s):
  12.     x = s
  13.     hiGrp = []
  14.     while x:
  15.         x = listRelatives(x, p=1)
  16.         hiGrp.append(x)
  17.     if len(hiGrp) < 2:
  18.         return s
  19.     else:
  20.         return hiGrp[-2]
  21. x = getHiGrp(sl[0])
Advertisement
Add Comment
Please, Sign In to add comment