Advertisement
Guest User

Untitled

a guest
Aug 27th, 2014
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. import bpy
  2. import sys
  3. import os.path
  4.  
  5. try:
  6. outfile = open('vertgroup_mapping.txt', 'w')
  7. activeO = bpy.context.selected_objects[0]
  8. outfile.write("# MH Mesh vertex mapping for "+activeO.data.name +"n")
  9. idx = 0
  10. for g in activeO.vertex_groups:
  11. outfile.write("vertgroup "+ str(idx) +" "+ g.name +"n")
  12. idx = idx +1
  13. outfile.write("n")
  14. idx = 0
  15. for v in activeO.data.vertices:
  16. line = str(idx) + "t"
  17. for g in v.groups:
  18. line = line + str(g.group) + " "
  19. outfile.write(line + "n")
  20. idx = idx +1
  21. outfile.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement