[Bf-extensions-cvs] [cc2e79bb] master: mesh edit tools, initial fix: T51483

meta-androcto noreply at git.blender.org
Mon May 15 16:04:54 CEST 2017


Commit: cc2e79bb382a8097481d2ff4763fc3ba7dc13689
Author: meta-androcto
Date:   Tue May 16 00:04:34 2017 +1000
Branches: master
https://developer.blender.org/rBAcc2e79bb382a8097481d2ff4763fc3ba7dc13689

mesh edit tools, initial fix: T51483

===================================================================

M	mesh_extra_tools/mesh_edge_roundifier.py
M	mesh_extra_tools/mesh_to_wall.py

===================================================================

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



More information about the Bf-extensions-cvs mailing list