Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import bpy
- import bmesh
- # go into edit mode
- bpy.ops.object.mode_set(mode='EDIT')
- # deselect everything
- bpy.ops.mesh.select_all(action='DESELECT')
- # Get the active mesh
- obj = bpy.context.edit_object
- me = obj.data
- # force face select mode
- bpy.context.tool_settings.mesh_select_mode = (False, True, False)
- # Get a BMesh representation
- bm = bmesh.from_edit_mesh(me)
- count = 0
- # find every second face and select the first edge
- for face in bm.faces:
- if (count % 2) == 0:
- edge=face.edges[0]
- edge.select_set(True)
- count = count+1
- # dissolve edges
- bpy.ops.mesh.dissolve_edges(use_verts=False)
- # deselect everything
- bpy.ops.mesh.select_all(action='DESELECT')
- # Show the updates in the viewport
- bmesh.update_edit_mesh(me, True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement