diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-12-13 11:42:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-12-13 11:55:21 +0300 |
commit | fa4a9c7ae61c5fcfdb08384f6f8e28b7fe090662 (patch) | |
tree | 34105cc104cc56374ad18f461a32a8e111c0eaaa /source/blender/bmesh | |
parent | e47397c7d2c4468233979ef93f404df2f0d3c164 (diff) |
BMesh: don't use total faces to detect edits
Possible a boolean operation edits the mesh while keeping the same number of faces.
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r-- | source/blender/bmesh/tools/bmesh_intersect.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/bmesh/tools/bmesh_intersect.c b/source/blender/bmesh/tools/bmesh_intersect.c index e9642bedba6..e177af9df91 100644 --- a/source/blender/bmesh/tools/bmesh_intersect.c +++ b/source/blender/bmesh/tools/bmesh_intersect.c @@ -963,9 +963,11 @@ bool BM_mesh_intersect( const float eps) { struct ISectState s; - bool has_isect; const int totface_orig = bm->totface; + /* use to check if we made any changes */ + bool has_edit_isect = false, has_edit_boolean = false; + /* needed for boolean, since cutting up faces moves the loops within the face */ const float **looptri_coords = NULL; @@ -1603,6 +1605,8 @@ bool BM_mesh_intersect( BM_face_normal_flip(bm, ftable[groups_array[fg]]); } } + + has_edit_boolean |= (do_flip || do_remove); } MEM_freeN(groups_array); @@ -1659,7 +1663,7 @@ bool BM_mesh_intersect( } } - has_isect = (BLI_ghash_size(s.face_edges) != 0); + has_edit_isect = (BLI_ghash_size(s.face_edges) != 0); /* cleanup */ BLI_ghash_free(s.edgetri_cache, NULL, NULL); @@ -1670,5 +1674,5 @@ bool BM_mesh_intersect( BLI_memarena_free(s.mem_arena); - return has_isect || (totface_orig != bm->totface); + return (has_edit_isect || has_edit_boolean); } |