fix for joining face selection after recent api change, also bmo_join_triangles_exec...
authorCampbell Barton <ideasman42@gmail.com>
Sat, 27 Jul 2013 06:11:54 +0000 (06:11 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 27 Jul 2013 06:11:54 +0000 (06:11 +0000)
source/blender/bmesh/operators/bmo_join_triangles.c
source/blender/editors/mesh/editmesh_tools.c

index 39f7b0953b1d2953d44d3bfb9b8c4b638398ccbc..30bf10e806590bd20ddf70dee6ee4ad73aa94350 100644 (file)
@@ -42,6 +42,8 @@
 
 #include "intern/bmesh_operators_private.h" /* own include */
 
+#define FACE_OUT (1 << 0)
+
 /* assumes edges are validated before reaching this poin */
 static float measure_facepair(const float v1[3], const float v2[3],
                               const float v3[3], const float v4[3], float limit)
@@ -212,7 +214,7 @@ void bmo_join_triangles_exec(BMesh *bm, BMOperator *op)
 
        BMIter iter, liter;
        BMOIter siter;
-       BMFace *f;
+       BMFace *f, *f_new;
        BMLoop *l;
        BMEdge *e;
        BLI_array_declare(jedges);
@@ -315,7 +317,10 @@ void bmo_join_triangles_exec(BMesh *bm, BMOperator *op)
 
 
                BM_edge_face_pair(e, &f1, &f2); /* checked above */
-               BM_faces_join_pair(bm, f1, f2, e, true);
+               f_new = BM_faces_join_pair(bm, f1, f2, e, true);
+               if (f_new) {
+                       BMO_elem_flag_enable(bm, f_new, FACE_OUT);
+               }
        }
 
        BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
@@ -349,9 +354,14 @@ void bmo_join_triangles_exec(BMesh *bm, BMOperator *op)
                                continue;
                        }
 
-                       BM_faces_join_pair(bm, f1, f2, e, true);
+                       f_new = BM_faces_join_pair(bm, f1, f2, e, true);
+                       if (f_new) {
+                               BMO_elem_flag_enable(bm, f_new, FACE_OUT);
+                       }
                }
        }
 
        BLI_array_free(jedges);
+
+       BMO_slot_buffer_from_enabled_flag(bm, op, op->slots_out, "faces.out", BM_FACE, FACE_OUT);
 }
index 3edf25d91bc82cf205f1bd9e050c2a4486d8e9cf..99638696ccd9b4d29625b4f1d10fc839be559cf3 100644 (file)
@@ -2945,9 +2945,11 @@ static int edbm_tris_convert_to_quads_exec(bContext *C, wmOperator *op)
        dovcols = RNA_boolean_get(op->ptr, "vcols");
        domaterials = RNA_boolean_get(op->ptr, "materials");
 
-       if (!EDBM_op_callf(em, op,
-                          "join_triangles faces=%hf limit=%f cmp_sharp=%b cmp_uvs=%b cmp_vcols=%b cmp_materials=%b",
-                          BM_ELEM_SELECT, limit, dosharp, douvs, dovcols, domaterials))
+       if (!EDBM_op_call_and_selectf(
+               em, op,
+               "faces.out", true,
+               "join_triangles faces=%hf limit=%f cmp_sharp=%b cmp_uvs=%b cmp_vcols=%b cmp_materials=%b",
+               BM_ELEM_SELECT, limit, dosharp, douvs, dovcols, domaterials))
        {
                return OPERATOR_CANCELLED;
        }