Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-07-25 14:37:10 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-07-25 14:37:10 +0400
commite0b24a113fdb30fc1dd2ba8ab97333c40fe823c2 (patch)
tree88a8e99d08b10c05d61d856c03ad8b15f51f16af /object_fracture_cell
parent282456e8b1b5e6494433337961570bbba649a6d2 (diff)
remove doubles after booleans
Diffstat (limited to 'object_fracture_cell')
-rw-r--r--object_fracture_cell/fracture_cell_setup.py43
1 files changed, 25 insertions, 18 deletions
diff --git a/object_fracture_cell/fracture_cell_setup.py b/object_fracture_cell/fracture_cell_setup.py
index c26994f1..36e8691f 100644
--- a/object_fracture_cell/fracture_cell_setup.py
+++ b/object_fracture_cell/fracture_cell_setup.py
@@ -312,6 +312,7 @@ def cell_fracture_boolean(scene, obj, objects,
use_interior_hide=False,
use_debug_redraw=False,
level=0,
+ remove_doubles=True
):
objects_boolean = []
@@ -350,22 +351,29 @@ def cell_fracture_boolean(scene, obj, objects,
mesh_new = None
# avoid unneeded bmesh re-conversion
- bm = None
-
- if clean and mesh_new:
- if bm is None: # ok this will always be true for now...
- bm = bmesh.new()
- bm.from_mesh(mesh_new)
- bm.normal_update()
- try:
- bmesh.ops.dissolve_limit(bm, verts=bm.verts, edges=bm.edges, angle_limit=0.001)
- except RuntimeError:
- import traceback
- traceback.print_exc()
-
- if bm is not None:
- bm.to_mesh(mesh_new)
- bm.free()
+ if mesh_new is not None:
+ bm = None
+
+ if clean:
+ if bm is None: # ok this will always be true for now...
+ bm = bmesh.new()
+ bm.from_mesh(mesh_new)
+ bm.normal_update()
+ try:
+ bmesh.ops.dissolve_limit(bm, verts=bm.verts, edges=bm.edges, angle_limit=0.001)
+ except RuntimeError:
+ import traceback
+ traceback.print_exc()
+
+ if remove_doubles:
+ if bm is None:
+ bm = bmesh.new()
+ bm.from_mesh(mesh_new)
+ bmesh.ops.remove_doubles(bm, verts=bm.verts, dist=0.005)
+
+ if bm is not None:
+ bm.to_mesh(mesh_new)
+ bm.free()
del mesh_new
del mesh_old
@@ -429,8 +437,7 @@ def cell_fracture_interior_handle(objects,
for bm_edge in bm.edges:
if len({bm_face.hide for bm_face in bm_edge.link_faces}) == 2:
bm_edge.smooth = False
-
-
+
if use_sharp_edges_apply:
edges = [edge for edge in bm.edges if edge.smooth is False]
if edges: