Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. import bpy
  2. import bmesh
  3.  
  4. # go into edit mode
  5. bpy.ops.object.mode_set(mode='EDIT')
  6.  
  7. # deselect everything
  8. bpy.ops.mesh.select_all(action='DESELECT')
  9.  
  10. # Get the active mesh
  11. obj = bpy.context.edit_object
  12. me = obj.data
  13.  
  14. # force face select mode
  15. bpy.context.tool_settings.mesh_select_mode = (False, True, False)
  16.  
  17. # Get a BMesh representation
  18. bm = bmesh.from_edit_mesh(me)
  19.  
  20. count = 0
  21. # find every second face and select the first edge
  22. for face in bm.faces:
  23. if (count % 2) == 0:
  24. edge=face.edges[0]
  25. edge.select_set(True)
  26. count = count+1
  27.  
  28. # dissolve edges
  29. bpy.ops.mesh.dissolve_edges(use_verts=False)
  30.  
  31. # deselect everything
  32. bpy.ops.mesh.select_all(action='DESELECT')
  33.  
  34. # Show the updates in the viewport
  35. bmesh.update_edit_mesh(me, True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement