BMesh: ignore non-manifold face connections
authorCampbell Barton <ideasman42@gmail.com>
Wed, 11 May 2016 20:00:05 +0000 (06:00 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 11 May 2016 20:00:05 +0000 (06:00 +1000)
Was showing an error message,
now dissolve the faces that and delimit at non-manifold boundaries.

source/blender/bmesh/operators/bmo_dissolve.c

index c8dff4a8598da35c21e38d35261370e7cebdc78e..52814a82b2f48e9e67e8086b73505ceae2c07063 100644 (file)
@@ -43,6 +43,7 @@
 #define FACE_MARK   1
 #define FACE_ORIG   2
 #define FACE_NEW    4
+#define FACE_TAG    8
 
 #define EDGE_MARK   1
 #define EDGE_TAG    2
@@ -156,19 +157,19 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op)
                }
        }
 
-       BMO_slot_buffer_flag_enable(bm, op->slots_in, "faces", BM_FACE, FACE_MARK);
+       BMO_slot_buffer_flag_enable(bm, op->slots_in, "faces", BM_FACE, FACE_MARK | FACE_TAG);
        
        /* collect region */
        BMO_ITER (f, &oiter, op->slots_in, "faces", BM_FACE) {
                BMFace *f_iter;
-               if (!BMO_elem_flag_test(bm, f, FACE_MARK)) {
+               if (!BMO_elem_flag_test(bm, f, FACE_TAG)) {
                        continue;
                }
 
                BLI_array_empty(faces);
                faces = NULL; /* forces different allocatio */
 
-               BMW_init(&regwalker, bm, BMW_ISLAND,
+               BMW_init(&regwalker, bm, BMW_ISLAND_MANIFOLD,
                         BMW_MASK_NOP, BMW_MASK_NOP, FACE_MARK,
                         BMW_FLAG_NOP, /* no need to check BMW_FLAG_TEST_HIDDEN, faces are already marked by the bmo */
                         BMW_NIL_LAY);
@@ -180,7 +181,7 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op)
                
                for (i = 0; i < BLI_array_count(faces); i++) {
                        f_iter = faces[i];
-                       BMO_elem_flag_disable(bm, f_iter, FACE_MARK);
+                       BMO_elem_flag_disable(bm, f_iter, FACE_TAG);
                        BMO_elem_flag_enable(bm, f_iter, FACE_ORIG);
                }