Bravlin

Untitled

Jun 4th, 2014
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.05 KB | None | 0 0
  1. # 2014.06.04 For hardcore XSI fans
  2. # Original .mel idea by 'jimtheartist'
  3. # Converted to python and edited by Bravlin Pechatnik
  4. # This script converts selected components with adjacent multiplication
  5. # First function call convert selected component, second call apply adjacent multiplication
  6. # Bind this pythone keys:
  7. # AdjacentConversion.ConvertToAdjacentVerts()
  8. # AdjacentConversion.ConvertToAdjacentEdges()
  9. # AdjacentConversion.ConvertToAdjacentFaces()
  10.  
  11. import maya.cmds as mc
  12.  
  13. def ConvertToAdjacentVerts():
  14.     sel = mc.ls(sl = True, fl = True)
  15.     mc.ConvertSelectionToEdges()
  16.     mc.ConvertSelectionToVertices()
  17.     mc.select(sel, d = True)
  18.  
  19.  
  20. def ConvertToAdjacentEdges():
  21.     sel = mc.ls(sl = True, fl = True)
  22.     selType= mc.filterExpand(sm=34)
  23.     if selType != None:
  24.         mc.ConvertSelectionToEdges()
  25.     else:
  26.         mc.ConvertSelectionToVertices()
  27.         mc.ConvertSelectionToEdges()
  28.         mc.select(sel, d = True)
  29.    
  30. def ConvertToAdjacentFaces():
  31.     sel = mc.ls(sl = True, fl = True)
  32.     mc.ConvertSelectionToEdges()
  33.     mc.ConvertSelectionToFaces()
  34.     mc.select(sel, d = True)
Advertisement
Add Comment
Please, Sign In to add comment