From cc2e79bb382a8097481d2ff4763fc3ba7dc13689 Mon Sep 17 00:00:00 2001 From: meta-androcto Date: Tue, 16 May 2017 00:04:34 +1000 Subject: mesh edit tools, initial fix: T51483 --- mesh_extra_tools/mesh_edge_roundifier.py | 4 ++++ mesh_extra_tools/mesh_to_wall.py | 12 +++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/mesh_extra_tools/mesh_edge_roundifier.py b/mesh_extra_tools/mesh_edge_roundifier.py index 52f7cadf..00b5c4b9 100644 --- a/mesh_extra_tools/mesh_edge_roundifier.py +++ b/mesh_extra_tools/mesh_edge_roundifier.py @@ -628,6 +628,10 @@ class EdgeRoundifier(Operator): bpy.ops.object.mode_set(mode='OBJECT') bm.to_mesh(mesh) bpy.ops.object.mode_set(mode='EDIT') + bpy.ops.mesh.select_all(action='TOGGLE') + bpy.ops.mesh.select_all(action='INVERT') + bpy.ops.mesh.remove_doubles() + bm.free() return {'FINISHED'} diff --git a/mesh_extra_tools/mesh_to_wall.py b/mesh_extra_tools/mesh_to_wall.py index 51d82f22..bc6c753b 100644 --- a/mesh_extra_tools/mesh_to_wall.py +++ b/mesh_extra_tools/mesh_to_wall.py @@ -72,6 +72,7 @@ def turn_left(bm, v1, v2, vm, wm): verts = qq_sort(bm, links[-1], vm, wm) v = verts.index(links[-2]) + if v == 0: v_nxt = verts[-1] else: @@ -191,13 +192,18 @@ class MeshtoWall(Operator): return True def execute(self, context): + # Note: the remove_doubles called after bmesh creation would make + # blender crash with certain meshes - keep it in mind for the future + bpy.ops.mesh.remove_doubles(threshold=0.003) # <<< Remove doubles is called from here bpy.ops.object.mode_set(mode='OBJECT') if self.check_vert(context): bpy.ops.object.mode_set(mode='EDIT') ob = bpy.context.object - bm = bmesh.from_edit_mesh(ob.data) - bmesh.ops.remove_doubles(bm, verts=bm.verts, dist=0.003) - bmesh.ops.delete(bm, geom=bm.faces, context=3) + + me = ob.data + bm = bmesh.from_edit_mesh(me) + bpy.ops.mesh.delete(type='ONLY_FACE') + context.tool_settings.mesh_select_mode = (True, True, False) v3d = context.space_data -- cgit v1.2.3