diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-02-12 22:43:59 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-02-12 22:43:59 +0400 |
commit | 37ff2a291f38548e1ac9d5d31939ecda0bea65ed (patch) | |
tree | a48f24ce0f148e57dfba04d9193579c74153596f /source/blender/editors | |
parent | c34af2c9b1527af857b674eb0e7aaaeab99c7758 (diff) |
BMesh api function naming.
`_set` suffix was used in two ways (confusing)
* to set a flag to be enabled.
* to set a value passed as an argument.
now use enable/disable rather then set/clear for functions which change flags.
also remove BME_weld.c, the file didnt contain much code and the current extrude works well
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/include/ED_mesh.h | 4 | ||||
-rw-r--r-- | source/blender/editors/mesh/bmesh_select.c | 80 | ||||
-rw-r--r-- | source/blender/editors/mesh/bmesh_tools.c | 100 | ||||
-rw-r--r-- | source/blender/editors/mesh/bmeshutils.c | 14 | ||||
-rwxr-xr-x | source/blender/editors/mesh/knifetool.c | 30 | ||||
-rw-r--r-- | source/blender/editors/mesh/loopcut.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/mesh_intern.h | 2 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_select.c | 10 | ||||
-rw-r--r-- | source/blender/editors/transform/transform.c | 22 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 18 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_draw.c | 12 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_ops.c | 40 |
12 files changed, 167 insertions, 167 deletions
diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index 5bdfc99d543..b3d86b66b62 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -202,8 +202,8 @@ void EM_add_data_layer(struct BMEditMesh *em, struct CustomData *data, int type void EM_free_data_layer(struct BMEditMesh *em, struct CustomData *data, int type); void EDBM_toggle_select_all(struct BMEditMesh *em); -void EDBM_set_flag_all(struct BMEditMesh *em, const char hflag); -void EDBM_clear_flag_all(struct BMEditMesh *em, const char hflag); +void EDBM_flag_enable_all(struct BMEditMesh *em, const char hflag); +void EDBM_flag_disable_all(struct BMEditMesh *em, const char hflag); void EDBM_select_mirrored(struct Object *obedit, struct BMEditMesh *em, int extend); void EDBM_automerge(struct Scene *scene, struct Object *ob, int update); diff --git a/source/blender/editors/mesh/bmesh_select.c b/source/blender/editors/mesh/bmesh_select.c index 8e09055a93b..553d42a8854 100644 --- a/source/blender/editors/mesh/bmesh_select.c +++ b/source/blender/editors/mesh/bmesh_select.c @@ -72,17 +72,17 @@ void EDBM_select_mirrored(Object *UNUSED(obedit), BMEditMesh *em, int extend) BM_ITER(v1, &iter, em->bm, BM_VERTS_OF_MESH, NULL) { if (!BM_elem_flag_test(v1, BM_ELEM_SELECT) || BM_elem_flag_test(v1, BM_ELEM_HIDDEN)) { - BM_elem_flag_clear(v1, BM_ELEM_TAG); + BM_elem_flag_disable(v1, BM_ELEM_TAG); } else { - BM_elem_flag_set(v1, BM_ELEM_TAG); + BM_elem_flag_enable(v1, BM_ELEM_TAG); } } EDBM_CacheMirrorVerts(em, TRUE); if (!extend) - EDBM_clear_flag_all(em, BM_ELEM_SELECT); + EDBM_flag_disable_all(em, BM_ELEM_SELECT); BM_ITER(v1, &iter, em->bm, BM_VERTS_OF_MESH, NULL) { if (!BM_elem_flag_test(v1, BM_ELEM_TAG) || BM_elem_flag_test(v1, BM_ELEM_HIDDEN)) @@ -707,10 +707,10 @@ static int similar_face_select_exec(bContext *C, wmOperator *op) BMO_op_exec(em->bm, &bmop); /* clear the existing selection */ - EDBM_clear_flag_all(em, BM_ELEM_SELECT); + EDBM_flag_disable_all(em, BM_ELEM_SELECT); /* select the output */ - BMO_slot_buffer_hflag(em->bm, &bmop, "faceout", BM_ELEM_SELECT, BM_ALL); + BMO_slot_buffer_hflag_enable(em->bm, &bmop, "faceout", BM_ELEM_SELECT, BM_ALL); /* finish the operator */ if (!EDBM_FinishOp(em, &bmop, op, TRUE)) { @@ -748,10 +748,10 @@ static int similar_edge_select_exec(bContext *C, wmOperator *op) BMO_op_exec(em->bm, &bmop); /* clear the existing selection */ - EDBM_clear_flag_all(em, BM_ELEM_SELECT); + EDBM_flag_disable_all(em, BM_ELEM_SELECT); /* select the output */ - BMO_slot_buffer_hflag(em->bm, &bmop, "edgeout", BM_ELEM_SELECT, BM_ALL); + BMO_slot_buffer_hflag_enable(em->bm, &bmop, "edgeout", BM_ELEM_SELECT, BM_ALL); EDBM_selectmode_flush(em); /* finish the operator */ @@ -793,10 +793,10 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op) BMO_op_exec(em->bm, &bmop); /* clear the existing selection */ - EDBM_clear_flag_all(em, BM_ELEM_SELECT); + EDBM_flag_disable_all(em, BM_ELEM_SELECT); /* select the output */ - BMO_slot_buffer_hflag(em->bm, &bmop, "vertout", BM_ELEM_SELECT, BM_ALL); + BMO_slot_buffer_hflag_enable(em->bm, &bmop, "vertout", BM_ELEM_SELECT, BM_ALL); /* finish the operator */ if (!EDBM_FinishOp(em, &bmop, op, TRUE)) { @@ -1005,7 +1005,7 @@ static void mouse_mesh_loop(bContext *C, int mval[2], short extend, short ring) eed = EDBM_findnearestedge(&vc, &dist); if (eed) { if (extend == 0) { - EDBM_clear_flag_all(em, BM_ELEM_SELECT); + EDBM_flag_disable_all(em, BM_ELEM_SELECT); } if (BM_elem_flag_test(eed, BM_ELEM_SELECT) == 0) { @@ -1162,12 +1162,12 @@ static void edgetag_context_set(BMEditMesh *em, Scene *scene, BMEdge *e, int val BM_elem_select_set(em->bm, e, val); break; case EDGE_MODE_TAG_SEAM: - if (val) {BM_elem_flag_set(e, BM_ELEM_SEAM);} - else {BM_elem_flag_clear(e, BM_ELEM_SEAM);} + if (val) {BM_elem_flag_enable(e, BM_ELEM_SEAM);} + else {BM_elem_flag_disable(e, BM_ELEM_SEAM);} break; case EDGE_MODE_TAG_SHARP: - if (val) {BM_elem_flag_set(e, BM_ELEM_SEAM);} - else {BM_elem_flag_clear(e, BM_ELEM_SEAM);} + if (val) {BM_elem_flag_enable(e, BM_ELEM_SEAM);} + else {BM_elem_flag_disable(e, BM_ELEM_SEAM);} break; case EDGE_MODE_TAG_CREASE: { @@ -1461,7 +1461,7 @@ int mouse_mesh(bContext *C, const int mval[2], short extend) if (unified_findnearest(&vc, &eve, &eed, &efa)) { - if (extend == 0) EDBM_clear_flag_all(vc.em, BM_ELEM_SELECT); + if (extend == 0) EDBM_flag_disable_all(vc.em, BM_ELEM_SELECT); if (efa) { /* set the last selected face */ @@ -1755,8 +1755,8 @@ static int select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event if (limit) { BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) { - if (!BM_elem_flag_test(e, BM_ELEM_SEAM)) BMO_elem_flag_set(bm, e, BM_ELEM_SELECT); - else BMO_elem_flag_clear(bm, e, BM_ELEM_SELECT); /* is this needed ? */ + if (!BM_elem_flag_test(e, BM_ELEM_SEAM)) BMO_elem_flag_enable(bm, e, BM_ELEM_SELECT); + else BMO_elem_flag_disable(bm, e, BM_ELEM_SELECT); /* is this needed ? */ } } @@ -1837,17 +1837,17 @@ static int select_linked_exec(bContext *C, wmOperator *op) BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) { if (BM_elem_flag_test(efa, BM_ELEM_SELECT) && !BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) { - BM_elem_flag_set(efa, BM_ELEM_TAG); + BM_elem_flag_enable(efa, BM_ELEM_TAG); } else { - BM_elem_flag_clear(efa, BM_ELEM_TAG); + BM_elem_flag_disable(efa, BM_ELEM_TAG); } } if (limit) { BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) { - if (!BM_elem_flag_test(e, BM_ELEM_SEAM)) BMO_elem_flag_set(bm, e, BM_ELEM_SELECT); - else BMO_elem_flag_clear(bm, e, BM_ELEM_SELECT); /* is this needed ? */ + if (!BM_elem_flag_test(e, BM_ELEM_SEAM)) BMO_elem_flag_enable(bm, e, BM_ELEM_SELECT); + else BMO_elem_flag_disable(bm, e, BM_ELEM_SELECT); /* is this needed ? */ } } @@ -1868,10 +1868,10 @@ static int select_linked_exec(bContext *C, wmOperator *op) else { BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) { if (BM_elem_flag_test(v, BM_ELEM_SELECT) && !BM_elem_flag_test(v, BM_ELEM_HIDDEN)) { - BM_elem_flag_set(v, BM_ELEM_TAG); + BM_elem_flag_enable(v, BM_ELEM_TAG); } else { - BM_elem_flag_clear(v, BM_ELEM_TAG); + BM_elem_flag_disable(v, BM_ELEM_TAG); } } @@ -2012,7 +2012,7 @@ static void walker_deselect_nth(BMEditMesh *em, int nth, int offset, BMHeader *h BMO_push(bm, NULL); BM_ITER(h, &iter, bm, itertype, NULL) { if (BM_elem_flag_test(h, BM_ELEM_SELECT)) { - BMO_elem_flag_set(bm, h, BM_ELEM_SELECT); + BMO_elem_flag_enable(bm, h, BM_ELEM_SELECT); } } @@ -2243,7 +2243,7 @@ static int select_linked_flat_faces_exec(bContext *C, wmOperator *op) sharp = (sharp * M_PI) / 180.0; BM_ITER(f, &iter, em->bm, BM_FACES_OF_MESH, NULL) { - BM_elem_flag_clear(f, BM_ELEM_TAG); + BM_elem_flag_disable(f, BM_ELEM_TAG); } BM_ITER(f, &iter, em->bm, BM_FACES_OF_MESH, NULL) { @@ -2262,7 +2262,7 @@ static int select_linked_flat_faces_exec(bContext *C, wmOperator *op) BM_elem_select_set(em->bm, f, TRUE); - BM_elem_flag_set(f, BM_ELEM_TAG); + BM_elem_flag_enable(f, BM_ELEM_TAG); BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, f) { BM_ITER(l2, &liter2, em->bm, BM_LOOPS_OF_LOOP, l) { @@ -2372,7 +2372,7 @@ static int mesh_select_random_exec(bContext *C, wmOperator *op) BLI_srand(BLI_rand()); /* random seed */ if (!RNA_boolean_get(op->ptr, "extend")) - EDBM_clear_flag_all(em, BM_ELEM_SELECT); + EDBM_flag_disable_all(em, BM_ELEM_SELECT); if (em->selectmode & SCE_SELECT_VERTEX) { BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) { @@ -2434,7 +2434,7 @@ static int select_next_loop(bContext *C, wmOperator *UNUSED(op)) BMIter iter; BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) { - BM_elem_flag_clear(v, BM_ELEM_TAG); + BM_elem_flag_disable(v, BM_ELEM_TAG); } BM_ITER(f, &iter, em->bm, BM_FACES_OF_MESH, NULL) { @@ -2443,7 +2443,7 @@ static int select_next_loop(bContext *C, wmOperator *UNUSED(op)) BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, f) { if (BM_elem_flag_test(l->v, BM_ELEM_SELECT) && !BM_elem_flag_test(l->v, BM_ELEM_HIDDEN)) { - BM_elem_flag_set(l->next->v, BM_ELEM_TAG); + BM_elem_flag_enable(l->next->v, BM_ELEM_TAG); BM_elem_select_set(em->bm, l->v, FALSE); } } @@ -2487,7 +2487,7 @@ static int region_to_loop(bContext *C, wmOperator *UNUSED(op)) em_setup_viewcontext(C, &vc); BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) { - BM_elem_flag_clear(e, BM_ELEM_TAG); + BM_elem_flag_disable(e, BM_ELEM_TAG); } BM_ITER(f, &iter, em->bm, BM_FACES_OF_MESH, NULL) { @@ -2503,15 +2503,15 @@ static int region_to_loop(bContext *C, wmOperator *UNUSED(op)) } if ((tot != totsel && totsel > 0) || (totsel == 1 && tot == 1)) - BM_elem_flag_set(l1->e, BM_ELEM_TAG); + BM_elem_flag_enable(l1->e, BM_ELEM_TAG); } } - EDBM_clear_flag_all(em, BM_ELEM_SELECT); + EDBM_flag_disable_all(em, BM_ELEM_SELECT); BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) { if (BM_elem_flag_test(e, BM_ELEM_TAG) && !BM_elem_flag_test(e, BM_ELEM_HIDDEN)) - BM_edge_select(em->bm, e, TRUE); + BM_edge_select_set(em->bm, e, TRUE); } /* If in face-only select mode, switch to edge select mode so that @@ -2607,16 +2607,16 @@ static int loop_find_regions(BMEditMesh *em, int selbigger) BLI_smallhash_init(&visithash); BM_ITER(f, &iter, em->bm, BM_FACES_OF_MESH, NULL) { - BM_elem_flag_clear(f, BM_ELEM_TAG); + BM_elem_flag_disable(f, BM_ELEM_TAG); } BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) { if (BM_elem_flag_test(e, BM_ELEM_SELECT)) { BLI_array_append(edges, e); - BM_elem_flag_set(e, BM_ELEM_TAG); + BM_elem_flag_enable(e, BM_ELEM_TAG); } else { - BM_elem_flag_clear(e, BM_ELEM_TAG); + BM_elem_flag_disable(e, BM_ELEM_TAG); } } @@ -2660,9 +2660,9 @@ static int loop_find_regions(BMEditMesh *em, int selbigger) int j; for (j = 0; j < tot; j++) { - BM_elem_flag_set(region[j], BM_ELEM_TAG); + BM_elem_flag_enable(region[j], BM_ELEM_TAG); BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, region[j]) { - BM_elem_flag_clear(l->e, BM_ELEM_TAG); + BM_elem_flag_disable(l->e, BM_ELEM_TAG); } } @@ -2695,11 +2695,11 @@ static int loop_to_region(bContext *C, wmOperator *op) loop_find_regions(em, selbigger); } - EDBM_clear_flag_all(em, BM_ELEM_SELECT); + EDBM_flag_disable_all(em, BM_ELEM_SELECT); BM_ITER(f, &iter, em->bm, BM_FACES_OF_MESH, NULL) { if (BM_elem_flag_test(f, BM_ELEM_TAG) && !BM_elem_flag_test(f, BM_ELEM_HIDDEN)) { - BM_face_select(em->bm, f, TRUE); + BM_face_select_set(em->bm, f, TRUE); } } diff --git a/source/blender/editors/mesh/bmesh_tools.c b/source/blender/editors/mesh/bmesh_tools.c index 3e055f9448f..75bc3c46a6f 100644 --- a/source/blender/editors/mesh/bmesh_tools.c +++ b/source/blender/editors/mesh/bmesh_tools.c @@ -176,7 +176,7 @@ static short EDBM_Extrude_face_indiv(BMEditMesh *em, wmOperator *op, const char EDBM_InitOpf(em, &bmop, op, "extrude_face_indiv faces=%hf", hflag); /* deselect original verts */ - EDBM_clear_flag_all(em, BM_ELEM_SELECT); + EDBM_flag_disable_all(em, BM_ELEM_SELECT); BMO_op_exec(em->bm, &bmop); @@ -204,10 +204,10 @@ static short EDBM_Extrude_edges_indiv(BMEditMesh *em, wmOperator *op, const char EDBM_InitOpf(em, &bmop, op, "extrude_edge_only edges=%he", hflag); /* deselect original verts */ - EDBM_clear_flag_all(em, BM_ELEM_SELECT); + EDBM_flag_disable_all(em, BM_ELEM_SELECT); BMO_op_exec(em->bm, &bmop); - BMO_slot_buffer_hflag(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_VERT|BM_EDGE); + BMO_slot_buffer_hflag_enable(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_VERT|BM_EDGE); if (!EDBM_FinishOp(em, &bmop, op, TRUE)) { return 0; @@ -224,10 +224,10 @@ static short EDBM_Extrude_verts_indiv(BMEditMesh *em, wmOperator *op, const char EDBM_InitOpf(em, &bmop, op, "extrude_vert_indiv verts=%hv", hflag); /* deselect original verts */ - BMO_slot_buffer_hflag_clear(em->bm, &bmop, "verts", BM_ELEM_SELECT, BM_VERT); + BMO_slot_buffer_hflag_disable(em->bm, &bmop, "verts", BM_ELEM_SELECT, BM_VERT); BMO_op_exec(em->bm, &bmop); - BMO_slot_buffer_hflag(em->bm, &bmop, "vertout", BM_ELEM_SELECT, BM_VERT); + BMO_slot_buffer_hflag_enable(em->bm, &bmop, "vertout", BM_ELEM_SELECT, BM_VERT); if (!EDBM_FinishOp(em, &bmop, op, TRUE)) { return 0; @@ -309,7 +309,7 @@ static short EDBM_Extrude_edge(Object *obedit, BMEditMesh *em, const char hflag, } } - EDBM_clear_flag_all(em, BM_ELEM_SELECT); + EDBM_flag_disable_all(em, BM_ELEM_SELECT); BMO_op_exec(bm, &extop); @@ -346,8 +346,8 @@ static short EDBM_Extrude_vert(Object *obedit, BMEditMesh *em, const char hflag, BM_elem_select_set(em->bm, eed->v2, TRUE); } - BM_elem_flag_set(eed->v1, hflag & ~BM_ELEM_SELECT); - BM_elem_flag_set(eed->v2, hflag & ~BM_ELEM_SELECT); + BM_elem_flag_enable(eed->v1, hflag & ~BM_ELEM_SELECT); + BM_elem_flag_enable(eed->v2, hflag & ~BM_ELEM_SELECT); } else { if (BM_elem_flag_test(eed->v1, hflag) && BM_elem_flag_test(eed->v2, hflag)) { @@ -355,7 +355,7 @@ static short EDBM_Extrude_vert(Object *obedit, BMEditMesh *em, const char hflag, BM_elem_select_set(em->bm, eed, TRUE); } - BM_elem_flag_set(eed, hflag & ~BM_ELEM_SELECT); + BM_elem_flag_enable(eed, hflag & ~BM_ELEM_SELECT); } } } @@ -632,9 +632,9 @@ void MESH_OT_extrude_faces_indiv(wmOperatorType *ot) void EDBM_toggle_select_all(BMEditMesh *em) /* exported for UV */ { if (em->bm->totvertsel || em->bm->totedgesel || em->bm->totfacesel) - EDBM_clear_flag_all(em, BM_ELEM_SELECT); + EDBM_flag_disable_all(em, BM_ELEM_SELECT); else - EDBM_set_flag_all(em, BM_ELEM_SELECT); + EDBM_flag_enable_all(em, BM_ELEM_SELECT); } static int mesh_select_all_exec(bContext *C, wmOperator *op) @@ -648,10 +648,10 @@ static int mesh_select_all_exec(bContext *C, wmOperator *op) EDBM_toggle_select_all(em); break; case SEL_SELECT: - EDBM_set_flag_all(em, BM_ELEM_SELECT); + EDBM_flag_enable_all(em, BM_ELEM_SELECT); break; case SEL_DESELECT: - EDBM_clear_flag_all(em, BM_ELEM_SELECT); + EDBM_flag_disable_all(em, BM_ELEM_SELECT); break; case SEL_INVERT: EDBM_select_swap(em); @@ -951,7 +951,7 @@ static int delete_mesh_exec(bContext *C, wmOperator *op) if (type != 12) { if (delete_mesh(C, obedit, op, type, scene) == OPERATOR_CANCELLED) return OPERATOR_CANCELLED; - EDBM_clear_flag_all(em, BM_ELEM_SELECT); + EDBM_flag_disable_all(em, BM_ELEM_SELECT); } else { if (!EDBM_CallOpf(em, op, "collapse edges=%he", BM_ELEM_SELECT)) @@ -999,7 +999,7 @@ static int addedgeface_mesh_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; BMO_op_exec(em->bm, &bmop); - BMO_slot_buffer_hflag(em->bm, &bmop, "faceout", BM_ELEM_SELECT, BM_FACE); + BMO_slot_buffer_hflag_enable(em->bm, &bmop, "faceout", BM_ELEM_SELECT, BM_FACE); if (!EDBM_FinishOp(em, &bmop, op, TRUE)) { return OPERATOR_CANCELLED; @@ -1048,14 +1048,14 @@ static int editbmesh_mark_seam(bContext *C, wmOperator *op) if (!BM_elem_flag_test(eed, BM_ELEM_SELECT) || BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) continue; - BM_elem_flag_clear(eed, BM_ELEM_SEAM); + BM_elem_flag_disable(eed, BM_ELEM_SEAM); } } else { BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) { if (!BM_elem_flag_test(eed, BM_ELEM_SELECT) || BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) continue; - BM_elem_flag_set(eed, BM_ELEM_SEAM); + BM_elem_flag_enable(eed, BM_ELEM_SEAM); } } @@ -1102,7 +1102,7 @@ static int editbmesh_mark_sharp(bContext *C, wmOperator *op) if (!BM_elem_flag_test(eed, BM_ELEM_SELECT) || BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) continue; - BM_elem_flag_set(eed, BM_ELEM_SHARP); + BM_elem_flag_enable(eed, BM_ELEM_SHARP); } } else { @@ -1110,7 +1110,7 @@ static int editbmesh_mark_sharp(bContext *C, wmOperator *op) if (!BM_elem_flag_test(eed, BM_ELEM_SELECT) || BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) continue; - BM_elem_flag_clear(eed, BM_ELEM_SHARP); + BM_elem_flag_disable(eed, BM_ELEM_SHARP); } } @@ -1227,9 +1227,9 @@ static int mesh_duplicate_exec(bContext *C, wmOperator *op) EDBM_InitOpf(em, &bmop, op, "dupe geom=%hvef", BM_ELEM_SELECT); BMO_op_exec(em->bm, &bmop); - EDBM_clear_flag_all(em, BM_ELEM_SELECT); + EDBM_flag_disable_all(em, BM_ELEM_SELECT); - BMO_slot_buffer_hflag(em->bm, &bmop, "newout", BM_ELEM_SELECT, BM_ALL); + BMO_slot_buffer_hflag_enable(em->bm, &bmop, "newout", BM_ELEM_SELECT, BM_ALL); if (!EDBM_FinishOp(em, &bmop, op, TRUE)) { return OPERATOR_CANCELLED; @@ -1361,10 +1361,10 @@ static int edge_rotate_selected(bContext *C, wmOperator *op) /* avoid adding to the selection if we start off with only a selected edge, * we could also just deselect the single edge easily but use the BMO api * since it seems this is more 'correct' */ - if (do_deselect) BMO_slot_buffer_hflag_clear(em->bm, &bmop, "edges", BM_ELEM_SELECT, BM_EDGE); + if (do_deselect) BMO_slot_buffer_hflag_disable(em->bm, &bmop, "edges", BM_ELEM_SELECT, BM_EDGE); BMO_op_exec(em->bm, &bmop); - BMO_slot_buffer_hflag(em->bm, &bmop, "edgeout", BM_ELEM_SELECT, BM_EDGE); + BMO_slot_buffer_hflag_enable(em->bm, &bmop, "edgeout", BM_ELEM_SELECT, BM_EDGE); if (!EDBM_FinishOp(em, &bmop, op, TRUE)) { return OPERATOR_CANCELLED; @@ -1478,16 +1478,16 @@ void EDBM_reveal_mesh(BMEditMesh *em) for (i = 0; i < 3; i++) { BM_ITER(ele, &iter, em->bm, iter_types[i], NULL) { if (BM_elem_flag_test(ele, BM_ELEM_HIDDEN)) { - BM_elem_flag_set(ele, BM_ELEM_TAG); + BM_elem_flag_enable(ele, BM_ELEM_TAG); } else { - BM_elem_flag_clear(ele, BM_ELEM_TAG); + BM_elem_flag_disable(ele, BM_ELEM_TAG); } } } /* Reveal everything */ - EDBM_clear_flag_all(em, BM_ELEM_HIDDEN); + EDBM_flag_disable_all(em, BM_ELEM_HIDDEN); /* Select relevant just-revealed elements */ for (i = 0; i < 3; i++) { @@ -1734,9 +1734,9 @@ static void mesh_set_smooth_faces(BMEditMesh *em, short smooth) BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) { if (BM_elem_flag_test(efa, BM_ELEM_SELECT)) { if (smooth) - BM_elem_flag_set(efa, BM_ELEM_SMOOTH); + BM_elem_flag_enable(efa, BM_ELEM_SMOOTH); else - BM_elem_flag_clear(efa, BM_ELEM_SMOOTH); + BM_elem_flag_disable(efa, BM_ELEM_SMOOTH); } } } @@ -2265,10 +2265,10 @@ static int select_vertex_path_exec(bContext *C, wmOperator *op) BMO_op_exec(em->bm, &bmop); /* DO NOT clear the existing selection */ - /* EDBM_clear_flag_all(em, BM_ELEM_SELECT); */ + /* EDBM_flag_disable_all(em, BM_ELEM_SELECT); */ /* select the output */ - BMO_slot_buffer_hflag(em->bm, &bmop, "vertout", BM_ELEM_SELECT, BM_ALL); + BMO_slot_buffer_hflag_enable(em->bm, &bmop, "vertout", BM_ELEM_SELECT, BM_ALL); /* finish the operator */ if (!EDBM_FinishOp(em, &bmop, op, TRUE)) { @@ -2349,10 +2349,10 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) { if (BM_elem_flag_test(e, BM_ELEM_SELECT)) { - BM_elem_flag_set(e, BM_ELEM_TAG); + BM_elem_flag_enable(e, BM_ELEM_TAG); } else { - BM_elem_flag_clear(e, BM_ELEM_TAG); + BM_elem_flag_disable(e, BM_ELEM_TAG); } } @@ -2403,12 +2403,12 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) else if (BM_edge_face_count(e2) == 2) { l = e2->l; e = BM_face_other_loop(e2, l->f, v)->e; - BM_elem_flag_set(e, BM_ELEM_TAG); + BM_elem_flag_enable(e, BM_ELEM_TAG); BM_elem_select_set(bm, e, TRUE); l = e2->l->radial_next; e = BM_face_other_loop(e2, l->f, v)->e; - BM_elem_flag_set(e, BM_ELEM_TAG); + BM_elem_flag_enable(e, BM_ELEM_TAG); BM_elem_select_set(bm, e, TRUE); } @@ -2485,15 +2485,15 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) BMBVH_FreeBVH(bvhtree); - EDBM_clear_flag_all(em, BM_ELEM_SELECT); - BMO_slot_buffer_hflag(bm, &bmop, side?"edgeout2":"edgeout1", BM_ELEM_SELECT, BM_EDGE); + EDBM_flag_disable_all(em, BM_ELEM_SELECT); + BMO_slot_buffer_hflag_enable(bm, &bmop, side?"edgeout2":"edgeout1", BM_ELEM_SELECT, BM_EDGE); BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) { if (BM_elem_flag_test(e, BM_ELEM_SELECT)) { - BM_elem_flag_set(e, BM_ELEM_TAG); + BM_elem_flag_enable(e, BM_ELEM_TAG); } else { - BM_elem_flag_clear(e, BM_ELEM_TAG); + BM_elem_flag_disable(e, BM_ELEM_TAG); } } @@ -2821,13 +2821,13 @@ static int solidify_exec(bContext *C, wmOperator *op) /* deselect only the faces in the region to be solidified (leave wire edges and loose verts selected, as there will be no corresponding geometry selected below) */ - BMO_slot_buffer_hflag_clear(bm, &bmop, "geom", BM_ELEM_SELECT, BM_FACE); + BMO_slot_buffer_hflag_disable(bm, &bmop, "geom", BM_ELEM_SELECT, BM_FACE); /* run the solidify operator */ BMO_op_exec(bm, &bmop); /* select the newly generated faces */ - BMO_slot_buffer_hflag(bm, &bmop, "geomout", BM_ELEM_SELECT, BM_FACE); + BMO_slot_buffer_hflag_enable(bm, &bmop, "geomout", BM_ELEM_SELECT, BM_FACE); if (!EDBM_FinishOp(em, &bmop, op, TRUE)) { return OPERATOR_CANCELLED; @@ -3127,14 +3127,14 @@ static int knife_cut_exec(bContext *C, wmOperator *op) be, isect); } - BMO_elem_flag_set(bm, be, 1); + BMO_elem_flag_enable(bm, be, 1); } else { - BMO_elem_flag_clear(bm, be, 1); + BMO_elem_flag_disable(bm, be, 1); } } else { - BMO_elem_flag_clear(bm, be, 1); + BMO_elem_flag_disable(bm, be, 1); } } @@ -3396,7 +3396,7 @@ static int fill_mesh_exec(bContext *C, wmOperator *op) BMO_op_exec(em->bm, &bmop); /* select new geometry */ - BMO_slot_buffer_hflag(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_FACE|BM_EDGE); + BMO_slot_buffer_hflag_enable(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_FACE|BM_EDGE); if (!EDBM_FinishOp(em, &bmop, op, TRUE)) { return OPERATOR_CANCELLED; @@ -3570,8 +3570,8 @@ static int split_mesh_exec(bContext *C, wmOperator *op) EDBM_InitOpf(em, &bmop, op, "split geom=%hvef", BM_ELEM_SELECT); BMO_op_exec(em->bm, &bmop); - BM_clear_flag_all(em->bm, BM_ELEM_SELECT); - BMO_slot_buffer_hflag(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_ALL); + BM_mesh_flag_disable_all(em->bm, BM_ELEM_SELECT); + BMO_slot_buffer_hflag_enable(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_ALL); if (!EDBM_FinishOp(em, &bmop, op, TRUE)) { return OPERATOR_CANCELLED; } @@ -3632,8 +3632,8 @@ static int spin_mesh_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } BMO_op_exec(bm, &spinop); - EDBM_clear_flag_all(em, BM_ELEM_SELECT); - BMO_slot_buffer_hflag(bm, &spinop, "lastout", BM_ELEM_SELECT, BM_ALL); + EDBM_flag_disable_all(em, BM_ELEM_SELECT); + BMO_slot_buffer_hflag_enable(bm, &spinop, "lastout", BM_ELEM_SELECT, BM_ALL); if (!EDBM_FinishOp(em, &spinop, op, TRUE)) { return OPERATOR_CANCELLED; } @@ -3758,8 +3758,8 @@ static int screw_mesh_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } BMO_op_exec(bm, &spinop); - EDBM_clear_flag_all(em, BM_ELEM_SELECT); - BMO_slot_buffer_hflag(bm, &spinop, "lastout", BM_ELEM_SELECT, BM_ALL); + EDBM_flag_disable_all(em, BM_ELEM_SELECT); + BMO_slot_buffer_hflag_enable(bm, &spinop, "lastout", BM_ELEM_SELECT, BM_ALL); if (!EDBM_FinishOp(em, &spinop, op, TRUE)) { return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/mesh/bmeshutils.c b/source/blender/editors/mesh/bmeshutils.c index a1db19540ae..669bfe636e8 100644 --- a/source/blender/editors/mesh/bmeshutils.c +++ b/source/blender/editors/mesh/bmeshutils.c @@ -208,7 +208,7 @@ int EDBM_CallAndSelectOpf(BMEditMesh *em, wmOperator *op, const char *selectslot em->emcopyusers++; BMO_op_exec(bm, &bmop); - BMO_slot_buffer_hflag(em->bm, &bmop, selectslot, BM_ELEM_SELECT, BM_ALL); + BMO_slot_buffer_hflag_enable(em->bm, &bmop, selectslot, BM_ELEM_SELECT, BM_ALL); va_end(list); return EDBM_FinishOp(em, &bmop, op, TRUE); @@ -412,7 +412,7 @@ void EDBM_select_more(BMEditMesh *em) "regionextend geom=%hvef constrict=%d usefaces=%d", BM_ELEM_SELECT, 0, usefaces); BMO_op_exec(em->bm, &bmop); - BMO_slot_buffer_hflag(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_ALL); + BMO_slot_buffer_hflag_enable(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_ALL); BMO_op_finish(em->bm, &bmop); EDBM_selectmode_flush(em); @@ -427,7 +427,7 @@ void EDBM_select_less(BMEditMesh *em) "regionextend geom=%hvef constrict=%d usefaces=%d", BM_ELEM_SELECT, 0, usefaces); BMO_op_exec(em->bm, &bmop); - BMO_slot_buffer_hflag(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_ALL); + BMO_slot_buffer_hflag_enable(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_ALL); BMO_op_finish(em->bm, &bmop); EDBM_selectmode_flush(em); @@ -466,7 +466,7 @@ int EDBM_get_actSelection(BMEditMesh *em, BMEditSelection *ese) return 1; } -void EDBM_clear_flag_all(BMEditMesh *em, const char hflag) +void EDBM_flag_disable_all(BMEditMesh *em, const char hflag) { const char iter_types[3] = {BM_VERTS_OF_MESH, BM_EDGES_OF_MESH, @@ -481,12 +481,12 @@ void EDBM_clear_flag_all(BMEditMesh *em, const char hflag) for (i = 0; i < 3; i++) { BM_ITER(ele, &iter, em->bm, iter_types[i], NULL) { if (hflag & BM_ELEM_SELECT) BM_elem_select_set(em->bm, ele, FALSE); - BM_elem_flag_clear(ele, hflag); + BM_elem_flag_disable(ele, hflag); } } } -void EDBM_set_flag_all(BMEditMesh *em, const char hflag) +void EDBM_flag_enable_all(BMEditMesh *em, const char hflag) { const char iter_types[3] = {BM_VERTS_OF_MESH, BM_EDGES_OF_MESH, @@ -502,7 +502,7 @@ void EDBM_set_flag_all(BMEditMesh *em, const char hflag) BM_elem_select_set(em->bm, ele, TRUE); } else { - BM_elem_flag_set(ele, hflag); + BM_elem_flag_enable(ele, hflag); } } } diff --git a/source/blender/editors/mesh/knifetool.c b/source/blender/editors/mesh/knifetool.c index c72c61d14f3..27c31d27d62 100755 --- a/source/blender/editors/mesh/knifetool.c +++ b/source/blender/editors/mesh/knifetool.c @@ -1704,7 +1704,7 @@ static void remerge_faces(knifetool_opdata *kcd) f2 = BM_faces_join(bm, faces, BLI_array_count(faces)); if (f2) { - BMO_elem_flag_set(bm, f2, FACE_NEW); + BMO_elem_flag_enable(bm, f2, FACE_NEW); BM_elem_index_set(f2, idx); /* set_dirty! */ /* BMESH_TODO, check if this is valid or not */ } } @@ -1748,7 +1748,7 @@ static void knifenet_fill_faces(knifetool_opdata *kcd) bm->elem_index_dirty &= ~BM_FACE; BM_ITER(e, &bmiter, bm, BM_EDGES_OF_MESH, NULL) { - BMO_elem_flag_set(bm, e, BOUNDARY); + BMO_elem_flag_enable(bm, e, BOUNDARY); } /* turn knife verts into real verts, as necassary */ @@ -1758,14 +1758,14 @@ static void knifenet_fill_faces(knifetool_opdata *kcd) /* shouldn't we be at least copying the normal? - if not some comment here should explain why - campbell */ kfv->v = BM_vert_create(bm, kfv->co, NULL); kfv->flag = 1; - BMO_elem_flag_set(bm, kfv->v, DEL); + BMO_elem_flag_enable(bm, kfv->v, DEL); } else { kfv->flag = 0; - BMO_elem_flag_set(bm, kfv->v, VERT_ORIG); + BMO_elem_flag_enable(bm, kfv->v, VERT_ORIG); } - BMO_elem_flag_set(bm, kfv->v, MARK); + BMO_elem_flag_enable(bm, kfv->v, MARK); } /* we want to only do changed faces. first, go over new edges and add to @@ -1789,13 +1789,13 @@ static void knifenet_fill_faces(knifetool_opdata *kcd) if (kfe->e) { kfe->oe = kfe->e; - BMO_elem_flag_set(bm, kfe->e, DEL); - BMO_elem_flag_clear(bm, kfe->e, BOUNDARY); + BMO_elem_flag_enable(bm, kfe->e, DEL); + BMO_elem_flag_disable(bm, kfe->e, BOUNDARY); kfe->e = NULL; } kfe->e = BM_edge_create(bm, kfe->v1->v, kfe->v2->v, NULL, TRUE); - BMO_elem_flag_set(bm, kfe->e, BOUNDARY); + BMO_elem_flag_enable(bm, kfe->e, BOUNDARY); for (ref = kfe->faces.first; ref; ref = ref->next) { f = ref->ref; @@ -1818,7 +1818,7 @@ static void knifenet_fill_faces(knifetool_opdata *kcd) k++; - BMO_elem_flag_set(bm, kfe->e, BOUNDARY); + BMO_elem_flag_enable(bm, kfe->e, BOUNDARY); kfe->oe = kfe->e; for (ref = kfe->faces.first; ref; ref = ref->next) { @@ -1842,7 +1842,7 @@ static void knifenet_fill_faces(knifetool_opdata *kcd) BLI_smallhash_init(hash); if (face_nets[i].first) - BMO_elem_flag_set(bm, f, DEL); + BMO_elem_flag_enable(bm, f, DEL); BLI_begin_edgefill(); @@ -1882,8 +1882,8 @@ static void knifenet_fill_faces(knifetool_opdata *kcd) if (entry->kfe->oe) eed->f = FILLBOUNDARY; /* mark as original boundary edge */ - BMO_elem_flag_clear(bm, entry->kfe->e->v1, DEL); - BMO_elem_flag_clear(bm, entry->kfe->e->v2, DEL); + BMO_elem_flag_disable(bm, entry->kfe->e->v1, DEL); + BMO_elem_flag_disable(bm, entry->kfe->e->v2, DEL); } else { if (lasteve->xs < 2) @@ -1910,15 +1910,15 @@ static void knifenet_fill_faces(knifetool_opdata *kcd) v1, v2, v3, NULL, NULL, FALSE); - BMO_elem_flag_set(bm, f2, FACE_NEW); + BMO_elem_flag_enable(bm, f2, FACE_NEW); l = BM_FACE_FIRST_LOOP(f2); do { - BMO_elem_flag_clear(bm, l->e, DEL); + BMO_elem_flag_disable(bm, l->e, DEL); l = l->next; } while (l != BM_FACE_FIRST_LOOP(f2)); - BMO_elem_flag_clear(bm, f2, DEL); + BMO_elem_flag_disable(bm, f2, DEL); BM_elem_index_set(f2, i); /* set_dirty! */ /* note, not 100% sure this is dirty? need to check */ BM_face_normal_update(bm, f2); diff --git a/source/blender/editors/mesh/loopcut.c b/source/blender/editors/mesh/loopcut.c index 5667b4b13b6..78ebb7a1c32 100644 --- a/source/blender/editors/mesh/loopcut.c +++ b/source/blender/editors/mesh/loopcut.c @@ -200,7 +200,7 @@ static void edgering_sel(tringselOpData *lcd, int previewlines, int select) } if (!lcd->extend) { - EDBM_clear_flag_all(lcd->em, BM_ELEM_SELECT); + EDBM_flag_disable_all(lcd->em, BM_ELEM_SELECT); } if (select) { diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h index 5001943f31d..4d03503de18 100644 --- a/source/blender/editors/mesh/mesh_intern.h +++ b/source/blender/editors/mesh/mesh_intern.h @@ -79,7 +79,7 @@ int EDBM_InitOpf(struct BMEditMesh *em, struct BMOperator *bmop, int EDBM_FinishOp(struct BMEditMesh *em, struct BMOperator *bmop, struct wmOperator *op, const int report); -void EDBM_clear_flag_all(struct BMEditMesh *em, const char hflag); +void EDBM_flag_disable_all(struct BMEditMesh *em, const char hflag); void EDBM_store_selection(struct BMEditMesh *em, void *data); void EDBM_validate_selections(struct BMEditMesh *em); void EDBM_remove_selection(struct BMEditMesh *em, void *data); diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 989feaedb40..ec6d1bdbe87 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -175,7 +175,7 @@ static void EDBM_backbuf_checkAndSelectVerts(BMEditMesh *em, int select) for ( ; eve; eve=BM_iter_step(&iter), index++) { if(!BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) { if(EDBM_check_backbuf(index)) { - BM_vert_select(em->bm, eve, select); + BM_vert_select_set(em->bm, eve, select); } } } @@ -191,7 +191,7 @@ static void EDBM_backbuf_checkAndSelectEdges(BMEditMesh *em, int select) for ( ; eed; eed=BM_iter_step(&iter), index++) { if(!BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) { if(EDBM_check_backbuf(index)) { - BM_edge_select(em->bm, eed, select); + BM_edge_select_set(em->bm, eed, select); } } } @@ -207,7 +207,7 @@ static void EDBM_backbuf_checkAndSelectFaces(BMEditMesh *em, int select) for ( ; efa; efa=BM_iter_step(&iter), index++) { if(!BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) { if(EDBM_check_backbuf(index)) { - BM_face_select(em->bm, efa, select); + BM_face_select_set(em->bm, efa, select); } } } @@ -525,7 +525,7 @@ static void do_lasso_select_mesh(ViewContext *vc, int mcords[][2], short moves, data.pass = 0; if (extend == 0 && select) - EDBM_clear_flag_all(vc->em, BM_ELEM_SELECT); + EDBM_flag_disable_all(vc->em, BM_ELEM_SELECT); /* for non zbuf projections, dont change the GL state */ ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); @@ -1782,7 +1782,7 @@ static int do_mesh_box_select(ViewContext *vc, rcti *rect, int select, int exten data.done = 0; if (extend == 0 && select) - EDBM_clear_flag_all(vc->em, BM_ELEM_SELECT); + EDBM_flag_disable_all(vc->em, BM_ELEM_SELECT); /* for non zbuf projections, dont change the GL state */ ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 82d6672e54d..90a957e7798 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -4420,12 +4420,12 @@ static int createSlideVerts(TransInfo *t) j = 0; BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) { if (BM_elem_flag_test(v, BM_ELEM_SELECT)) { - BM_elem_flag_set(v, BM_ELEM_TAG); + BM_elem_flag_enable(v, BM_ELEM_TAG); BLI_smallhash_insert(&table, (uintptr_t)v, SET_INT_IN_POINTER(j)); j += 1; } else { - BM_elem_flag_clear(v, BM_ELEM_TAG); + BM_elem_flag_disable(v, BM_ELEM_TAG); } } @@ -4471,7 +4471,7 @@ static int createSlideVerts(TransInfo *t) v = BM_edge_other_vert(e, v); } while (e != first->e); - BM_elem_flag_clear(v, BM_ELEM_TAG); + BM_elem_flag_disable(v, BM_ELEM_TAG); l1 = l2 = l = NULL; l1 = e->l; @@ -4527,8 +4527,8 @@ static int createSlideVerts(TransInfo *t) sub_v3_v3v3(sv->downvec, BM_edge_other_vert(l->e, v)->co, v->co); } - BM_elem_flag_clear(v, BM_ELEM_TAG); - BM_elem_flag_clear(v2, BM_ELEM_TAG); + BM_elem_flag_disable(v, BM_ELEM_TAG); + BM_elem_flag_disable(v2, BM_ELEM_TAG); j += 2; break; @@ -4539,12 +4539,12 @@ static int createSlideVerts(TransInfo *t) j += 1; - BM_elem_flag_clear(v, BM_ELEM_TAG); - BM_elem_flag_clear(v2, BM_ELEM_TAG); + BM_elem_flag_disable(v, BM_ELEM_TAG); + BM_elem_flag_disable(v2, BM_ELEM_TAG); } while (e != first->e && l1); } - //EDBM_clear_flag_all(em, BM_ELEM_SELECT); + //EDBM_flag_disable_all(em, BM_ELEM_SELECT); sld->sv = tempsv; sld->totsv = j; @@ -4616,12 +4616,12 @@ static int createSlideVerts(TransInfo *t) BMFace *copyf = BM_face_copy(em->bm, f, 1, 1); BM_elem_select_set(em->bm, copyf, FALSE); - BM_elem_flag_set(copyf, BM_ELEM_HIDDEN); + BM_elem_flag_enable(copyf, BM_ELEM_HIDDEN); BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, copyf) { BM_elem_select_set(em->bm, l->v, FALSE); - BM_elem_flag_set(l->v, BM_ELEM_HIDDEN); + BM_elem_flag_enable(l->v, BM_ELEM_HIDDEN); BM_elem_select_set(em->bm, l->e, FALSE); - BM_elem_flag_set(l->e, BM_ELEM_HIDDEN); + BM_elem_flag_enable(l->e, BM_ELEM_HIDDEN); } BLI_smallhash_insert(&sld->origfaces, (uintptr_t)f, copyf); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index c2cd1b8378b..ad05c3129af 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2050,10 +2050,10 @@ static void createTransEditVerts(bContext *C, TransInfo *t) if(selectmode & SCE_SELECT_VERTEX) { BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) { if (BM_elem_select_test(bm, eve)) { - BM_elem_flag_set(eve, BM_ELEM_TAG); + BM_elem_flag_enable(eve, BM_ELEM_TAG); } else { - BM_elem_flag_clear(eve, BM_ELEM_TAG); + BM_elem_flag_disable(eve, BM_ELEM_TAG); } } } @@ -2061,20 +2061,20 @@ static void createTransEditVerts(bContext *C, TransInfo *t) BMEdge *eed; eve = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL); - for( ; eve; eve=BM_iter_step(&iter)) BM_elem_flag_clear(eve, BM_ELEM_TAG); + for( ; eve; eve=BM_iter_step(&iter)) BM_elem_flag_disable(eve, BM_ELEM_TAG); eed = BM_iter_new(&iter, bm, BM_EDGES_OF_MESH, NULL); for( ; eed; eed=BM_iter_step(&iter)) { if (BM_elem_select_test(bm, eed)) { - BM_elem_flag_set(eed->v1, BM_ELEM_TAG); - BM_elem_flag_set(eed->v2, BM_ELEM_TAG); + BM_elem_flag_enable(eed->v1, BM_ELEM_TAG); + BM_elem_flag_enable(eed->v2, BM_ELEM_TAG); } } } else { BMFace *efa; eve = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL); - for( ; eve; eve=BM_iter_step(&iter)) BM_elem_flag_clear(eve, BM_ELEM_TAG); + for( ; eve; eve=BM_iter_step(&iter)) BM_elem_flag_disable(eve, BM_ELEM_TAG); efa = BM_iter_new(&iter, bm, BM_FACES_OF_MESH, NULL); for( ; efa; efa=BM_iter_step(&iter)) { @@ -2084,7 +2084,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t) l = BM_iter_new(&liter, bm, BM_LOOPS_OF_FACE, efa); for (; l; l=BM_iter_step(&liter)) { - BM_elem_flag_set(l->v, BM_ELEM_TAG); + BM_elem_flag_enable(l->v, BM_ELEM_TAG); } } } @@ -2457,11 +2457,11 @@ static void createTransUVs(bContext *C, TransInfo *t) tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); if(!uvedit_face_visible(scene, ima, efa, tf)) { - BM_elem_flag_clear(efa, BM_ELEM_TAG); + BM_elem_flag_disable(efa, BM_ELEM_TAG); continue; } - BM_elem_flag_set(efa, BM_ELEM_TAG); + BM_elem_flag_enable(efa, BM_ELEM_TAG); BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) { if (uvedit_uv_selected(em, scene, l)) countsel++; diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index 26fbc48d2fb..3103e12f7f2 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -206,12 +206,12 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe totuvarea += poly_uv_area(tf_uv, efa->len); if(uvedit_face_visible(scene, ima, efa, tf)) { - BM_elem_flag_set(efa, BM_ELEM_TAG); + BM_elem_flag_enable(efa, BM_ELEM_TAG); } else { if(tf == activetf) activetf= NULL; - BM_elem_flag_clear(efa, BM_ELEM_TAG); + BM_elem_flag_disable(efa, BM_ELEM_TAG); } } @@ -569,7 +569,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit) tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); if(uvedit_face_visible(scene, ima, efa, tf)) { - BM_elem_flag_set(efa, BM_ELEM_TAG); + BM_elem_flag_enable(efa, BM_ELEM_TAG); if(tf==activetf) continue; /* important the temp boolean is set above */ if(uvedit_face_selected(scene, em, efa)) @@ -587,7 +587,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit) else { if(tf == activetf) activetf= NULL; - BM_elem_flag_clear(efa, BM_ELEM_TAG); + BM_elem_flag_disable(efa, BM_ELEM_TAG); } } glDisable(GL_BLEND); @@ -599,12 +599,12 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit) tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); if(uvedit_face_visible(scene, ima, efa, tf)) { - BM_elem_flag_set(efa, BM_ELEM_TAG); + BM_elem_flag_enable(efa, BM_ELEM_TAG); } else { if(tf == activetf) activetf= NULL; - BM_elem_flag_clear(efa, BM_ELEM_TAG); + BM_elem_flag_disable(efa, BM_ELEM_TAG); } } diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 42b6953a719..167f4bb4c2f 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -996,7 +996,7 @@ static int uv_edge_tag_faces(BMEditMesh *em, UvMapVert *first1, UvMapVert *first if(iterv1->f == iterv2->f) { efa= EDBM_get_face_for_index(em, iterv1->f); - BMO_elem_flag_set(em->bm, efa, EFA_F1_FLAG); + BMO_elem_flag_enable(em->bm, efa, EFA_F1_FLAG); break; } } @@ -1027,7 +1027,7 @@ static int select_edgeloop(Scene *scene, Image *ima, BMEditMesh *em, NearestHit uvedit_face_deselect(scene, em, efa); } - BMO_elem_flag_clear(em->bm, efa, EFA_F1_FLAG); + BMO_elem_flag_disable(em->bm, efa, EFA_F1_FLAG); BM_elem_index_set(efa, count); /* set_inline */ @@ -1072,7 +1072,7 @@ static int select_edgeloop(Scene *scene, Image *ima, BMEditMesh *em, NearestHit if(iterv1->flag || iterv2->flag) { if(uv_edge_tag_faces(em, iterv1, iterv2, &starttotf)) { looking= 1; - BMO_elem_flag_set(em->bm, efa, EFA_F1_FLAG); + BMO_elem_flag_enable(em->bm, efa, EFA_F1_FLAG); uv_vertex_loop_flag(iterv1); uv_vertex_loop_flag(iterv2); @@ -1418,7 +1418,7 @@ static void weld_align_uv(bContext *C, int tool) /* clear tag */ BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) { - BM_elem_flag_clear(eve, BM_ELEM_TAG); + BM_elem_flag_disable(eve, BM_ELEM_TAG); } /* tag verts with a selected UV */ @@ -1430,7 +1430,7 @@ static void weld_align_uv(bContext *C, int tool) continue; if (uvedit_uv_selected(em, scene, l)) { - BM_elem_flag_set(eve, BM_ELEM_TAG); + BM_elem_flag_enable(eve, BM_ELEM_TAG); break; } } @@ -1439,10 +1439,10 @@ static void weld_align_uv(bContext *C, int tool) /* flush vertex tags to edges */ BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) { if (BM_elem_flag_test(eed->v1, BM_ELEM_TAG) && BM_elem_flag_test(eed->v2, BM_ELEM_TAG)) { - BM_elem_flag_set(eed, BM_ELEM_TAG); + BM_elem_flag_enable(eed, BM_ELEM_TAG); } else { - BM_elem_flag_clear(eed, BM_ELEM_TAG); + BM_elem_flag_disable(eed, BM_ELEM_TAG); } } @@ -1474,7 +1474,7 @@ static void weld_align_uv(bContext *C, int tool) while (eve) { BLI_array_append(eve_line, eve); /* dont touch again */ - BM_elem_flag_clear(eve, BM_ELEM_TAG); + BM_elem_flag_disable(eve, BM_ELEM_TAG); eve_next = NULL; @@ -1793,10 +1793,10 @@ static void select_all_perform(bContext *C, int action) EDBM_toggle_select_all(((Mesh*)obedit->data)->edit_btmesh); break; case SEL_SELECT: - EDBM_set_flag_all(em, BM_ELEM_SELECT); + EDBM_flag_enable_all(em, BM_ELEM_SELECT); break; case SEL_DESELECT: - EDBM_clear_flag_all(em, BM_ELEM_SELECT); + EDBM_flag_disable_all(em, BM_ELEM_SELECT); break; case SEL_INVERT: EDBM_select_swap(em); @@ -2481,13 +2481,13 @@ static void uv_faces_do_sticky(bContext *C, SpaceImage *sima, Scene *scene, Obje BMVert *eve; BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) { - BM_elem_flag_clear(eve, BM_ELEM_TAG); + BM_elem_flag_disable(eve, BM_ELEM_TAG); } BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) { if (BM_elem_flag_test(efa, BM_ELEM_TAG)) { BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) { - BM_elem_flag_set(l->v, BM_ELEM_TAG); + BM_elem_flag_enable(l->v, BM_ELEM_TAG); } } } @@ -2637,13 +2637,13 @@ static int border_select_exec(bContext *C, wmOperator *op) BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) { /* assume not touched */ - BM_elem_flag_clear(efa, BM_ELEM_TAG); + BM_elem_flag_disable(efa, BM_ELEM_TAG); tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); if(uvedit_face_visible(scene, ima, efa, tf)) { poly_uv_center(em, efa, cent); if(BLI_in_rctf(&rectf, cent[0], cent[1])) { - BM_elem_flag_set(efa, BM_ELEM_TAG); + BM_elem_flag_enable(efa, BM_ELEM_TAG); change = 1; } } @@ -2942,10 +2942,10 @@ static int snap_uvs_to_adjacent_unselected(Scene *scene, Image *ima, Object *obe BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) { tface= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); if(!uvedit_face_visible(scene, ima, efa, tface)) { - BM_elem_flag_clear(efa, BM_ELEM_TAG); + BM_elem_flag_disable(efa, BM_ELEM_TAG); continue; } else { - BM_elem_flag_set(efa, BM_ELEM_TAG); + BM_elem_flag_enable(efa, BM_ELEM_TAG); } change = 1; @@ -3567,7 +3567,7 @@ static int seams_from_islands_exec(bContext *C, wmOperator *op) mvinit1 = vmap->vert[BM_elem_index_get(editedge->v1)]; if(mark_seams) - BM_elem_flag_clear(editedge, BM_ELEM_SEAM); + BM_elem_flag_disable(editedge, BM_ELEM_SEAM); for(mv1 = mvinit1; mv1 && !faces_separated; mv1 = mv1->next) { if(mv1->separate && commonFaces) @@ -3616,9 +3616,9 @@ static int seams_from_islands_exec(bContext *C, wmOperator *op) if(faces_separated) { if(mark_seams) - BM_elem_flag_set(editedge, BM_ELEM_SEAM); + BM_elem_flag_enable(editedge, BM_ELEM_SEAM); if(mark_sharp) - BM_elem_flag_set(editedge, BM_ELEM_SHARP); + BM_elem_flag_enable(editedge, BM_ELEM_SHARP); } } @@ -3667,7 +3667,7 @@ static int mark_seam_exec(bContext *C, wmOperator *UNUSED(op)) BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) { BM_ITER(loop, &liter, bm, BM_LOOPS_OF_FACE, efa) { if(uvedit_edge_selected(em, scene, loop)) { - BM_elem_flag_set(loop, BM_ELEM_SEAM); + BM_elem_flag_enable(loop, BM_ELEM_SEAM); } } } |