BMesh: correct flag use
authorCampbell Barton <ideasman42@gmail.com>
Thu, 21 Aug 2014 02:57:03 +0000 (12:57 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 21 Aug 2014 03:08:13 +0000 (13:08 +1000)
Allowed fill to make duplicate faces

source/blender/bmesh/intern/bmesh_mods.c
source/blender/bmesh/intern/bmesh_polygon.c
source/blender/bmesh/operators/bmo_poke.c
source/blender/bmesh/operators/bmo_primitive.c
source/blender/bmesh/operators/bmo_triangulate.c
source/blender/bmesh/tools/bmesh_wireframe.c
source/blender/editors/mesh/mesh_navmesh.c

index 56f380b4554931d1d0766fde1d5e3259248f25e2..6e8591da0f3dc747cdff98d40113c3f7e26ead38 100644 (file)
@@ -819,7 +819,9 @@ bool BM_face_split_edgenet(
 
        while ((v = STACK_POP(vert_queue))) {
                if (bm_face_split_edgenet_find_loop(v, f->no, edge_order, edge_order_len, face_verts, &face_verts_len)) {
-                       BMFace *f_new = BM_face_create_verts(bm, face_verts, face_verts_len, f, 0, false);
+                       BMFace *f_new;
+
+                       f_new = BM_face_create_verts(bm, face_verts, face_verts_len, f, BM_CREATE_NOP, false);
 
                        for (i = 0; i < edge_net_len; i++) {
                                BLI_assert(BM_ELEM_API_FLAG_TEST(edge_net[i], EDGE_NET));
index 307c391a406a81a0a3f11d84097930ba58a42514..9a0fce9dba07f5d88ff99cd480a3d90d99951215 100644 (file)
@@ -854,7 +854,7 @@ void BM_face_triangulate(BMesh *bm, BMFace *f,
                            l_tri[1]->v,
                            l_tri[2]->v};
 
-                       f_new = BM_face_create_verts(bm, v_tri, 3, f, false, true);
+                       f_new = BM_face_create_verts(bm, v_tri, 3, f, BM_CREATE_NOP, true);
                        l_new = BM_FACE_FIRST_LOOP(f_new);
 
                        BLI_assert(v_tri[0] == l_new->v);
index 26f206564784f04643bf354fe814426a1bc05a4e..363e395e082b1ca212d23fda0e0812833f77a253 100644 (file)
@@ -101,7 +101,7 @@ void bmo_poke_exec(BMesh *bm, BMOperator *op)
                do {
                        BMLoop *l_new;
 
-                       f_new = BM_face_create_quad_tri(bm, l_iter->v, l_iter->next->v, v_center, NULL, f, false);
+                       f_new = BM_face_create_quad_tri(bm, l_iter->v, l_iter->next->v, v_center, NULL, f, BM_CREATE_NOP);
                        l_new = BM_FACE_FIRST_LOOP(f_new);
 
                        if (i == 0) {
index f0e31b78ca06bd9debedfb00e6a5746b9cec204d..e69dcca63420f7ba4339ea437b40ee48ce96a1a5 100644 (file)
@@ -405,7 +405,7 @@ void bmo_create_icosphere_exec(BMesh *bm, BMOperator *op)
                v2 = eva[icoface[a][1]];
                v3 = eva[icoface[a][2]];
 
-               eftemp = BM_face_create_quad_tri(bm, v1, v2, v3, NULL, NULL, false);
+               eftemp = BM_face_create_quad_tri(bm, v1, v2, v3, NULL, NULL, BM_CREATE_NOP);
                
                BM_ITER_ELEM (l, &liter, eftemp, BM_LOOPS_OF_FACE) {
                        BMO_elem_flag_enable(bm, l->e, EDGE_MARK);
@@ -476,14 +476,14 @@ void bmo_create_monkey_exec(BMesh *bm, BMOperator *op)
                                        tv[monkeyf[i][1] + i - monkeyo],
                                        tv[monkeyf[i][2] + i - monkeyo],
                                        (monkeyf[i][3] != monkeyf[i][2]) ? tv[monkeyf[i][3] + i - monkeyo] : NULL,
-                                       NULL, false);
+                                       NULL, BM_CREATE_NOP);
 
                BM_face_create_quad_tri(bm,
                                        tv[monkeynv + monkeyf[i][2] + i - monkeyo],
                                        tv[monkeynv + monkeyf[i][1] + i - monkeyo],
                                        tv[monkeynv + monkeyf[i][0] + i - monkeyo],
                                        (monkeyf[i][3] != monkeyf[i][2]) ? tv[monkeynv + monkeyf[i][3] + i - monkeyo] : NULL,
-                                       NULL, false);
+                                       NULL, BM_CREATE_NOP);
        }
 
        MEM_freeN(tv);
@@ -535,7 +535,7 @@ void bmo_create_circle_exec(BMesh *bm, BMOperator *op)
                if (a && cap_ends) {
                        BMFace *f;
                        
-                       f = BM_face_create_quad_tri(bm, cent1, lastv1, v1, NULL, NULL, false);
+                       f = BM_face_create_quad_tri(bm, cent1, lastv1, v1, NULL, NULL, BM_CREATE_NOP);
                        BMO_elem_flag_enable(bm, f, FACE_NEW);
                }
                
@@ -553,7 +553,7 @@ void bmo_create_circle_exec(BMesh *bm, BMOperator *op)
        if (cap_ends) {
                BMFace *f;
                
-               f = BM_face_create_quad_tri(bm, cent1, v1, firstv1, NULL, NULL, false);
+               f = BM_face_create_quad_tri(bm, cent1, v1, firstv1, NULL, NULL, BM_CREATE_NOP);
                BMO_elem_flag_enable(bm, f, FACE_NEW);
        }
        
@@ -622,12 +622,12 @@ void bmo_create_cone_exec(BMesh *bm, BMOperator *op)
                        if (cap_ends) {
                                BMFace *f;
                                
-                               f = BM_face_create_quad_tri(bm, cent1, lastv1, v1, NULL, NULL, false);
+                               f = BM_face_create_quad_tri(bm, cent1, lastv1, v1, NULL, NULL, BM_CREATE_NOP);
                                BMO_elem_flag_enable(bm, f, FACE_NEW);
-                               f = BM_face_create_quad_tri(bm, cent2, v2, lastv2, NULL, NULL, false);
+                               f = BM_face_create_quad_tri(bm, cent2, v2, lastv2, NULL, NULL, BM_CREATE_NOP);
                                BMO_elem_flag_enable(bm, f, FACE_NEW);
                        }
-                       BM_face_create_quad_tri(bm, lastv1, lastv2, v2, v1, NULL, false);
+                       BM_face_create_quad_tri(bm, lastv1, lastv2, v2, v1, NULL, BM_CREATE_NOP);
                }
                else {
                        firstv1 = v1;
@@ -644,9 +644,9 @@ void bmo_create_cone_exec(BMesh *bm, BMOperator *op)
        if (cap_ends) {
                BMFace *f;
                
-               f = BM_face_create_quad_tri(bm, cent1, v1, firstv1, NULL, NULL, false);
+               f = BM_face_create_quad_tri(bm, cent1, v1, firstv1, NULL, NULL, BM_CREATE_NOP);
                BMO_elem_flag_enable(bm, f, FACE_NEW);
-               f = BM_face_create_quad_tri(bm, cent2, firstv2, v2, NULL, NULL, false);
+               f = BM_face_create_quad_tri(bm, cent2, firstv2, v2, NULL, NULL, BM_CREATE_NOP);
                BMO_elem_flag_enable(bm, f, FACE_NEW);
        }
        
@@ -654,7 +654,7 @@ void bmo_create_cone_exec(BMesh *bm, BMOperator *op)
                BMO_op_callf(bm, op->flag, "dissolve_faces faces=%ff", FACE_NEW);
        }
        
-       BM_face_create_quad_tri(bm, v1, v2, firstv2, firstv1, NULL, false);
+       BM_face_create_quad_tri(bm, v1, v2, firstv2, firstv1, NULL, BM_CREATE_NOP);
 
        BMO_op_callf(bm, op->flag, "remove_doubles verts=%fv dist=%f", VERT_MARK, 0.000001);
        BMO_slot_buffer_from_enabled_flag(bm, op, op->slots_out, "verts.out", BM_VERT, VERT_MARK);
@@ -726,14 +726,14 @@ void bmo_create_cube_exec(BMesh *bm, BMOperator *op)
        BMO_elem_flag_enable(bm, v8, VERT_MARK);
 
        /* the four sides */
-       BM_face_create_quad_tri(bm, v5, v6, v2, v1, NULL, false);
-       BM_face_create_quad_tri(bm, v6, v7, v3, v2, NULL, false);
-       BM_face_create_quad_tri(bm, v7, v8, v4, v3, NULL, false);
-       BM_face_create_quad_tri(bm, v8, v5, v1, v4, NULL, false);
+       BM_face_create_quad_tri(bm, v5, v6, v2, v1, NULL, BM_CREATE_NOP);
+       BM_face_create_quad_tri(bm, v6, v7, v3, v2, NULL, BM_CREATE_NOP);
+       BM_face_create_quad_tri(bm, v7, v8, v4, v3, NULL, BM_CREATE_NOP);
+       BM_face_create_quad_tri(bm, v8, v5, v1, v4, NULL, BM_CREATE_NOP);
        
        /* top/bottom */
-       BM_face_create_quad_tri(bm, v1, v2, v3, v4, NULL, false);
-       BM_face_create_quad_tri(bm, v8, v7, v6, v5, NULL, false);
+       BM_face_create_quad_tri(bm, v1, v2, v3, v4, NULL, BM_CREATE_NOP);
+       BM_face_create_quad_tri(bm, v8, v7, v6, v5, NULL, BM_CREATE_NOP);
 
        BMO_slot_buffer_from_enabled_flag(bm, op, op->slots_out, "verts.out", BM_VERT, VERT_MARK);
 }
index 8e254b2e499e3c172cda28d1df96bca4869cbc37..e6d0ba2e40c0ae4d7f5ad3f674d2e1badbff4c1e 100644 (file)
@@ -108,11 +108,13 @@ void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op)
        BLI_scanfill_calc_ex(&sf_ctx, scanfill_flag, normal_pt);
        
        for (sf_tri = sf_ctx.fillfacebase.first; sf_tri; sf_tri = sf_tri->next) {
-               BMFace *f = BM_face_create_quad_tri(bm,
-                                                   sf_tri->v1->tmp.p, sf_tri->v2->tmp.p, sf_tri->v3->tmp.p, NULL,
-                                                   NULL, true);
+               BMFace *f;
                BMLoop *l;
                BMIter liter;
+
+               f = BM_face_create_quad_tri(bm,
+                                           sf_tri->v1->tmp.p, sf_tri->v2->tmp.p, sf_tri->v3->tmp.p, NULL,
+                                           NULL, BM_CREATE_NO_DOUBLE);
                
                BMO_elem_flag_enable(bm, f, ELE_NEW);
                BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
index e2ce31d15b96983d4597679d73f7f93d4b050906..79fea3e5da194b75e2b50b31c9bdd8ca5f6140ae 100644 (file)
@@ -441,7 +441,7 @@ void BM_mesh_wireframe(
                        BMVert *v_pos1 = verts_pos[i_1];
                        BMVert *v_pos2 = verts_pos[i_2];
 
-                       f_new = BM_face_create_quad_tri(bm, v_l1, v_l2, v_neg2, v_neg1, f_src, false);
+                       f_new = BM_face_create_quad_tri(bm, v_l1, v_l2, v_neg2, v_neg1, f_src, BM_CREATE_NOP);
                        if (mat_offset) f_new->mat_nr = CLAMPIS(f_new->mat_nr + mat_offset, 0, mat_max);
                        BM_elem_flag_enable(f_new, BM_ELEM_TAG);
                        l_new = BM_FACE_FIRST_LOOP(f_new);
@@ -451,7 +451,7 @@ void BM_mesh_wireframe(
                        BM_elem_attrs_copy(bm, bm, l_next, l_new->next);
                        BM_elem_attrs_copy(bm, bm, l_next, l_new->next->next);
 
-                       f_new = BM_face_create_quad_tri(bm, v_l2, v_l1, v_pos1, v_pos2, f_src, false);
+                       f_new = BM_face_create_quad_tri(bm, v_l2, v_l1, v_pos1, v_pos2, f_src, BM_CREATE_NOP);
 
                        if (mat_offset) f_new->mat_nr = CLAMPIS(f_new->mat_nr + mat_offset, 0, mat_max);
                        BM_elem_flag_enable(f_new, BM_ELEM_TAG);
@@ -469,7 +469,7 @@ void BM_mesh_wireframe(
                                        BMVert *v_b1 = verts_boundary[i_1];
                                        BMVert *v_b2 = verts_boundary[i_2];
 
-                                       f_new = BM_face_create_quad_tri(bm, v_b2, v_b1, v_neg1, v_neg2, f_src, false);
+                                       f_new = BM_face_create_quad_tri(bm, v_b2, v_b1, v_neg1, v_neg2, f_src, BM_CREATE_NOP);
                                        if (mat_offset) f_new->mat_nr = CLAMPIS(f_new->mat_nr + mat_offset, 0, mat_max);
                                        BM_elem_flag_enable(f_new, BM_ELEM_TAG);
                                        l_new = BM_FACE_FIRST_LOOP(f_new);
@@ -479,7 +479,7 @@ void BM_mesh_wireframe(
                                        BM_elem_attrs_copy(bm, bm, l,      l_new->next);
                                        BM_elem_attrs_copy(bm, bm, l,      l_new->next->next);
 
-                                       f_new = BM_face_create_quad_tri(bm, v_b1, v_b2, v_pos2, v_pos1, f_src, false);
+                                       f_new = BM_face_create_quad_tri(bm, v_b1, v_b2, v_pos2, v_pos1, f_src, BM_CREATE_NOP);
                                        if (mat_offset) f_new->mat_nr = CLAMPIS(f_new->mat_nr + mat_offset, 0, mat_max);
                                        BM_elem_flag_enable(f_new, BM_ELEM_TAG);
                                        l_new = BM_FACE_FIRST_LOOP(f_new);
index 433fd17621722768499835ebbd60f751e1311087..440ab14dacdf744adeae04829c267f9492963938 100644 (file)
@@ -407,7 +407,7 @@ static Object *createRepresentation(bContext *C, struct recast_polyMesh *pmesh,
                                                          BM_vert_at_index(em->bm, face[0]),
                                                          BM_vert_at_index(em->bm, face[2]),
                                                          BM_vert_at_index(em->bm, face[1]), NULL,
-                                                         NULL, false);
+                                                         NULL, BM_CREATE_NOP);
 
                        /* set navigation polygon idx to the custom layer */
                        polygonIdx = (int *)CustomData_bmesh_get(&em->bm->pdata, newFace->head.data, CD_RECAST);