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 | |
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')
42 files changed, 543 insertions, 761 deletions
diff --git a/source/blender/bmesh/bmesh.h b/source/blender/bmesh/bmesh.h index 330e9c8da56..f1c3ed28e40 100644 --- a/source/blender/bmesh/bmesh.h +++ b/source/blender/bmesh/bmesh.h @@ -145,10 +145,10 @@ BMFace *BM_face_create_ngon(BMesh *bm, BMVert *v1, BMVert *v2, BMEdge **edges, i BM_INLINE char BM_elem_flag_test(const void *element, const char hflag); /* stuff for dealing with header flags */ -BM_INLINE void BM_elem_flag_set(void *element, const char hflag); +BM_INLINE void BM_elem_flag_enable(void *element, const char hflag); /* stuff for dealing with header flags */ -BM_INLINE void BM_elem_flag_clear(void *element, const char hflag); +BM_INLINE void BM_elem_flag_disable(void *element, const char hflag); /* stuff for dealing BM_elem_flag_toggle header flags */ BM_INLINE void BM_elem_flag_toggle(void *element, const char hflag); diff --git a/source/blender/bmesh/bmesh_marking.h b/source/blender/bmesh/bmesh_marking.h index 0fd1a621d81..dc7edece9cb 100644 --- a/source/blender/bmesh/bmesh_marking.h +++ b/source/blender/bmesh/bmesh_marking.h @@ -47,13 +47,13 @@ void BM_elem_select_set(struct BMesh *bm, void *element, int select); * chuck it.*/ int BM_elem_select_test(BMesh *bm, const void *element); -void BM_clear_flag_all(BMesh *bm, const char hflag); +void BM_mesh_flag_disable_all(BMesh *bm, const char hflag); /* individual element select functions, BM_elem_select_set is a shortcut for these * that automatically detects which one to use*/ -void BM_vert_select(struct BMesh *bm, struct BMVert *v, int select); -void BM_edge_select(struct BMesh *bm, struct BMEdge *e, int select); -void BM_face_select(struct BMesh *bm, struct BMFace *f, int select); +void BM_vert_select_set(struct BMesh *bm, struct BMVert *v, int select); +void BM_edge_select_set(struct BMesh *bm, struct BMEdge *e, int select); +void BM_face_select_set(struct BMesh *bm, struct BMFace *f, int select); void BM_select_mode_set(struct BMesh *bm, int selectmode); diff --git a/source/blender/bmesh/bmesh_operator_api.h b/source/blender/bmesh/bmesh_operator_api.h index 461149f07b8..4415e894754 100644 --- a/source/blender/bmesh/bmesh_operator_api.h +++ b/source/blender/bmesh/bmesh_operator_api.h @@ -180,14 +180,14 @@ void BMO_op_finish(struct BMesh *bm, struct BMOperator *op); /* flags 15 and 16 (1<<14 and 1<<15) are reserved for bmesh api use */ #define BMO_elem_flag_test(bm, element, oflag) (((BMHeader*)(element))->flags[bm->stackdepth-1].f & (oflag)) -#define BMO_elem_flag_set(bm, element, oflag) (((BMHeader*)(element))->flags[bm->stackdepth-1].f |= (oflag)) -#define BMO_elem_flag_clear(bm, element, oflag) (((BMHeader*)(element))->flags[bm->stackdepth-1].f &= ~(oflag)) +#define BMO_elem_flag_enable(bm, element, oflag) (((BMHeader*)(element))->flags[bm->stackdepth-1].f |= (oflag)) +#define BMO_elem_flag_disable(bm, element, oflag) (((BMHeader*)(element))->flags[bm->stackdepth-1].f &= ~(oflag)) #define BMO_elem_flag_toggle(bm, element, oflag) (((BMHeader*)(element))->flags[bm->stackdepth-1].f ^= (oflag)) /* profiling showed a significant amount of time spent in BMO_elem_flag_test */ #if 0 -void BMO_elem_flag_set(struct BMesh *bm, void *element, const short oflag); -void BMO_elem_flag_clear(struct BMesh *bm, void *element, const short oflag); +void BMO_elem_flag_enable(struct BMesh *bm, void *element, const short oflag); +void BMO_elem_flag_disable(struct BMesh *bm, void *element, const short oflag); int BMO_elem_flag_test(struct BMesh *bm, void *element, const short oflag); #endif @@ -276,8 +276,8 @@ enum { DEL_ONLYTAGGED }; -void BMO_op_flag_set(struct BMesh *bm, struct BMOperator *op, const int op_flag); -void BMO_op_flag_clear(struct BMesh *bm, struct BMOperator *op, const int op_flag); +void BMO_op_flag_enable(struct BMesh *bm, struct BMOperator *op, const int op_flag); +void BMO_op_flag_disable(struct BMesh *bm, struct BMOperator *op, const int op_flag); void BMO_slot_float_set(struct BMOperator *op, const char *slotname, float f); float BMO_slot_float_get(BMOperator *op, const char *slotname); @@ -302,7 +302,7 @@ void BMO_slot_mat_set(struct BMOperator *op, const char *slotname, float *mat, i void BMO_slot_mat4_set(struct BMOperator *op, const char *slotname, float mat[4][4]); void BMO_slot_mat3_set(struct BMOperator *op, const char *slotname, float mat[3][3]); -void BMO_mesh_flag_clear_all(BMesh *bm, BMOperator *op, const char htype, const short oflag); +void BMO_mesh_flag_disable_all(BMesh *bm, BMOperator *op, const char htype, const short oflag); /* puts every element of type type (which is a bitmask) with tool flag flag, * into a slot. */ @@ -317,11 +317,11 @@ void BMO_slot_buffer_flag_clear(struct BMesh *bm, struct BMOperator *op, const c const short oflag, const char htype); /* tool-flags all elements inside an element slot array with flag flag. */ -void BMO_slot_buffer_hflag(struct BMesh *bm, struct BMOperator *op, const char *slotname, - const char hflag, const char htype); +void BMO_slot_buffer_hflag_enable(struct BMesh *bm, struct BMOperator *op, const char *slotname, + const char hflag, const char htype); /* clears tool-flag flag from all elements inside a slot array. */ -void BMO_slot_buffer_hflag_clear(struct BMesh *bm, struct BMOperator *op, const char *slotname, - const char hflag, const char htype); +void BMO_slot_buffer_hflag_disable(struct BMesh *bm, struct BMOperator *op, const char *slotname, + const char hflag, const char htype); /* puts every element of type type (which is a bitmask) with header flag * flag, into a slot. note: ignores hidden elements (e.g. elements with diff --git a/source/blender/bmesh/intern/bmesh_construct.c b/source/blender/bmesh/intern/bmesh_construct.c index 868ddd2ebd7..e86ed263821 100644 --- a/source/blender/bmesh/intern/bmesh_construct.c +++ b/source/blender/bmesh/intern/bmesh_construct.c @@ -418,10 +418,10 @@ static void bmo_remove_tagged_context_verts(BMesh *bm, const short oflag) if (BMO_elem_flag_test(bm, (BMHeader *)v, oflag)) { /* Visit edge */ for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_VERT, v); e; e = BM_iter_step(&edges)) - BMO_elem_flag_set(bm, (BMHeader *)e, oflag); + BMO_elem_flag_enable(bm, (BMHeader *)e, oflag); /* Visit face */ for (f = BM_iter_new(&faces, bm, BM_FACES_OF_VERT, v); f; f = BM_iter_step(&faces)) - BMO_elem_flag_set(bm, (BMHeader *)f, oflag); + BMO_elem_flag_enable(bm, (BMHeader *)f, oflag); } } @@ -441,7 +441,7 @@ static void bmo_remove_tagged_context_edges(BMesh *bm, const short oflag) for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges)) { if (BMO_elem_flag_test(bm, (BMHeader *)e, oflag)) { for (f = BM_iter_new(&faces, bm, BM_FACES_OF_EDGE, e); f; f = BM_iter_step(&faces)) { - BMO_elem_flag_set(bm, (BMHeader *)f, oflag); + BMO_elem_flag_enable(bm, (BMHeader *)f, oflag); } } } @@ -475,15 +475,15 @@ void BMO_remove_tagged_context(BMesh *bm, const short oflag, const int type) /* flush down to vert */ for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges)) { if (BMO_elem_flag_test(bm, (BMHeader *)e, oflag)) { - BMO_elem_flag_set(bm, (BMHeader *)(e->v1), oflag); - BMO_elem_flag_set(bm, (BMHeader *)(e->v2), oflag); + BMO_elem_flag_enable(bm, (BMHeader *)(e->v1), oflag); + BMO_elem_flag_enable(bm, (BMHeader *)(e->v2), oflag); } } bmo_remove_tagged_context_edges(bm, oflag); /* remove loose vertice */ for (v = BM_iter_new(&verts, bm, BM_VERTS_OF_MESH, bm); v; v = BM_iter_step(&verts)) { if (BMO_elem_flag_test(bm, (BMHeader *)v, oflag) && (!(v->e))) - BMO_elem_flag_set(bm, (BMHeader *)v, DEL_WIREVERT); + BMO_elem_flag_enable(bm, (BMHeader *)v, DEL_WIREVERT); } BMO_remove_tagged_verts(bm, DEL_WIREVERT); @@ -515,27 +515,27 @@ void BMO_remove_tagged_context(BMesh *bm, const short oflag, const int type) for (f = BM_iter_new(&faces, bm, BM_FACES_OF_MESH, bm); f; f = BM_iter_step(&faces)) { if (BMO_elem_flag_test(bm, (BMHeader *)f, oflag)) { for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_FACE, f); e; e = BM_iter_step(&edges)) - BMO_elem_flag_set(bm, (BMHeader *)e, oflag); + BMO_elem_flag_enable(bm, (BMHeader *)e, oflag); for (v = BM_iter_new(&verts, bm, BM_VERTS_OF_FACE, f); v; v = BM_iter_step(&verts)) - BMO_elem_flag_set(bm, (BMHeader *)v, oflag); + BMO_elem_flag_enable(bm, (BMHeader *)v, oflag); } } /* now go through and mark all remaining faces all edges for keeping */ for (f = BM_iter_new(&faces, bm, BM_FACES_OF_MESH, bm); f; f = BM_iter_step(&faces)) { if (!BMO_elem_flag_test(bm, (BMHeader *)f, oflag)) { for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_FACE, f); e; e = BM_iter_step(&edges)) { - BMO_elem_flag_clear(bm, (BMHeader *)e, oflag); + BMO_elem_flag_disable(bm, (BMHeader *)e, oflag); } for (v = BM_iter_new(&verts, bm, BM_VERTS_OF_FACE, f); v; v = BM_iter_step(&verts)) { - BMO_elem_flag_clear(bm, (BMHeader *)v, oflag); + BMO_elem_flag_disable(bm, (BMHeader *)v, oflag); } } } /* also mark all the vertices of remaining edges for keeping */ for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges)) { if (!BMO_elem_flag_test(bm, (BMHeader *)e, oflag)) { - BMO_elem_flag_clear(bm, (BMHeader *)e->v1, oflag); - BMO_elem_flag_clear(bm, (BMHeader *)e->v2, oflag); + BMO_elem_flag_disable(bm, (BMHeader *)e->v1, oflag); + BMO_elem_flag_disable(bm, (BMHeader *)e->v2, oflag); } } /* now delete marked face */ @@ -551,11 +551,11 @@ void BMO_remove_tagged_context(BMesh *bm, const short oflag, const int type) { /* does this option even belong in here? */ for (f = BM_iter_new(&faces, bm, BM_FACES_OF_MESH, bm); f; f = BM_iter_step(&faces)) - BMO_elem_flag_set(bm, (BMHeader *)f, oflag); + BMO_elem_flag_enable(bm, (BMHeader *)f, oflag); for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges)) - BMO_elem_flag_set(bm, (BMHeader *)e, oflag); + BMO_elem_flag_enable(bm, (BMHeader *)e, oflag); for (v = BM_iter_new(&verts, bm, BM_VERTS_OF_MESH, bm); v; v = BM_iter_step(&verts)) - BMO_elem_flag_set(bm, (BMHeader *)v, oflag); + BMO_elem_flag_enable(bm, (BMHeader *)v, oflag); BMO_remove_tagged_faces(bm, oflag); BMO_remove_tagged_edges(bm, oflag); diff --git a/source/blender/bmesh/intern/bmesh_inline.c b/source/blender/bmesh/intern/bmesh_inline.c index 944f5cb3566..4dd13047b90 100644 --- a/source/blender/bmesh/intern/bmesh_inline.c +++ b/source/blender/bmesh/intern/bmesh_inline.c @@ -36,12 +36,12 @@ BM_INLINE char BM_elem_flag_test(const void *element, const char hflag) return ((const BMHeader *)element)->hflag & hflag; } -BM_INLINE void BM_elem_flag_set(void *element, const char hflag) +BM_INLINE void BM_elem_flag_enable(void *element, const char hflag) { ((BMHeader *)element)->hflag |= hflag; } -BM_INLINE void BM_elem_flag_clear(void *element, const char hflag) +BM_INLINE void BM_elem_flag_disable(void *element, const char hflag) { ((BMHeader *)element)->hflag &= ~hflag; } diff --git a/source/blender/bmesh/intern/bmesh_marking.c b/source/blender/bmesh/intern/bmesh_marking.c index 6e23979d4aa..ce997584a4d 100644 --- a/source/blender/bmesh/intern/bmesh_marking.c +++ b/source/blender/bmesh/intern/bmesh_marking.c @@ -91,10 +91,10 @@ void BM_mesh_select_mode_flush(BMesh *bm) if (bm->selectmode & SCE_SELECT_VERTEX) { for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges)) { if (BM_elem_flag_test(e->v1, BM_ELEM_SELECT) && BM_elem_flag_test(e->v2, BM_ELEM_SELECT) && !BM_elem_flag_test(e, BM_ELEM_HIDDEN)) { - BM_elem_flag_set(e, BM_ELEM_SELECT); + BM_elem_flag_enable(e, BM_ELEM_SELECT); } else { - BM_elem_flag_clear(e, BM_ELEM_SELECT); + BM_elem_flag_disable(e, BM_ELEM_SELECT); } } for (f = BM_iter_new(&faces, bm, BM_FACES_OF_MESH, bm); f; f = BM_iter_step(&faces)) { @@ -113,10 +113,10 @@ void BM_mesh_select_mode_flush(BMesh *bm) } if (ok) { - BM_elem_flag_set(f, BM_ELEM_SELECT); + BM_elem_flag_enable(f, BM_ELEM_SELECT); } else { - BM_elem_flag_clear(f, BM_ELEM_SELECT); + BM_elem_flag_disable(f, BM_ELEM_SELECT); } } } @@ -137,10 +137,10 @@ void BM_mesh_select_mode_flush(BMesh *bm) } if (ok) { - BM_elem_flag_set(f, BM_ELEM_SELECT); + BM_elem_flag_enable(f, BM_ELEM_SELECT); } else { - BM_elem_flag_clear(f, BM_ELEM_SELECT); + BM_elem_flag_disable(f, BM_ELEM_SELECT); } } } @@ -166,7 +166,7 @@ void BM_mesh_deselect_flush(BMesh *bm) for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges)) { if (!(BM_elem_flag_test(e->v1, BM_ELEM_SELECT) && BM_elem_flag_test(e->v2, BM_ELEM_SELECT) && !BM_elem_flag_test(e, BM_ELEM_HIDDEN))) { - BM_elem_flag_clear(e, BM_ELEM_SELECT); + BM_elem_flag_disable(e, BM_ELEM_SELECT); } } @@ -186,7 +186,7 @@ void BM_mesh_deselect_flush(BMesh *bm) } if (ok == FALSE) { - BM_elem_flag_clear(f, BM_ELEM_SELECT); + BM_elem_flag_disable(f, BM_ELEM_SELECT); } } @@ -212,7 +212,7 @@ void BM_mesh_select_flush(BMesh *bm) for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges)) { if (BM_elem_flag_test(e->v1, BM_ELEM_SELECT) && BM_elem_flag_test(e->v2, BM_ELEM_SELECT) && !BM_elem_flag_test(e, BM_ELEM_HIDDEN)) { - BM_elem_flag_set(e, BM_ELEM_SELECT); + BM_elem_flag_enable(e, BM_ELEM_SELECT); } } @@ -232,14 +232,13 @@ void BM_mesh_select_flush(BMesh *bm) } if (ok) { - BM_elem_flag_set(f, BM_ELEM_SELECT); + BM_elem_flag_enable(f, BM_ELEM_SELECT); } } recount_totsels(bm); } - /* * BMESH SELECT VERT * @@ -248,7 +247,7 @@ void BM_mesh_select_flush(BMesh *bm) * */ -void BM_vert_select(BMesh *bm, BMVert *v, int select) +void BM_vert_select_set(BMesh *bm, BMVert *v, int select) { /* BMIter iter; */ /* BMEdge *e; */ @@ -260,13 +259,13 @@ void BM_vert_select(BMesh *bm, BMVert *v, int select) if (select) { if (!BM_elem_flag_test(v, BM_ELEM_SELECT)) { bm->totvertsel += 1; - BM_elem_flag_set(v, BM_ELEM_SELECT); + BM_elem_flag_enable(v, BM_ELEM_SELECT); } } else { if (BM_elem_flag_test(v, BM_ELEM_SELECT)) { bm->totvertsel -= 1; - BM_elem_flag_clear(v, BM_ELEM_SELECT); + BM_elem_flag_disable(v, BM_ELEM_SELECT); } } } @@ -279,7 +278,7 @@ void BM_vert_select(BMesh *bm, BMVert *v, int select) * */ -void BM_edge_select(BMesh *bm, BMEdge *e, int select) +void BM_edge_select_set(BMesh *bm, BMEdge *e, int select) { if (BM_elem_flag_test(e, BM_ELEM_HIDDEN)) { return; @@ -288,13 +287,13 @@ void BM_edge_select(BMesh *bm, BMEdge *e, int select) if (select) { if (!BM_elem_flag_test(e, BM_ELEM_SELECT)) bm->totedgesel += 1; - BM_elem_flag_set(&(e->head), BM_ELEM_SELECT); + BM_elem_flag_enable(&(e->head), BM_ELEM_SELECT); BM_elem_select_set(bm, e->v1, TRUE); BM_elem_select_set(bm, e->v2, TRUE); } else { if (BM_elem_flag_test(e, BM_ELEM_SELECT)) bm->totedgesel -= 1; - BM_elem_flag_clear(&(e->head), BM_ELEM_SELECT); + BM_elem_flag_disable(&(e->head), BM_ELEM_SELECT); if ( bm->selectmode == SCE_SELECT_EDGE || bm->selectmode == SCE_SELECT_FACE || @@ -320,7 +319,7 @@ void BM_edge_select(BMesh *bm, BMEdge *e, int select) } } - if (deselect) BM_vert_select(bm, verts[i], FALSE); + if (deselect) BM_vert_select_set(bm, verts[i], FALSE); } } else { @@ -340,7 +339,7 @@ void BM_edge_select(BMesh *bm, BMEdge *e, int select) * */ -void BM_face_select(BMesh *bm, BMFace *f, int select) +void BM_face_select_set(BMesh *bm, BMFace *f, int select) { BMLoop *l_iter; BMLoop *l_first; @@ -352,11 +351,11 @@ void BM_face_select(BMesh *bm, BMFace *f, int select) if (select) { if (!BM_elem_flag_test(f, BM_ELEM_SELECT)) bm->totfacesel += 1; - BM_elem_flag_set(&(f->head), BM_ELEM_SELECT); + BM_elem_flag_enable(&(f->head), BM_ELEM_SELECT); l_iter = l_first = BM_FACE_FIRST_LOOP(f); do { - BM_vert_select(bm, l_iter->v, TRUE); - BM_edge_select(bm, l_iter->e, TRUE); + BM_vert_select_set(bm, l_iter->v, TRUE); + BM_edge_select_set(bm, l_iter->e, TRUE); } while ((l_iter = l_iter->next) != l_first); } else { @@ -364,7 +363,7 @@ void BM_face_select(BMesh *bm, BMFace *f, int select) BMLoop *l; if (BM_elem_flag_test(f, BM_ELEM_SELECT)) bm->totfacesel -= 1; - BM_elem_flag_clear(&(f->head), BM_ELEM_SELECT); + BM_elem_flag_disable(&(f->head), BM_ELEM_SELECT); /* flush down to edges */ BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) { @@ -418,27 +417,27 @@ void BM_select_mode_set(BMesh *bm, int selectmode) if (bm->selectmode & SCE_SELECT_VERTEX) { for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges)) - BM_elem_flag_clear(e, 0); + BM_elem_flag_disable(e, 0); for (f = BM_iter_new(&faces, bm, BM_FACES_OF_MESH, bm); f; f = BM_iter_step(&faces)) - BM_elem_flag_clear(f, 0); + BM_elem_flag_disable(f, 0); BM_mesh_select_mode_flush(bm); } else if (bm->selectmode & SCE_SELECT_EDGE) { for (v = BM_iter_new(&verts, bm, BM_VERTS_OF_MESH, bm); v; v = BM_iter_step(&verts)) - BM_elem_flag_clear(v, 0); + BM_elem_flag_disable(v, 0); for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges)) { if (BM_elem_flag_test(&(e->head), BM_ELEM_SELECT)) { - BM_edge_select(bm, e, TRUE); + BM_edge_select_set(bm, e, TRUE); } } BM_mesh_select_mode_flush(bm); } else if (bm->selectmode & SCE_SELECT_FACE) { for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges)) - BM_elem_flag_clear(e, 0); + BM_elem_flag_disable(e, 0); for (f = BM_iter_new(&faces, bm, BM_FACES_OF_MESH, bm); f; f = BM_iter_step(&faces)) { if (BM_elem_flag_test(&(f->head), BM_ELEM_SELECT)) { - BM_face_select(bm, f, TRUE); + BM_face_select_set(bm, f, TRUE); } } BM_mesh_select_mode_flush(bm); @@ -479,9 +478,9 @@ void BM_elem_select_set(struct BMesh *bm, void *element, int select) { BMHeader *head = element; - if (head->htype == BM_VERT) BM_vert_select(bm, (BMVert *)element, select); - else if (head->htype == BM_EDGE) BM_edge_select(bm, (BMEdge *)element, select); - else if (head->htype == BM_FACE) BM_face_select(bm, (BMFace *)element, select); + if (head->htype == BM_VERT) BM_vert_select_set(bm, (BMVert *)element, select); + else if (head->htype == BM_EDGE) BM_edge_select_set(bm, (BMEdge *)element, select); + else if (head->htype == BM_FACE) BM_face_select_set(bm, (BMFace *)element, select); } int BM_elem_select_test(BMesh *UNUSED(bm), const void *element) @@ -746,7 +745,7 @@ void BM_select_history_validate(BMesh *bm) } } -void BM_clear_flag_all(BMesh *bm, const char hflag) +void BM_mesh_flag_disable_all(BMesh *bm, const char hflag) { const char iter_types[3] = {BM_VERTS_OF_MESH, BM_EDGES_OF_MESH, @@ -763,7 +762,7 @@ void BM_clear_flag_all(BMesh *bm, const char hflag) ele = BM_iter_new(&iter, bm, iter_types[i], NULL); for ( ; ele; ele = BM_iter_step(&iter)) { if (hflag & BM_ELEM_SELECT) BM_elem_select_set(bm, ele, FALSE); - BM_elem_flag_clear(ele, hflag); + BM_elem_flag_disable(ele, hflag); } } } @@ -771,32 +770,33 @@ void BM_clear_flag_all(BMesh *bm, const char hflag) /***************** Mesh Hiding stuff *********** */ -#define SETHIDE(ele) hide ? BM_elem_flag_set(ele, BM_ELEM_HIDDEN) : BM_elem_flag_clear(ele, BM_ELEM_HIDDEN); +#define BM_ELEM_HIDE_SET(ele, hide) \ + (hide) ? BM_elem_flag_enable(ele, BM_ELEM_HIDDEN) : BM_elem_flag_disable(ele, BM_ELEM_HIDDEN); -static void vert_flush_hide(BMesh *bm, BMVert *v) +static void vert_flush_hide_set(BMesh *bm, BMVert *v) { BMIter iter; BMEdge *e; - int hide = 1; + int hide = TRUE; BM_ITER(e, &iter, bm, BM_EDGES_OF_VERT, v) { hide = hide && BM_elem_flag_test(e, BM_ELEM_HIDDEN); } - SETHIDE(v); + BM_ELEM_HIDE_SET(v, hide); } static void edge_flush_hide(BMesh *bm, BMEdge *e) { BMIter iter; BMFace *f; - int hide = 1; + int hide = TRUE; BM_ITER(f, &iter, bm, BM_FACES_OF_EDGE, e) { hide = hide && BM_elem_flag_test(f, BM_ELEM_HIDDEN); } - SETHIDE(e); + BM_ELEM_HIDE_SET(e, hide); } void BM_vert_hide_set(BMesh *bm, BMVert *v, int hide) @@ -806,13 +806,13 @@ void BM_vert_hide_set(BMesh *bm, BMVert *v, int hide) BMEdge *e; BMFace *f; - SETHIDE(v); + BM_ELEM_HIDE_SET(v, hide); BM_ITER(e, &iter, bm, BM_EDGES_OF_VERT, v) { - SETHIDE(e); + BM_ELEM_HIDE_SET(e, hide); BM_ITER(f, &fiter, bm, BM_FACES_OF_EDGE, e) { - SETHIDE(f); + BM_ELEM_HIDE_SET(f, hide); } } } @@ -825,14 +825,14 @@ void BM_edge_hide_set(BMesh *bm, BMEdge *e, int hide) /* edge hiding: faces around the edge */ BM_ITER(f, &iter, bm, BM_FACES_OF_EDGE, e) { - SETHIDE(f); + BM_ELEM_HIDE_SET(f, hide); } - SETHIDE(e); + BM_ELEM_HIDE_SET(e, hide); /* hide vertices if necassary */ - vert_flush_hide(bm, e->v1); - vert_flush_hide(bm, e->v2); + vert_flush_hide_set(bm, e->v1); + vert_flush_hide_set(bm, e->v2); } void BM_face_hide_set(BMesh *bm, BMFace *f, int hide) @@ -840,17 +840,20 @@ void BM_face_hide_set(BMesh *bm, BMFace *f, int hide) BMIter iter; BMLoop *l; - SETHIDE(f); + BM_ELEM_HIDE_SET(f, hide); BM_ITER(l, &iter, bm, BM_LOOPS_OF_FACE, f) { edge_flush_hide(bm, l->e); } BM_ITER(l, &iter, bm, BM_LOOPS_OF_FACE, f) { - vert_flush_hide(bm, l->v); + vert_flush_hide_set(bm, l->v); } } +#undef BM_ELEM_HIDE_SET + + void BM_elem_hide_set(BMesh *bm, void *element, int hide) { BMHeader *h = element; diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c index 33983167325..7061ad13cc2 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.c +++ b/source/blender/bmesh/intern/bmesh_mesh.c @@ -337,7 +337,7 @@ static void bmesh_rationalize_normals(BMesh *bm, int undo) if (BM_elem_flag_test(f, BM_ELEM_TAG)) { BM_face_normal_flip(bm, f); } - BM_elem_flag_clear(f, BM_ELEM_TAG); + BM_elem_flag_disable(f, BM_ELEM_TAG); } return; @@ -350,8 +350,8 @@ static void bmesh_rationalize_normals(BMesh *bm, int undo) BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) { if (BMO_elem_flag_test(bm, f, FACE_FLIP)) - BM_elem_flag_set(f, BM_ELEM_TAG); - else BM_elem_flag_clear(f, BM_ELEM_TAG); + BM_elem_flag_enable(f, BM_ELEM_TAG); + else BM_elem_flag_disable(f, BM_ELEM_TAG); } BMO_pop(bm); diff --git a/source/blender/bmesh/intern/bmesh_newcore.c b/source/blender/bmesh/intern/bmesh_newcore.c index e8a0e8f8698..96c0535da4a 100644 --- a/source/blender/bmesh/intern/bmesh_newcore.c +++ b/source/blender/bmesh/intern/bmesh_newcore.c @@ -1556,15 +1556,15 @@ BMFace *bmesh_jfke(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e) /* validate no internal join */ for (i = 0, l_iter = BM_FACE_FIRST_LOOP(f1); i < f1len; i++, l_iter = l_iter->next) { - BM_elem_flag_clear(l_iter->v, BM_ELEM_TAG); + BM_elem_flag_disable(l_iter->v, BM_ELEM_TAG); } for (i = 0, l_iter = BM_FACE_FIRST_LOOP(f2); i < f2len; i++, l_iter = l_iter->next) { - BM_elem_flag_clear(l_iter->v, BM_ELEM_TAG); + BM_elem_flag_disable(l_iter->v, BM_ELEM_TAG); } for (i = 0, l_iter = BM_FACE_FIRST_LOOP(f1); i < f1len; i++, l_iter = l_iter->next) { if (l_iter != f1loop) { - BM_elem_flag_set(l_iter->v, BM_ELEM_TAG); + BM_elem_flag_enable(l_iter->v, BM_ELEM_TAG); } } for (i = 0, l_iter = BM_FACE_FIRST_LOOP(f2); i < f2len; i++, l_iter = l_iter->next) { diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c index eff93dacd41..acdd3a6dbbb 100644 --- a/source/blender/bmesh/intern/bmesh_operators.c +++ b/source/blender/bmesh/intern/bmesh_operators.c @@ -78,12 +78,12 @@ const int BMOP_OPSLOT_TYPEINFO[] = { /* Dummy slot so there is something to return when slot name lookup fails */ static BMOpSlot BMOpEmptySlot = {0}; -void BMO_op_flag_set(BMesh *UNUSED(bm), BMOperator *op, const int op_flag) +void BMO_op_flag_enable(BMesh *UNUSED(bm), BMOperator *op, const int op_flag) { op->flag |= op_flag; } -void BMO_op_flag_clear(BMesh *UNUSED(bm), BMOperator *op, const int op_flag) +void BMO_op_flag_disable(BMesh *UNUSED(bm), BMOperator *op, const int op_flag) { op->flag &= ~op_flag; } @@ -458,7 +458,7 @@ int BMO_mesh_flag_count(BMesh *bm, const short oflag, const char htype) return count; } -void BMO_mesh_flag_clear_all(BMesh *bm, BMOperator *UNUSED(op), const char htype, const short oflag) +void BMO_mesh_flag_disable_all(BMesh *bm, BMOperator *UNUSED(op), const char htype, const short oflag) { const char iter_types[3] = {BM_VERTS_OF_MESH, BM_EDGES_OF_MESH, @@ -473,7 +473,7 @@ void BMO_mesh_flag_clear_all(BMesh *bm, BMOperator *UNUSED(op), const char htype for (i = 0; i < 3; i++) { if (htype & flag_types[i]) { BM_ITER(ele, &iter, bm, iter_types[i], NULL) { - BMO_elem_flag_clear(bm, ele, oflag); + BMO_elem_flag_disable(bm, ele, oflag); } } } @@ -549,7 +549,7 @@ void BMO_slot_map_to_flag(struct BMesh *bm, struct BMOperator *op, BLI_ghashIterator_init(&it, slot->data.ghash); for ( ; (ele = BLI_ghashIterator_getKey(&it)); BLI_ghashIterator_step(&it)) { - BMO_elem_flag_set(bm, ele, oflag); + BMO_elem_flag_enable(bm, ele, oflag); } } @@ -719,8 +719,8 @@ void BMO_slot_from_flag(BMesh *bm, BMOperator *op, const char *slotname, * Header Flags elements in a slots buffer, automatically * using the selection API where appropriate. */ -void BMO_slot_buffer_hflag(BMesh *bm, BMOperator *op, const char *slotname, - const char hflag, const char htype) +void BMO_slot_buffer_hflag_enable(BMesh *bm, BMOperator *op, const char *slotname, + const char hflag, const char htype) { BMOpSlot *slot = BMO_slot_get(op, slotname); BMHeader **data = slot->data.p; @@ -733,7 +733,7 @@ void BMO_slot_buffer_hflag(BMesh *bm, BMOperator *op, const char *slotname, if (hflag & BM_ELEM_SELECT) { BM_elem_select_set(bm, data[i], TRUE); } - BM_elem_flag_set(data[i], hflag); + BM_elem_flag_enable(data[i], hflag); } } @@ -744,8 +744,8 @@ void BMO_slot_buffer_hflag(BMesh *bm, BMOperator *op, const char *slotname, * Removes flags from elements in a slots buffer, automatically * using the selection API where appropriate. */ -void BMO_slot_buffer_hflag_clear(BMesh *bm, BMOperator *op, const char *slotname, - const char hflag, const char htype) +void BMO_slot_buffer_hflag_disable(BMesh *bm, BMOperator *op, const char *slotname, + const char hflag, const char htype) { BMOpSlot *slot = BMO_slot_get(op, slotname); BMHeader **data = slot->data.p; @@ -759,7 +759,7 @@ void BMO_slot_buffer_hflag_clear(BMesh *bm, BMOperator *op, const char *slotname BM_elem_select_set(bm, data[i], FALSE); } - BM_elem_flag_clear(data[i], hflag); + BM_elem_flag_disable(data[i], hflag); } } int BMO_vert_edge_flags_count(BMesh *bm, BMVert *v, const short oflag) @@ -798,7 +798,7 @@ void BMO_slot_buffer_flag(BMesh *bm, BMOperator *op, const char *slotname, if (!(htype & data[i]->htype)) continue; - BMO_elem_flag_set(bm, data[i], oflag); + BMO_elem_flag_enable(bm, data[i], oflag); } } @@ -819,7 +819,7 @@ void BMO_slot_buffer_flag_clear(BMesh *bm, BMOperator *op, const char *slotname, if (!(htype & data[i]->htype)) continue; - BMO_elem_flag_clear(bm, data[i], oflag); + BMO_elem_flag_disable(bm, data[i], oflag); } } @@ -1389,10 +1389,10 @@ static void BMO_elem_flag_toggle(BMesh *bm, void *element, const short oflag) * * Sets a flag for a certain element */ -#ifdef BMO_elem_flag_set -#undef BMO_elem_flag_set +#ifdef BMO_elem_flag_enable +#undef BMO_elem_flag_enable #endif -static void BMO_elem_flag_set(BMesh *bm, void *element, const short oflag) +static void BMO_elem_flag_enable(BMesh *bm, void *element, const short oflag) { BMHeader *head = element; head->flags[bm->stackdepth - 1].f |= oflag; @@ -1403,10 +1403,10 @@ static void BMO_elem_flag_set(BMesh *bm, void *element, const short oflag) * * Clears a specific flag from a given element */ -#ifdef BMO_elem_flag_clear -#undef BMO_elem_flag_clear +#ifdef BMO_elem_flag_disable +#undef BMO_elem_flag_disable #endif -static void BMO_elem_flag_clear(BMesh *bm, void *element, const short oflag) +static void BMO_elem_flag_disable(BMesh *bm, void *element, const short oflag) { BMHeader *head = element; head->flags[bm->stackdepth - 1].f &= ~oflag; diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c index f26f942e2ac..efc025932fd 100644 --- a/source/blender/bmesh/intern/bmesh_polygon.c +++ b/source/blender/bmesh/intern/bmesh_polygon.c @@ -892,8 +892,8 @@ void BM_Triangulate_Face(BMesh *bm, BMFace *f, float (*projectverts)[3], break; } - BMO_elem_flag_set(bm, newl->e, newedge_oflag); - BMO_elem_flag_set(bm, f, newface_oflag); + BMO_elem_flag_enable(bm, newl->e, newedge_oflag); + BMO_elem_flag_enable(bm, f, newface_oflag); if (newfaces) newfaces[nf_i++] = f; @@ -924,8 +924,8 @@ void BM_Triangulate_Face(BMesh *bm, BMFace *f, float (*projectverts)[3], if (newfaces) newfaces[nf_i++] = f; - BMO_elem_flag_set(bm, newl->e, newedge_oflag); - BMO_elem_flag_set(bm, f, newface_oflag); + BMO_elem_flag_enable(bm, newl->e, newedge_oflag); + BMO_elem_flag_enable(bm, f, newface_oflag); l_iter = nextloop; } } diff --git a/source/blender/bmesh/intern/bmesh_queries.c b/source/blender/bmesh/intern/bmesh_queries.c index e4582e7a02f..47f25f6d22e 100644 --- a/source/blender/bmesh/intern/bmesh_queries.c +++ b/source/blender/bmesh/intern/bmesh_queries.c @@ -129,7 +129,7 @@ int BM_verts_in_face(BMesh *bm, BMFace *f, BMVert **varr, int len) BMLoop *curloop = NULL; int i, count = 0; - for (i = 0; i < len; i++) BMO_elem_flag_set(bm, varr[i], BM_OVERLAP); + for (i = 0; i < len; i++) BMO_elem_flag_enable(bm, varr[i], BM_OVERLAP); for (lst = f->loops.first; lst; lst = lst->next) { curloop = lst->first; @@ -142,7 +142,7 @@ int BM_verts_in_face(BMesh *bm, BMFace *f, BMVert **varr, int len) } while (curloop != lst->first); } - for (i = 0; i < len; i++) BMO_elem_flag_clear(bm, varr[i], BM_OVERLAP); + for (i = 0; i < len; i++) BMO_elem_flag_disable(bm, varr[i], BM_OVERLAP); return count; } diff --git a/source/blender/bmesh/operators/bmo_bevel.c b/source/blender/bmesh/operators/bmo_bevel.c index b9b43c7ada6..bd7ad251312 100644 --- a/source/blender/bmesh/operators/bmo_bevel.c +++ b/source/blender/bmesh/operators/bmo_bevel.c @@ -187,28 +187,28 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op) BLI_smallhash_init(&hash); BMO_ITER(e, &siter, bm, op, "geom", BM_EDGE) { - BMO_elem_flag_set(bm, e, BEVEL_FLAG|BEVEL_DEL); - BMO_elem_flag_set(bm, e->v1, BEVEL_FLAG|BEVEL_DEL); - BMO_elem_flag_set(bm, e->v2, BEVEL_FLAG|BEVEL_DEL); + BMO_elem_flag_enable(bm, e, BEVEL_FLAG|BEVEL_DEL); + BMO_elem_flag_enable(bm, e->v1, BEVEL_FLAG|BEVEL_DEL); + BMO_elem_flag_enable(bm, e->v2, BEVEL_FLAG|BEVEL_DEL); if (BM_edge_face_count(e) < 2) { - BMO_elem_flag_clear(bm, e, BEVEL_DEL); - BMO_elem_flag_clear(bm, e->v1, BEVEL_DEL); - BMO_elem_flag_clear(bm, e->v2, BEVEL_DEL); + BMO_elem_flag_disable(bm, e, BEVEL_DEL); + BMO_elem_flag_disable(bm, e->v1, BEVEL_DEL); + BMO_elem_flag_disable(bm, e->v2, BEVEL_DEL); } #if 0 if (BM_edge_face_count(e) == 0) { BMVert *verts[2] = {e->v1, e->v2}; BMEdge *edges[2] = {e, BM_edge_create(bm, e->v1, e->v2, e, 0)}; - BMO_elem_flag_set(bm, edges[1], BEVEL_FLAG); + BMO_elem_flag_enable(bm, edges[1], BEVEL_FLAG); BM_face_create(bm, verts, edges, 2, FALSE); } #endif } BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) { - BMO_elem_flag_set(bm, v, VERT_OLD); + BMO_elem_flag_enable(bm, v, VERT_OLD); } #if 0 @@ -223,7 +223,7 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op) BM_elem_index_set(e, BLI_array_count(etags)); /* set_dirty! */ BLI_array_growone(etags); - BMO_elem_flag_set(bm, e, EDGE_OLD); + BMO_elem_flag_enable(bm, e, EDGE_OLD); } BM_ITER(l, &liter, bm, BM_LOOPS_OF_EDGE, e) { @@ -241,11 +241,11 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op) BM_elem_index_set(l2->e, BLI_array_count(etags)); /* set_dirty! */ BLI_array_growone(etags); - BMO_elem_flag_set(bm, l2->e, EDGE_OLD); + BMO_elem_flag_enable(bm, l2->e, EDGE_OLD); } } - BMO_elem_flag_set(bm, l->f, BEVEL_FLAG); + BMO_elem_flag_enable(bm, l->f, BEVEL_FLAG); BLI_array_append(faces, l->f); } } @@ -260,20 +260,20 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op) BMLoop *l; BMIter liter; - BMO_elem_flag_set(bm, e->v1, BEVEL_FLAG|BEVEL_DEL); - BMO_elem_flag_set(bm, e->v2, BEVEL_FLAG|BEVEL_DEL); + BMO_elem_flag_enable(bm, e->v1, BEVEL_FLAG|BEVEL_DEL); + BMO_elem_flag_enable(bm, e->v2, BEVEL_FLAG|BEVEL_DEL); if (BM_edge_face_count(e) < 2) { - BMO_elem_flag_clear(bm, e, BEVEL_DEL); - BMO_elem_flag_clear(bm, e->v1, BEVEL_DEL); - BMO_elem_flag_clear(bm, e->v2, BEVEL_DEL); + BMO_elem_flag_disable(bm, e, BEVEL_DEL); + BMO_elem_flag_disable(bm, e->v1, BEVEL_DEL); + BMO_elem_flag_disable(bm, e->v2, BEVEL_DEL); } if (!BLI_smallhash_haskey(&hash, (intptr_t)e)) { BLI_array_growone(etags); BM_elem_index_set(e, BLI_array_count(etags) - 1); /* set_dirty! */ BLI_smallhash_insert(&hash, (intptr_t)e, NULL); - BMO_elem_flag_set(bm, e, EDGE_OLD); + BMO_elem_flag_enable(bm, e, EDGE_OLD); } /* find all faces surrounding e->v1 and, e->v2 */ @@ -295,12 +295,12 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op) BLI_array_growone(etags); BM_elem_index_set(l2->e, BLI_array_count(etags) - 1); /* set_dirty! */ BLI_smallhash_insert(&hash, (intptr_t)l2->e, NULL); - BMO_elem_flag_set(bm, l2->e, EDGE_OLD); + BMO_elem_flag_enable(bm, l2->e, EDGE_OLD); } } BLI_smallhash_insert(&hash, (intptr_t)l->f, NULL); - BMO_elem_flag_set(bm, l->f, BEVEL_FLAG); + BMO_elem_flag_enable(bm, l->f, BEVEL_FLAG); BLI_array_append(faces, l->f); } } @@ -341,7 +341,7 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op) BMLoop *l; BMIter liter; - BMO_elem_flag_set(bm, faces[i], FACE_OLD); + BMO_elem_flag_enable(bm, faces[i], FACE_OLD); BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, faces[i]) { float co[3]; @@ -400,7 +400,7 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op) else { tag = tags + BM_elem_index_get(l); tag->newv = l->v; - BMO_elem_flag_clear(bm, l->v, BEVEL_DEL); + BMO_elem_flag_disable(bm, l->v, BEVEL_DEL); } } } @@ -412,7 +412,7 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op) BMFace *f; BMVert *lastv = NULL, *firstv = NULL; - BMO_elem_flag_set(bm, faces[i], BEVEL_DEL); + BMO_elem_flag_enable(bm, faces[i], BEVEL_DEL); BLI_array_empty(verts); BLI_array_empty(edges); @@ -459,7 +459,7 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op) continue; } - BMO_elem_flag_set(bm, f, FACE_NEW); + BMO_elem_flag_enable(bm, f, FACE_NEW); } for (i = 0; i < BLI_array_count(faces); i++) { @@ -515,8 +515,8 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op) } } - BMO_elem_flag_clear(bm, v3, BEVEL_DEL); - BMO_elem_flag_clear(bm, v4, BEVEL_DEL); + BMO_elem_flag_disable(bm, v3, BEVEL_DEL); + BMO_elem_flag_disable(bm, v4, BEVEL_DEL); } if (v1 != v2 && v2 != v3 && v3 != v4) { @@ -574,11 +574,11 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op) continue; } - BMO_elem_flag_set(bm, f, FACE_NEW|FACE_SPAN); + BMO_elem_flag_enable(bm, f, FACE_NEW|FACE_SPAN); /* un-tag edges in f for deletio */ BM_ITER(l2, &liter2, bm, BM_LOOPS_OF_FACE, f) { - BMO_elem_flag_clear(bm, l2->e, BEVEL_DEL); + BMO_elem_flag_disable(bm, l2->e, BEVEL_DEL); } } else { @@ -752,7 +752,7 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op) fprintf(stderr, "%s: in bevel vert fill! (bmesh internal error)\n", __func__); } else { - BMO_elem_flag_set(bm, f, FACE_NEW|FACE_HOLE); + BMO_elem_flag_enable(bm, f, FACE_NEW|FACE_HOLE); } } BLI_smallhash_release(&tmphash); @@ -844,7 +844,7 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op) /* clean up any edges that might not get properly delete */ BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) { if (BMO_elem_flag_test(bm, e, EDGE_OLD) && !e->l) - BMO_elem_flag_set(bm, e, BEVEL_DEL); + BMO_elem_flag_enable(bm, e, BEVEL_DEL); } BMO_op_callf(bm, "del geom=%fe context=%i", BEVEL_DEL, DEL_EDGES); diff --git a/source/blender/bmesh/operators/bmo_connect.c b/source/blender/bmesh/operators/bmo_connect.c index d9598e05c93..d4b8f2bf590 100644 --- a/source/blender/bmesh/operators/bmo_connect.c +++ b/source/blender/bmesh/operators/bmo_connect.c @@ -105,8 +105,8 @@ void connectverts_exec(BMesh *bm, BMOperator *op) BLI_array_free(loops); return; } - BMO_elem_flag_set(bm, nf, FACE_NEW); - BMO_elem_flag_set(bm, nl->e, EDGE_OUT); + BMO_elem_flag_enable(bm, nf, FACE_NEW); + BMO_elem_flag_enable(bm, nl->e, EDGE_OUT); } } @@ -224,7 +224,7 @@ void bmesh_bridge_loops_exec(BMesh *bm, BMOperator *op) BLI_array_append(vv2, v); } - BMO_elem_flag_set(bm, e2, EDGE_DONE); + BMO_elem_flag_enable(bm, e2, EDGE_DONE); v = BM_edge_other_vert(e2, v); BM_ITER(e3, &iter, bm, BM_EDGES_OF_VERT, v) { diff --git a/source/blender/bmesh/operators/bmo_create.c b/source/blender/bmesh/operators/bmo_create.c index 553b549e762..dcd4accf5e2 100644 --- a/source/blender/bmesh/operators/bmo_create.c +++ b/source/blender/bmesh/operators/bmo_create.c @@ -893,7 +893,7 @@ void bmesh_edgenet_fill_exec(BMesh *bm, BMOperator *op) BM_mesh_elem_index_ensure(bm, BM_VERT); BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) { - BMO_elem_flag_set(bm, f, ELE_ORIG); + BMO_elem_flag_enable(bm, f, ELE_ORIG); } i = 0; @@ -1021,7 +1021,7 @@ void bmesh_edgenet_fill_exec(BMesh *bm, BMOperator *op) f = BM_face_create_ngon(bm, v1, v2, edges, i, TRUE); if (f && !BMO_elem_flag_test(bm, f, ELE_ORIG)) { - BMO_elem_flag_set(bm, f, FACE_NEW); + BMO_elem_flag_enable(bm, f, FACE_NEW); } if (use_restrict) @@ -1123,7 +1123,7 @@ void bmesh_edgenet_prepare(BMesh *bm, BMOperator *op) i = 0; while (e) { - BMO_elem_flag_set(bm, e, EDGE_VIS); + BMO_elem_flag_enable(bm, e, EDGE_VIS); BLI_array_growone(edges); edges[i] = e; @@ -1205,9 +1205,9 @@ void bmesh_edgenet_prepare(BMesh *bm, BMOperator *op) } e = BM_edge_create(bm, v1, v3, NULL, TRUE); - BMO_elem_flag_set(bm, e, ELE_NEW); + BMO_elem_flag_enable(bm, e, ELE_NEW); e = BM_edge_create(bm, v2, v4, NULL, TRUE); - BMO_elem_flag_set(bm, e, ELE_NEW); + BMO_elem_flag_enable(bm, e, ELE_NEW); } else if (edges1) { BMVert *v1, *v2; @@ -1223,7 +1223,7 @@ void bmesh_edgenet_prepare(BMesh *bm, BMOperator *op) else v2 = edges1[i]->v1; e = BM_edge_create(bm, v1, v2, NULL, TRUE); - BMO_elem_flag_set(bm, e, ELE_NEW); + BMO_elem_flag_enable(bm, e, ELE_NEW); } } @@ -1253,7 +1253,7 @@ void bmesh_contextual_create_exec(BMesh *bm, BMOperator *op) case BM_FACE: totf++; break; } - BMO_elem_flag_set(bm, h, ELE_NEW); + BMO_elem_flag_enable(bm, h, ELE_NEW); } /* --- Support for Special Case --- @@ -1316,10 +1316,10 @@ void bmesh_contextual_create_exec(BMesh *bm, BMOperator *op) if (ok == TRUE && v_free && v_a && v_b) { e = BM_edge_create(bm, v_free, v_a, NULL, TRUE); - BMO_elem_flag_set(bm, &e->head, ELE_NEW); + BMO_elem_flag_enable(bm, &e->head, ELE_NEW); e = BM_edge_create(bm, v_free, v_b, NULL, TRUE); - BMO_elem_flag_set(bm, &e->head, ELE_NEW); + BMO_elem_flag_enable(bm, &e->head, ELE_NEW); } } /* --- end special case support, continue as normal --- */ @@ -1372,7 +1372,7 @@ void bmesh_contextual_create_exec(BMesh *bm, BMOperator *op) if (amount == 2) { /* create edg */ e = BM_edge_create(bm, verts[0], verts[1], NULL, TRUE); - BMO_elem_flag_set(bm, e, ELE_OUT); + BMO_elem_flag_enable(bm, e, ELE_OUT); } else if (amount == 3) { /* create triangl */ @@ -1404,6 +1404,6 @@ void bmesh_contextual_create_exec(BMesh *bm, BMOperator *op) printf("cannot find nice quad from concave set of vertices\n"); } - if (f) BMO_elem_flag_set(bm, f, ELE_OUT); + if (f) BMO_elem_flag_enable(bm, f, ELE_OUT); } } diff --git a/source/blender/bmesh/operators/bmo_dissolve.c b/source/blender/bmesh/operators/bmo_dissolve.c index ecab6fc7881..f6b8d90993b 100644 --- a/source/blender/bmesh/operators/bmo_dissolve.c +++ b/source/blender/bmesh/operators/bmo_dissolve.c @@ -88,10 +88,10 @@ void dissolvefaces_exec(BMesh *bm, BMOperator *op) BM_ITER(v, &viter, bm, BM_VERTS_OF_MESH, NULL) { if (BM_vert_edge_count(v) == 2) { - BMO_elem_flag_clear(bm, v, VERT_MARK); + BMO_elem_flag_disable(bm, v, VERT_MARK); } else { - BMO_elem_flag_set(bm, v, VERT_MARK); + BMO_elem_flag_enable(bm, v, VERT_MARK); } } } @@ -118,8 +118,8 @@ void dissolvefaces_exec(BMesh *bm, BMOperator *op) for (i = 0; i < BLI_array_count(faces); i++) { f2 = faces[i]; - BMO_elem_flag_clear(bm, f2, FACE_MARK); - BMO_elem_flag_set(bm, f2, FACE_ORIG); + BMO_elem_flag_disable(bm, f2, FACE_MARK); + BMO_elem_flag_enable(bm, f2, FACE_ORIG); } if (BMO_error_occurred(bm)) { @@ -154,8 +154,8 @@ void dissolvefaces_exec(BMesh *bm, BMOperator *op) /* if making the new face failed (e.g. overlapping test) * unmark the original faces for deletion */ - BMO_elem_flag_clear(bm, f, FACE_ORIG); - BMO_elem_flag_set(bm, f, FACE_NEW); + BMO_elem_flag_disable(bm, f, FACE_ORIG); + BMO_elem_flag_enable(bm, f, FACE_NEW); } @@ -202,8 +202,8 @@ void dissolve_edgeloop_exec(BMesh *bm, BMOperator *op) BMO_ITER(e, &oiter, bm, op, "edges", BM_EDGE) { if (BM_edge_face_count(e) == 2) { - BMO_elem_flag_set(bm, e->v1, VERT_MARK); - BMO_elem_flag_set(bm, e->v2, VERT_MARK); + BMO_elem_flag_enable(bm, e->v1, VERT_MARK); + BMO_elem_flag_enable(bm, e->v2, VERT_MARK); BM_faces_join_pair(bm, e->l->f, e->l->radial_next->f, @@ -251,10 +251,10 @@ void dissolveedges_exec(BMesh *bm, BMOperator *op) if (use_verts) { BM_ITER(v, &viter, bm, BM_VERTS_OF_MESH, NULL) { if (BM_vert_edge_count(v) == 2) { - BMO_elem_flag_clear(bm, v, VERT_MARK); + BMO_elem_flag_disable(bm, v, VERT_MARK); } else { - BMO_elem_flag_set(bm, v, VERT_MARK); + BMO_elem_flag_enable(bm, v, VERT_MARK); } } } @@ -349,8 +349,8 @@ void dissolveverts_exec(BMesh *bm, BMOperator *op) f = BM_iter_new(&fiter, bm, BM_FACES_OF_VERT, v); for ( ; f; f = BM_iter_step(&fiter)) { - BMO_elem_flag_set(bm, f, FACE_ORIG); - BMO_elem_flag_set(bm, f, FACE_MARK); + BMO_elem_flag_enable(bm, f, FACE_ORIG); + BMO_elem_flag_enable(bm, f, FACE_MARK); } /* check if our additions to the input to face dissolve @@ -359,15 +359,15 @@ void dissolveverts_exec(BMesh *bm, BMOperator *op) f = BM_iter_new(&fiter, bm, BM_FACES_OF_VERT, v); for ( ; f; f = BM_iter_step(&fiter)) { if (BMO_elem_flag_test(bm, f, FACE_ORIG)) { - BMO_elem_flag_clear(bm, f, FACE_MARK); - BMO_elem_flag_clear(bm, f, FACE_ORIG); + BMO_elem_flag_disable(bm, f, FACE_MARK); + BMO_elem_flag_disable(bm, f, FACE_ORIG); } } } else { f = BM_iter_new(&fiter, bm, BM_FACES_OF_VERT, v); for ( ; f; f = BM_iter_step(&fiter)) { - BMO_elem_flag_clear(bm, f, FACE_ORIG); + BMO_elem_flag_disable(bm, f, FACE_ORIG); } } } diff --git a/source/blender/bmesh/operators/bmo_dupe.c b/source/blender/bmesh/operators/bmo_dupe.c index ff9515fc43e..5e167d944b0 100644 --- a/source/blender/bmesh/operators/bmo_dupe.c +++ b/source/blender/bmesh/operators/bmo_dupe.c @@ -54,7 +54,7 @@ static BMVert *copy_vertex(BMesh *source_mesh, BMVert *source_vertex, BMesh *tar BM_elem_copy_attrs(source_mesh, target_mesh, source_vertex, target_vertex); /* Set internal op flag */ - BMO_elem_flag_set(target_mesh, (BMHeader *)target_vertex, DUPE_NEW); + BMO_elem_flag_enable(target_mesh, (BMHeader *)target_vertex, DUPE_NEW); return target_vertex; } @@ -110,7 +110,7 @@ static BMEdge *copy_edge(BMOperator *op, BMesh *source_mesh, BM_elem_copy_attrs(source_mesh, target_mesh, source_edge, target_edge); /* Set internal op flags */ - BMO_elem_flag_set(target_mesh, (BMHeader *)target_edge, DUPE_NEW); + BMO_elem_flag_enable(target_mesh, (BMHeader *)target_edge, DUPE_NEW); return target_edge; } @@ -159,7 +159,7 @@ static BMFace *copy_face(BMOperator *op, BMesh *source_mesh, BM_elem_copy_attrs(source_mesh, target_mesh, source_face, target_face); /* mark the face for outpu */ - BMO_elem_flag_set(target_mesh, (BMHeader *)target_face, DUPE_NEW); + BMO_elem_flag_enable(target_mesh, (BMHeader *)target_face, DUPE_NEW); /* copy per-loop custom dat */ BM_ITER(source_loop, &iter, source_mesh, BM_LOOPS_OF_FACE, source_face) { @@ -229,7 +229,7 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target) BMO_slot_map_ptr_insert(source, op, "isovertmap", v, v2); } - BMO_elem_flag_set(source, (BMHeader *)v, DUPE_DONE); + BMO_elem_flag_enable(source, (BMHeader *)v, DUPE_DONE); } } @@ -239,15 +239,15 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target) /* make sure that verts are copie */ if (!BMO_elem_flag_test(source, (BMHeader *)e->v1, DUPE_DONE)) { copy_vertex(source, e->v1, target, vhash); - BMO_elem_flag_set(source, (BMHeader *)e->v1, DUPE_DONE); + BMO_elem_flag_enable(source, (BMHeader *)e->v1, DUPE_DONE); } if (!BMO_elem_flag_test(source, (BMHeader *)e->v2, DUPE_DONE)) { copy_vertex(source, e->v2, target, vhash); - BMO_elem_flag_set(source, (BMHeader *)e->v2, DUPE_DONE); + BMO_elem_flag_enable(source, (BMHeader *)e->v2, DUPE_DONE); } /* now copy the actual edg */ copy_edge(op, source, e, target, vhash, ehash); - BMO_elem_flag_set(source, (BMHeader *)e, DUPE_DONE); + BMO_elem_flag_enable(source, (BMHeader *)e, DUPE_DONE); } } @@ -258,7 +258,7 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target) for (v = BM_iter_new(&verts, source, BM_VERTS_OF_FACE, f); v; v = BM_iter_step(&verts)) { if (!BMO_elem_flag_test(source, (BMHeader *)v, DUPE_DONE)) { copy_vertex(source, v, target, vhash); - BMO_elem_flag_set(source, (BMHeader *)v, DUPE_DONE); + BMO_elem_flag_enable(source, (BMHeader *)v, DUPE_DONE); } } @@ -266,7 +266,7 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target) for (e = BM_iter_new(&edges, source, BM_EDGES_OF_FACE, f); e; e = BM_iter_step(&edges)) { if (!BMO_elem_flag_test(source, (BMHeader *)e, DUPE_DONE)) { copy_edge(op, source, e, target, vhash, ehash); - BMO_elem_flag_set(source, (BMHeader *)e, DUPE_DONE); + BMO_elem_flag_enable(source, (BMHeader *)e, DUPE_DONE); } } @@ -278,7 +278,7 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target) BLI_array_growitems(edar, f->len); copy_face(op, source, f, target, vtar, edar, vhash, ehash); - BMO_elem_flag_set(source, (BMHeader *)f, DUPE_DONE); + BMO_elem_flag_enable(source, (BMHeader *)f, DUPE_DONE); } } @@ -400,7 +400,7 @@ void splitop_exec(BMesh *bm, BMOperator *op) break; } } - if (!found) BMO_elem_flag_set(bm, e, SPLIT_INPUT); + if (!found) BMO_elem_flag_enable(bm, e, SPLIT_INPUT); } for (v = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL); v; v = BM_iter_step(&iter)) { @@ -412,7 +412,7 @@ void splitop_exec(BMesh *bm, BMOperator *op) break; } } - if (!found) BMO_elem_flag_set(bm, v, SPLIT_INPUT); + if (!found) BMO_elem_flag_enable(bm, v, SPLIT_INPUT); } diff --git a/source/blender/bmesh/operators/bmo_edgesplit.c b/source/blender/bmesh/operators/bmo_edgesplit.c index 41ad1c89e75..fe9e121cb86 100644 --- a/source/blender/bmesh/operators/bmo_edgesplit.c +++ b/source/blender/bmesh/operators/bmo_edgesplit.c @@ -103,14 +103,14 @@ static BMFace *remake_face(BMesh *bm, EdgeTag *etags, BMFace *f, BMVert **verts, } if (BMO_elem_flag_test(bm, l->e, EDGE_SEAM)) { - BMO_elem_flag_set(bm, l2->e, EDGE_SEAM); + BMO_elem_flag_enable(bm, l2->e, EDGE_SEAM); } BM_elem_copy_attrs(bm, bm, l->e, l2->e); } - BMO_elem_flag_set(bm, l->e, EDGE_MARK); - BMO_elem_flag_set(bm, l2->e, EDGE_MARK); + BMO_elem_flag_enable(bm, l->e, EDGE_MARK); + BMO_elem_flag_enable(bm, l2->e, EDGE_MARK); } return f2; @@ -152,29 +152,29 @@ static void tag_out_edges(BMesh *bm, EdgeTag *etags, BMOperator *UNUSED(op)) et = &etags[BM_elem_index_get(l->e)]; if (et->newe1 == l->e) { if (et->newe1) { - BMO_elem_flag_set(bm, et->newe1, EDGE_RET1); - BMO_elem_flag_clear(bm, et->newe1, EDGE_SEAM); + BMO_elem_flag_enable(bm, et->newe1, EDGE_RET1); + BMO_elem_flag_disable(bm, et->newe1, EDGE_SEAM); } if (et->newe2) { - BMO_elem_flag_set(bm, et->newe2, EDGE_RET2); - BMO_elem_flag_clear(bm, et->newe2, EDGE_SEAM); + BMO_elem_flag_enable(bm, et->newe2, EDGE_RET2); + BMO_elem_flag_disable(bm, et->newe2, EDGE_SEAM); } } else { if (et->newe1) { - BMO_elem_flag_set(bm, et->newe1, EDGE_RET2); - BMO_elem_flag_clear(bm, et->newe1, EDGE_SEAM); + BMO_elem_flag_enable(bm, et->newe1, EDGE_RET2); + BMO_elem_flag_disable(bm, et->newe1, EDGE_SEAM); } if (et->newe2) { - BMO_elem_flag_set(bm, et->newe2, EDGE_RET1); - BMO_elem_flag_clear(bm, et->newe2, EDGE_SEAM); + BMO_elem_flag_enable(bm, et->newe2, EDGE_RET1); + BMO_elem_flag_disable(bm, et->newe2, EDGE_SEAM); } } /* If the original edge was non-manifold edges, then it is * possible l->e is not et->newe1 or et->newe2. So always clear * the flag on l->e as well, to prevent infinite looping. */ - BMO_elem_flag_clear(bm, l->e, EDGE_SEAM); + BMO_elem_flag_disable(bm, l->e, EDGE_SEAM); startl = l; do { @@ -226,7 +226,7 @@ void bmesh_edgesplitop_exec(BMesh *bm, BMOperator *op) } if (!e2) { - BMO_elem_flag_clear(bm, e, EDGE_SEAM); + BMO_elem_flag_disable(bm, e, EDGE_SEAM); } } @@ -380,8 +380,8 @@ void bmesh_edgesplitop_exec(BMesh *bm, BMOperator *op) continue; } - BMO_elem_flag_set(bm, f, FACE_DEL); - BMO_elem_flag_set(bm, f2, FACE_NEW); + BMO_elem_flag_enable(bm, f, FACE_DEL); + BMO_elem_flag_enable(bm, f2, FACE_NEW); } /* remake_face() sets invalid indecies, @@ -402,7 +402,7 @@ void bmesh_edgesplitop_exec(BMesh *bm, BMOperator *op) BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) { if (BMO_elem_flag_test(bm, e, EDGE_MARK)) { if (!e->l) { - BMO_elem_flag_set(bm, e, EDGE_DEL); + BMO_elem_flag_enable(bm, e, EDGE_DEL); } } } diff --git a/source/blender/bmesh/operators/bmo_extrude.c b/source/blender/bmesh/operators/bmo_extrude.c index 5fe9ad55d21..394fb98d532 100644 --- a/source/blender/bmesh/operators/bmo_extrude.c +++ b/source/blender/bmesh/operators/bmo_extrude.c @@ -73,7 +73,7 @@ void bmesh_extrude_face_indiv_exec(BMesh *bm, BMOperator *op) e = BM_edge_create(bm, v, firstv, laste, FALSE); edges[i++] = e; - BMO_elem_flag_set(bm, f, EXT_DEL); + BMO_elem_flag_enable(bm, f, EXT_DEL); f2 = BM_face_create_ngon(bm, firstv, BM_edge_other_vert(edges[0], firstv), edges, f->len, FALSE); if (!f2) { @@ -82,7 +82,7 @@ void bmesh_extrude_face_indiv_exec(BMesh *bm, BMOperator *op) return; } - BMO_elem_flag_set(bm, f2, EXT_KEEP); + BMO_elem_flag_enable(bm, f2, EXT_KEEP); BM_elem_copy_attrs(bm, bm, f, f2); l2 = BM_iter_new(&liter2, bm, BM_LOOPS_OF_FACE, f2); @@ -118,9 +118,9 @@ void bmesh_extrude_onlyedge_exec(BMesh *bm, BMOperator *op) BMFace *f; BMO_ITER(e, &siter, bm, op, "edges", BM_EDGE) { - BMO_elem_flag_set(bm, e, EXT_INPUT); - BMO_elem_flag_set(bm, e->v1, EXT_INPUT); - BMO_elem_flag_set(bm, e->v2, EXT_INPUT); + BMO_elem_flag_enable(bm, e, EXT_INPUT); + BMO_elem_flag_enable(bm, e->v1, EXT_INPUT); + BMO_elem_flag_enable(bm, e->v2, EXT_INPUT); } BMO_op_initf(bm, &dupeop, "dupe geom=%fve", EXT_INPUT); @@ -149,10 +149,10 @@ void bmesh_extrude_onlyedge_exec(BMesh *bm, BMOperator *op) if (BMO_elem_flag_test(bm, e, EXT_INPUT)) e = e2; - BMO_elem_flag_set(bm, f, EXT_KEEP); - BMO_elem_flag_set(bm, e, EXT_KEEP); - BMO_elem_flag_set(bm, e->v1, EXT_KEEP); - BMO_elem_flag_set(bm, e->v2, EXT_KEEP); + BMO_elem_flag_enable(bm, f, EXT_KEEP); + BMO_elem_flag_enable(bm, e, EXT_KEEP); + BMO_elem_flag_enable(bm, e->v1, EXT_KEEP); + BMO_elem_flag_enable(bm, e->v2, EXT_KEEP); } @@ -173,8 +173,8 @@ void extrude_vert_indiv_exec(BMesh *bm, BMOperator *op) e = BM_edge_create(bm, v, dupev, NULL, FALSE); - BMO_elem_flag_set(bm, e, EXT_KEEP); - BMO_elem_flag_set(bm, dupev, EXT_KEEP); + BMO_elem_flag_enable(bm, e, EXT_KEEP); + BMO_elem_flag_enable(bm, dupev, EXT_KEEP); } BMO_slot_from_flag(bm, op, "vertout", EXT_KEEP, BM_VERT); @@ -213,7 +213,7 @@ void extrude_edge_context_exec(BMesh *bm, BMOperator *op) } } - if (!found && (rlen > 1)) BMO_elem_flag_set(bm, e, EXT_DEL); + if (!found && (rlen > 1)) BMO_elem_flag_enable(bm, e, EXT_DEL); } } @@ -236,13 +236,13 @@ void extrude_edge_context_exec(BMesh *bm, BMOperator *op) } if (!found) { - BMO_elem_flag_set(bm, v, EXT_DEL); + BMO_elem_flag_enable(bm, v, EXT_DEL); } } BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) { if (BMO_elem_flag_test(bm, f, EXT_INPUT)) - BMO_elem_flag_set(bm, f, EXT_DEL); + BMO_elem_flag_enable(bm, f, EXT_DEL); } if (delorig) { @@ -368,7 +368,7 @@ static void calc_solidify_normals(BMesh *bm) int *edge_face_count = MEM_callocN(sizeof(int) * bm->totedge, __func__); BM_ITER(v, &viter, bm, BM_VERTS_OF_MESH, NULL) { - BM_elem_flag_set(v, BM_ELEM_TAG); + BM_elem_flag_enable(v, BM_ELEM_TAG); } BM_mesh_elem_index_ensure(bm, BM_EDGE); @@ -382,9 +382,9 @@ static void calc_solidify_normals(BMesh *bm) /* And mark all edges and vertices on the * marked faces */ - BMO_elem_flag_set(bm, e, EDGE_MARK); - BMO_elem_flag_set(bm, e->v1, VERT_MARK); - BMO_elem_flag_set(bm, e->v2, VERT_MARK); + BMO_elem_flag_enable(bm, e, EDGE_MARK); + BMO_elem_flag_enable(bm, e->v1, VERT_MARK); + BMO_elem_flag_enable(bm, e->v2, VERT_MARK); edge_face_count[BM_elem_index_get(e)]++; } } @@ -399,9 +399,9 @@ static void calc_solidify_normals(BMesh *bm) if (i == 0 || i > 2) { /* Edge & vertices are non-manifold even when considering * only marked faces */ - BMO_elem_flag_set(bm, e, EDGE_NONMAN); - BMO_elem_flag_set(bm, e->v1, VERT_NONMAN); - BMO_elem_flag_set(bm, e->v2, VERT_NONMAN); + BMO_elem_flag_enable(bm, e, EDGE_NONMAN); + BMO_elem_flag_enable(bm, e->v1, VERT_NONMAN); + BMO_elem_flag_enable(bm, e->v2, VERT_NONMAN); } } MEM_freeN(edge_face_count); @@ -409,7 +409,7 @@ static void calc_solidify_normals(BMesh *bm) BM_ITER(v, &viter, bm, BM_VERTS_OF_MESH, NULL) { if (BM_vert_is_nonmanifold(bm, v)) { - BMO_elem_flag_set(bm, v, VERT_NONMAN); + BMO_elem_flag_enable(bm, v, VERT_NONMAN); continue; } @@ -461,8 +461,8 @@ static void calc_solidify_normals(BMesh *bm) else { /* can't do anything useful here! * Set the face index for a vert incase it gets a zero normal */ - BM_elem_flag_clear(e->v1, BM_ELEM_TAG); - BM_elem_flag_clear(e->v2, BM_ELEM_TAG); + BM_elem_flag_disable(e->v1, BM_ELEM_TAG); + BM_elem_flag_disable(e->v2, BM_ELEM_TAG); continue; } } diff --git a/source/blender/bmesh/operators/bmo_join_triangles.c b/source/blender/bmesh/operators/bmo_join_triangles.c index e996a96b7e6..818e56479d2 100644 --- a/source/blender/bmesh/operators/bmo_join_triangles.c +++ b/source/blender/bmesh/operators/bmo_join_triangles.c @@ -238,9 +238,9 @@ void bmesh_jointriangles_exec(BMesh *bm, BMOperator *op) /* flag all edges of all input face */ BMO_ITER(f1, &siter, bm, op, "faces", BM_FACE) { - BMO_elem_flag_set(bm, f1, FACE_INPUT); + BMO_elem_flag_enable(bm, f1, FACE_INPUT); BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f1) { - BMO_elem_flag_set(bm, l->e, EDGE_MARK); + BMO_elem_flag_enable(bm, l->e, EDGE_MARK); } } @@ -250,7 +250,7 @@ void bmesh_jointriangles_exec(BMesh *bm, BMOperator *op) continue; if (BM_edge_face_count(e) < 2) { - BMO_elem_flag_clear(bm, e, EDGE_MARK); + BMO_elem_flag_disable(bm, e, EDGE_MARK); continue; } @@ -258,12 +258,12 @@ void bmesh_jointriangles_exec(BMesh *bm, BMOperator *op) f2 = e->l->radial_next->f; if (f1->len != 3 || f2->len != 3) { - BMO_elem_flag_clear(bm, e, EDGE_MARK); + BMO_elem_flag_disable(bm, e, EDGE_MARK); continue; } if (!BMO_elem_flag_test(bm, f1, FACE_INPUT) || !BMO_elem_flag_test(bm, f2, FACE_INPUT)) { - BMO_elem_flag_clear(bm, e, EDGE_MARK); + BMO_elem_flag_disable(bm, e, EDGE_MARK); continue; } } @@ -321,9 +321,9 @@ void bmesh_jointriangles_exec(BMesh *bm, BMOperator *op) if (BMO_elem_flag_test(bm, f1, FACE_MARK) || BMO_elem_flag_test(bm, f2, FACE_MARK)) continue; - BMO_elem_flag_set(bm, f1, FACE_MARK); - BMO_elem_flag_set(bm, f2, FACE_MARK); - BMO_elem_flag_set(bm, e, EDGE_CHOSEN); + BMO_elem_flag_enable(bm, f1, FACE_MARK); + BMO_elem_flag_enable(bm, f2, FACE_MARK); + BMO_elem_flag_enable(bm, e, EDGE_CHOSEN); } BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) { diff --git a/source/blender/bmesh/operators/bmo_mesh_conv.c b/source/blender/bmesh/operators/bmo_mesh_conv.c index 0b44bb4e183..ded3b698c77 100644 --- a/source/blender/bmesh/operators/bmo_mesh_conv.c +++ b/source/blender/bmesh/operators/bmo_mesh_conv.c @@ -151,7 +151,7 @@ void mesh_to_bmesh_exec(BMesh *bm, BMOperator *op) v->head.hflag = BM_vert_flag_from_mflag(mvert->flag); /* this is necassary for selection counts to work properl */ - if (BM_elem_flag_test(v, BM_ELEM_SELECT)) BM_vert_select(bm, v, TRUE); + if (BM_elem_flag_test(v, BM_ELEM_SELECT)) BM_vert_select_set(bm, v, TRUE); normal_short_to_float_v3(v->no, mvert->no); diff --git a/source/blender/bmesh/operators/bmo_primitive.c b/source/blender/bmesh/operators/bmo_primitive.c index 8f07e6efcd2..803ae660d1b 100644 --- a/source/blender/bmesh/operators/bmo_primitive.c +++ b/source/blender/bmesh/operators/bmo_primitive.c @@ -250,7 +250,7 @@ void bmesh_create_grid_exec(BMesh *bm, BMOperator *op) if (a) { e = BM_edge_create(bm, preveve, eve, NULL, TRUE); - BMO_elem_flag_set(bm, e, EDGE_ORIG); + BMO_elem_flag_enable(bm, e, EDGE_ORIG); } preveve = eve; @@ -310,11 +310,11 @@ void bmesh_create_uvsphere_exec(BMesh *bm, BMOperator *op) vec[1] = 0.0; vec[2] = dia * cosf(phi); eve = BM_vert_create(bm, vec, NULL); - BMO_elem_flag_set(bm, eve, VERT_MARK); + BMO_elem_flag_enable(bm, eve, VERT_MARK); if (a != 0) { e = BM_edge_create(bm, preveve, eve, NULL, FALSE); - BMO_elem_flag_set(bm, e, EDGE_ORIG); + BMO_elem_flag_enable(bm, e, EDGE_ORIG); } phi+= phid; @@ -411,10 +411,10 @@ void bmesh_create_icosphere_exec(BMesh *bm, BMOperator *op) eftemp = BM_face_create_quad_tri(bm, v1, v2, v3, NULL, NULL, FALSE); BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, eftemp) { - BMO_elem_flag_set(bm, l->e, EDGE_MARK); + BMO_elem_flag_enable(bm, l->e, EDGE_MARK); } - BMO_elem_flag_set(bm, eftemp, FACE_MARK); + BMO_elem_flag_enable(bm, eftemp, FACE_MARK); } dia *= 200.0f; @@ -449,10 +449,10 @@ void bmesh_create_monkey_exec(BMesh *bm, BMOperator *op) v[0] = (monkeyv[i][0] + 127) / 128.0, v[1] = monkeyv[i][1] / 128.0, v[2] = monkeyv[i][2] / 128.0; tv[i] = BM_vert_create(bm, v, NULL); - BMO_elem_flag_set(bm, tv[i], VERT_MARK); + BMO_elem_flag_enable(bm, tv[i], VERT_MARK); tv[monkeynv + i] = (fabsf(v[0] = -v[0]) < 0.001f) ? tv[i]: (eve = BM_vert_create(bm, v, NULL), mul_m4_v3(mat, eve->co), eve); - BMO_elem_flag_set(bm, tv[monkeynv + i], VERT_MARK); + BMO_elem_flag_enable(bm, tv[monkeynv + i], VERT_MARK); mul_m4_v3(mat, tv[i]->co); } @@ -512,7 +512,7 @@ void bmesh_create_circle_exec(BMesh *bm, BMOperator *op) mul_m4_v3(mat, vec); v1 = BM_vert_create(bm, vec, NULL); - BMO_elem_flag_set(bm, v1, VERT_MARK); + BMO_elem_flag_enable(bm, v1, VERT_MARK); if (lastv1) BM_edge_create(bm, v1, lastv1, NULL, FALSE); @@ -521,7 +521,7 @@ void bmesh_create_circle_exec(BMesh *bm, BMOperator *op) BMFace *f; f = BM_face_create_quad_tri(bm, cent1, lastv1, v1, NULL, NULL, FALSE); - BMO_elem_flag_set(bm, f, FACE_NEW); + BMO_elem_flag_enable(bm, f, FACE_NEW); } if (!firstv1) @@ -539,7 +539,7 @@ void bmesh_create_circle_exec(BMesh *bm, BMOperator *op) BMFace *f; f = BM_face_create_quad_tri(bm, cent1, v1, firstv1, NULL, NULL, FALSE); - BMO_elem_flag_set(bm, f, FACE_NEW); + BMO_elem_flag_enable(bm, f, FACE_NEW); } if (!cap_tris) { @@ -582,8 +582,8 @@ void bmesh_create_cone_exec(BMesh *bm, BMOperator *op) cent2 = BM_vert_create(bm, vec, NULL); - BMO_elem_flag_set(bm, cent1, VERT_MARK); - BMO_elem_flag_set(bm, cent2, VERT_MARK); + BMO_elem_flag_enable(bm, cent1, VERT_MARK); + BMO_elem_flag_enable(bm, cent2, VERT_MARK); } for (a = 0; a < segs; a++, phi += phid) { @@ -599,17 +599,17 @@ void bmesh_create_cone_exec(BMesh *bm, BMOperator *op) mul_m4_v3(mat, vec); v2 = BM_vert_create(bm, vec, NULL); - BMO_elem_flag_set(bm, v1, VERT_MARK); - BMO_elem_flag_set(bm, v2, VERT_MARK); + BMO_elem_flag_enable(bm, v1, VERT_MARK); + BMO_elem_flag_enable(bm, v2, VERT_MARK); if (a) { if (cap_ends) { BMFace *f; f = BM_face_create_quad_tri(bm, cent1, lastv1, v1, NULL, NULL, FALSE); - BMO_elem_flag_set(bm, f, FACE_NEW); + BMO_elem_flag_enable(bm, f, FACE_NEW); f = BM_face_create_quad_tri(bm, cent2, v2, lastv2, NULL, NULL, FALSE); - BMO_elem_flag_set(bm, f, FACE_NEW); + BMO_elem_flag_enable(bm, f, FACE_NEW); } BM_face_create_quad_tri(bm, lastv1, lastv2, v2, v1, NULL, FALSE); } @@ -629,9 +629,9 @@ void bmesh_create_cone_exec(BMesh *bm, BMOperator *op) BMFace *f; f = BM_face_create_quad_tri(bm, cent1, v1, firstv1, NULL, NULL, FALSE); - BMO_elem_flag_set(bm, f, FACE_NEW); + BMO_elem_flag_enable(bm, f, FACE_NEW); f = BM_face_create_quad_tri(bm, cent2, firstv2, v2, NULL, NULL, FALSE); - BMO_elem_flag_set(bm, f, FACE_NEW); + BMO_elem_flag_enable(bm, f, FACE_NEW); } if (!cap_tris) { @@ -658,56 +658,56 @@ void bmesh_create_cube_exec(BMesh *bm, BMOperator *op) vec[2] = -off; mul_m4_v3(mat, vec); v1 = BM_vert_create(bm, vec, NULL); - BMO_elem_flag_set(bm, v1, VERT_MARK); + BMO_elem_flag_enable(bm, v1, VERT_MARK); vec[0] = -off; vec[1] = off; vec[2] = -off; mul_m4_v3(mat, vec); v2 = BM_vert_create(bm, vec, NULL); - BMO_elem_flag_set(bm, v2, VERT_MARK); + BMO_elem_flag_enable(bm, v2, VERT_MARK); vec[0] = off; vec[1] = off; vec[2] = -off; mul_m4_v3(mat, vec); v3 = BM_vert_create(bm, vec, NULL); - BMO_elem_flag_set(bm, v3, VERT_MARK); + BMO_elem_flag_enable(bm, v3, VERT_MARK); vec[0] = off; vec[1] = -off; vec[2] = -off; mul_m4_v3(mat, vec); v4 = BM_vert_create(bm, vec, NULL); - BMO_elem_flag_set(bm, v4, VERT_MARK); + BMO_elem_flag_enable(bm, v4, VERT_MARK); vec[0] = -off; vec[1] = -off; vec[2] = off; mul_m4_v3(mat, vec); v5 = BM_vert_create(bm, vec, NULL); - BMO_elem_flag_set(bm, v5, VERT_MARK); + BMO_elem_flag_enable(bm, v5, VERT_MARK); vec[0] = -off; vec[1] = off; vec[2] = off; mul_m4_v3(mat, vec); v6 = BM_vert_create(bm, vec, NULL); - BMO_elem_flag_set(bm, v6, VERT_MARK); + BMO_elem_flag_enable(bm, v6, VERT_MARK); vec[0] = off; vec[1] = off; vec[2] = off; mul_m4_v3(mat, vec); v7 = BM_vert_create(bm, vec, NULL); - BMO_elem_flag_set(bm, v7, VERT_MARK); + BMO_elem_flag_enable(bm, v7, VERT_MARK); vec[0] = off; vec[1] = -off; vec[2] = off; mul_m4_v3(mat, vec); v8 = BM_vert_create(bm, vec, NULL); - BMO_elem_flag_set(bm, v8, VERT_MARK); + BMO_elem_flag_enable(bm, v8, VERT_MARK); /* the four sides */ BM_face_create_quad_tri(bm, v5, v6, v2, v1, NULL, FALSE); diff --git a/source/blender/bmesh/operators/bmo_removedoubles.c b/source/blender/bmesh/operators/bmo_removedoubles.c index 918284854e0..10196a8dd58 100644 --- a/source/blender/bmesh/operators/bmo_removedoubles.c +++ b/source/blender/bmesh/operators/bmo_removedoubles.c @@ -102,7 +102,7 @@ void bmesh_weldverts_exec(BMesh *bm, BMOperator *op) BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) { if ((v2 = BMO_slot_map_ptr_get(bm, op, "targetmap", v))) { - BMO_elem_flag_set(bm, v, ELE_DEL); + BMO_elem_flag_enable(bm, v, ELE_DEL); /* merge the vertex flags, else we get randomly selected/unselected verts */ BM_elem_flag_merge(v, v2); @@ -122,11 +122,11 @@ void bmesh_weldverts_exec(BMesh *bm, BMOperator *op) if (!v2) v2 = e->v2; if (v == v2) - BMO_elem_flag_set(bm, e, EDGE_COL); + BMO_elem_flag_enable(bm, e, EDGE_COL); else if (!BM_edge_exists(v, v2)) BM_edge_create(bm, v, v2, e, TRUE); - BMO_elem_flag_set(bm, e, ELE_DEL); + BMO_elem_flag_enable(bm, e, ELE_DEL); } } @@ -135,7 +135,7 @@ void bmesh_weldverts_exec(BMesh *bm, BMOperator *op) BM_elem_index_set(f, 0); /* set_dirty! */ BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) { if (BMO_elem_flag_test(bm, l->v, ELE_DEL)) { - BMO_elem_flag_set(bm, f, FACE_MARK|ELE_DEL); + BMO_elem_flag_enable(bm, f, FACE_MARK|ELE_DEL); } if (BMO_elem_flag_test(bm, l->e, EDGE_COL)) { BM_elem_index_set(f, BM_elem_index_get(f) + 1); /* set_dirty! */ @@ -149,7 +149,7 @@ void bmesh_weldverts_exec(BMesh *bm, BMOperator *op) continue; if (f->len - BM_elem_index_get(f) < 3) { - BMO_elem_flag_set(bm, f, ELE_DEL); + BMO_elem_flag_enable(bm, f, ELE_DEL); continue; } @@ -420,7 +420,7 @@ static void bmesh_collapsecon_do_layer(BMesh *bm, BMOperator *op, int layer) int i, tot, type = bm->ldata.layers[layer].type; /* clear all short flags */ - BMO_mesh_flag_clear_all(bm, op, BM_ALL, (1 << 16) - 1); + BMO_mesh_flag_disable_all(bm, op, BM_ALL, (1 << 16) - 1); BMO_slot_buffer_flag(bm, op, "edges", EDGE_MARK, BM_EDGE); @@ -528,8 +528,8 @@ void bmesh_finddoubles_common(BMesh *bm, BMOperator *op, BMOperator *optarget, c SWAP(BMVert *, v, v2); } - BMO_elem_flag_set(bm, v2, VERT_DOUBLE); - BMO_elem_flag_set(bm, v, VERT_TARGET); + BMO_elem_flag_enable(bm, v2, VERT_DOUBLE); + BMO_elem_flag_enable(bm, v, VERT_TARGET); BMO_slot_map_ptr_insert(bm, optarget, targetmapname, v2, v); } @@ -567,7 +567,7 @@ void bmesh_automerge_exec(BMesh *bm, BMOperator *op) BMO_slot_buffer_flag(bm, op, "verts", VERT_IN, BM_VERT); BM_ITER(v, &viter, bm, BM_VERTS_OF_MESH, NULL) { if (!BMO_elem_flag_test(bm, v, VERT_IN)) { - BMO_elem_flag_set(bm, v, VERT_KEEP); + BMO_elem_flag_enable(bm, v, VERT_KEEP); } } diff --git a/source/blender/bmesh/operators/bmo_subdivide.c b/source/blender/bmesh/operators/bmo_subdivide.c index 30401d0d6ef..5b50fdec1d3 100644 --- a/source/blender/bmesh/operators/bmo_subdivide.c +++ b/source/blender/bmesh/operators/bmo_subdivide.c @@ -185,7 +185,7 @@ static BMVert *bm_subdivide_edge_addvert(BMesh *bm, BMEdge *edge, BMEdge *oedge, ev = BM_edge_split(bm, edge->v1, edge, out, percent); - BMO_elem_flag_set(bm, ev, ELE_INNER); + BMO_elem_flag_enable(bm, ev, ELE_INNER); /* offset for smooth or sphere or fractal */ alter_co(bm, ev, oedge, params, percent2, vsta, vend); @@ -241,13 +241,13 @@ static void bm_subdivide_multicut(BMesh *bm, BMEdge *edge, const subdparams *par for (i = 0; i < numcuts; i++) { v = subdivideedgenum(bm, eed, &temp, i, params->numcuts, params, &newe, vsta, vend); - BMO_elem_flag_set(bm, v, SUBD_SPLIT); - BMO_elem_flag_set(bm, eed, SUBD_SPLIT); - BMO_elem_flag_set(bm, newe, SUBD_SPLIT); + BMO_elem_flag_enable(bm, v, SUBD_SPLIT); + BMO_elem_flag_enable(bm, eed, SUBD_SPLIT); + BMO_elem_flag_enable(bm, newe, SUBD_SPLIT); - BMO_elem_flag_set(bm, v, ELE_SPLIT); - BMO_elem_flag_set(bm, eed, ELE_SPLIT); - BMO_elem_flag_set(bm, newe, SUBD_SPLIT); + BMO_elem_flag_enable(bm, v, ELE_SPLIT); + BMO_elem_flag_enable(bm, eed, ELE_SPLIT); + BMO_elem_flag_enable(bm, newe, SUBD_SPLIT); BM_CHECK_ELEMENT(bm, v); if (v->e) BM_CHECK_ELEMENT(bm, v->e); @@ -483,8 +483,8 @@ static void quad_4edge_subdivide(BMesh *bm, BMFace *UNUSED(face), BMVert **verts if (!e) continue; - BMO_elem_flag_set(bm, e, ELE_INNER); - BMO_elem_flag_set(bm, nf, ELE_INNER); + BMO_elem_flag_enable(bm, e, ELE_INNER); + BMO_elem_flag_enable(bm, nf, ELE_INNER); v1 = lines[(i + 1)*s] = verts[a]; @@ -497,7 +497,7 @@ static void quad_4edge_subdivide(BMesh *bm, BMFace *UNUSED(face), BMVert **verts if (!v) bmesh_error(); - BMO_elem_flag_set(bm, ne, ELE_INNER); + BMO_elem_flag_enable(bm, ne, ELE_INNER); lines[(i + 1) * s + a + 1] = v; } } @@ -510,8 +510,8 @@ static void quad_4edge_subdivide(BMesh *bm, BMFace *UNUSED(face), BMVert **verts if (!e) continue; - BMO_elem_flag_set(bm, e, ELE_INNER); - BMO_elem_flag_set(bm, nf, ELE_INNER); + BMO_elem_flag_enable(bm, e, ELE_INNER); + BMO_elem_flag_enable(bm, nf, ELE_INNER); } } @@ -583,8 +583,8 @@ static void tri_3edge_subdivide(BMesh *bm, BMFace *UNUSED(face), BMVert **verts, e = connect_smallest_face(bm, verts[a], verts[b], &nf); if (!e) goto cleanup; - BMO_elem_flag_set(bm, e, ELE_INNER); - BMO_elem_flag_set(bm, nf, ELE_INNER); + BMO_elem_flag_enable(bm, e, ELE_INNER); + BMO_elem_flag_enable(bm, nf, ELE_INNER); lines[i + 1][0] = verts[a]; lines[i + 1][i + 1] = verts[b]; @@ -599,7 +599,7 @@ static void tri_3edge_subdivide(BMesh *bm, BMFace *UNUSED(face), BMVert **verts, verts[a], verts[b]); lines[i + 1][j + 1] = v; - BMO_elem_flag_set(bm, ne, ELE_INNER); + BMO_elem_flag_enable(bm, ne, ELE_INNER); } } @@ -617,13 +617,13 @@ static void tri_3edge_subdivide(BMesh *bm, BMFace *UNUSED(face), BMVert **verts, for (j = 0; j < i; j++) { e = connect_smallest_face(bm, lines[i][j], lines[i + 1][j + 1], &nf); - BMO_elem_flag_set(bm, e, ELE_INNER); - BMO_elem_flag_set(bm, nf, ELE_INNER); + BMO_elem_flag_enable(bm, e, ELE_INNER); + BMO_elem_flag_enable(bm, nf, ELE_INNER); e = connect_smallest_face(bm, lines[i][j + 1], lines[i + 1][j + 1], &nf); - BMO_elem_flag_set(bm, e, ELE_INNER); - BMO_elem_flag_set(bm, nf, ELE_INNER); + BMO_elem_flag_enable(bm, e, ELE_INNER); + BMO_elem_flag_enable(bm, nf, ELE_INNER); } } @@ -826,7 +826,7 @@ void esubdivide_exec(BMesh *bmesh, BMOperator *op) facedata[b].start = verts[i]; facedata[b].face = face; facedata[b].totedgesel = totesel; - BMO_elem_flag_set(bmesh, face, SUBD_SPLIT); + BMO_elem_flag_enable(bmesh, face, SUBD_SPLIT); break; } } @@ -857,7 +857,7 @@ void esubdivide_exec(BMesh *bmesh, BMOperator *op) BLI_array_growone(facedata); j = BLI_array_count(facedata) - 1; - BMO_elem_flag_set(bmesh, face, SUBD_SPLIT); + BMO_elem_flag_enable(bmesh, face, SUBD_SPLIT); facedata[j].pat = pat; facedata[j].start = verts[a]; @@ -873,7 +873,7 @@ void esubdivide_exec(BMesh *bmesh, BMOperator *op) BLI_array_growone(facedata); j = BLI_array_count(facedata) - 1; - BMO_elem_flag_set(bmesh, face, SUBD_SPLIT); + BMO_elem_flag_enable(bmesh, face, SUBD_SPLIT); facedata[j].totedgesel = totesel; facedata[j].face = face; } @@ -1045,7 +1045,7 @@ void BM_esubdivideflag(Object *UNUSED(obedit), BMesh *bm, int flag, float smooth // int i; /* deselect inpu */ - BM_clear_flag_all(bm, BM_ELEM_SELECT); + BM_mesh_flag_disable_all(bm, BM_ELEM_SELECT); ele = BMO_iter_new(&iter, bm, &op, "outinner", BM_EDGE|BM_VERT); for ( ; ele; ele = BMO_iter_step(&iter)) { diff --git a/source/blender/bmesh/operators/bmo_triangulate.c b/source/blender/bmesh/operators/bmo_triangulate.c index 521cdf81f06..d4c08f4df16 100644 --- a/source/blender/bmesh/operators/bmo_triangulate.c +++ b/source/blender/bmesh/operators/bmo_triangulate.c @@ -91,7 +91,7 @@ void bmesh_beautify_fill_exec(BMesh *bm, BMOperator *op) BMO_ITER(f, &siter, bm, op, "faces", BM_FACE) { if (f->len == 3) - BMO_elem_flag_set(bm, f, FACE_MARK); + BMO_elem_flag_enable(bm, f, FACE_MARK); } while (!stop) { @@ -135,10 +135,10 @@ void bmesh_beautify_fill_exec(BMesh *bm, BMOperator *op) if (fac1 > fac2) { e = BM_edge_rotate(bm, e, 0); if (e) { - BMO_elem_flag_set(bm, e, ELE_NEW); + BMO_elem_flag_enable(bm, e, ELE_NEW); - BMO_elem_flag_set(bm, e->l->f, FACE_MARK|ELE_NEW); - BMO_elem_flag_set(bm, e->l->radial_next->f, FACE_MARK|ELE_NEW); + BMO_elem_flag_enable(bm, e->l->f, FACE_MARK|ELE_NEW); + BMO_elem_flag_enable(bm, e->l->radial_next->f, FACE_MARK|ELE_NEW); stop = 0; } } @@ -164,7 +164,7 @@ void bmesh_triangle_fill_exec(BMesh *bm, BMOperator *op) BLI_begin_edgefill(); BMO_ITER(e, &siter, bm, op, "edges", BM_EDGE) { - BMO_elem_flag_set(bm, e, EDGE_MARK); + BMO_elem_flag_enable(bm, e, EDGE_MARK); if (!BLI_smallhash_haskey(&hash, (uintptr_t)e->v1)) { eve = BLI_addfillvert(e->v1->co); @@ -193,10 +193,10 @@ void bmesh_triangle_fill_exec(BMesh *bm, BMOperator *op) BMLoop *l; BMIter liter; - BMO_elem_flag_set(bm, f, ELE_NEW); + BMO_elem_flag_enable(bm, f, ELE_NEW); BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) { if (!BMO_elem_flag_test(bm, l->e, EDGE_MARK)) { - BMO_elem_flag_set(bm, l->e, ELE_NEW); + BMO_elem_flag_enable(bm, l->e, ELE_NEW); } } } diff --git a/source/blender/bmesh/operators/bmo_utils.c b/source/blender/bmesh/operators/bmo_utils.c index cf6272f5c9c..290d68702db 100644 --- a/source/blender/bmesh/operators/bmo_utils.c +++ b/source/blender/bmesh/operators/bmo_utils.c @@ -48,7 +48,7 @@ void bmesh_makevert_exec(BMesh *bm, BMOperator *op) BMO_slot_vec_get(op, "co", vec); - BMO_elem_flag_set(bm, BM_vert_create(bm, vec, NULL), 1); + BMO_elem_flag_enable(bm, BM_vert_create(bm, vec, NULL), 1); BMO_slot_from_flag(bm, op, "newvertout", 1, BM_VERT); } @@ -131,7 +131,7 @@ void bmesh_edgerotate_exec(BMesh *bm, BMOperator *op) return; } - BMO_elem_flag_set(bm, e2, 1); + BMO_elem_flag_enable(bm, e2, 1); } BMO_slot_from_flag(bm, op, "edgeout", 1, BM_EDGE); @@ -156,8 +156,8 @@ static void bmesh_regionextend_extend(BMesh *bm, BMOperator *op, int usefaces) if (e) { BM_ITER(e, &eiter, bm, BM_EDGES_OF_VERT, v) { - BMO_elem_flag_set(bm, e, SEL_FLAG); - BMO_elem_flag_set(bm, BM_edge_other_vert(e, v), SEL_FLAG); + BMO_elem_flag_enable(bm, e, SEL_FLAG); + BMO_elem_flag_enable(bm, BM_edge_other_vert(e, v), SEL_FLAG); } } } @@ -171,7 +171,7 @@ static void bmesh_regionextend_extend(BMesh *bm, BMOperator *op, int usefaces) BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) { BM_ITER(f2, &fiter, bm, BM_FACES_OF_EDGE, l->e) { if (!BMO_elem_flag_test(bm, f2, SEL_ORIG)) - BMO_elem_flag_set(bm, f2, SEL_FLAG); + BMO_elem_flag_enable(bm, f2, SEL_FLAG); } } } @@ -193,10 +193,10 @@ static void bmesh_regionextend_constrict(BMesh *bm, BMOperator *op, int usefaces } if (e) { - BMO_elem_flag_set(bm, v, SEL_FLAG); + BMO_elem_flag_enable(bm, v, SEL_FLAG); BM_ITER(e, &eiter, bm, BM_EDGES_OF_VERT, v) { - BMO_elem_flag_set(bm, e, SEL_FLAG); + BMO_elem_flag_enable(bm, e, SEL_FLAG); } } } @@ -210,7 +210,7 @@ static void bmesh_regionextend_constrict(BMesh *bm, BMOperator *op, int usefaces BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) { BM_ITER(f2, &fiter, bm, BM_FACES_OF_EDGE, l->e) { if (!BMO_elem_flag_test(bm, f2, SEL_ORIG)) { - BMO_elem_flag_set(bm, f, SEL_FLAG); + BMO_elem_flag_enable(bm, f, SEL_FLAG); break; } } @@ -281,7 +281,7 @@ void bmesh_righthandfaces_exec(BMesh *bm, BMOperator *op) BMO_ITER(f, &siter, bm, op, "faces", BM_FACE) { /* clear dirty flag */ - BM_elem_flag_clear(f, BM_ELEM_TAG); + BM_elem_flag_disable(f, BM_ELEM_TAG); if (BMO_elem_flag_test(bm, f, FACE_VIS)) continue; @@ -317,7 +317,7 @@ void bmesh_righthandfaces_exec(BMesh *bm, BMOperator *op) BLI_array_growone(fstack); fstack[0] = startf; - BMO_elem_flag_set(bm, startf, FACE_VIS); + BMO_elem_flag_enable(bm, startf, FACE_VIS); i = 0; maxi = 1; @@ -331,7 +331,7 @@ void bmesh_righthandfaces_exec(BMesh *bm, BMOperator *op) continue; if (!BMO_elem_flag_test(bm, l2->f, FACE_VIS)) { - BMO_elem_flag_set(bm, l2->f, FACE_VIS); + BMO_elem_flag_enable(bm, l2->f, FACE_VIS); i++; if (l2->v == l->v) { @@ -343,8 +343,8 @@ void bmesh_righthandfaces_exec(BMesh *bm, BMOperator *op) } else if (BM_elem_flag_test(l2->f, BM_ELEM_TAG) || BM_elem_flag_test(l->f, BM_ELEM_TAG)) { if (flagflip) { - BM_elem_flag_clear(l->f, BM_ELEM_TAG); - BM_elem_flag_clear(l2->f, BM_ELEM_TAG); + BM_elem_flag_disable(l->f, BM_ELEM_TAG); + BM_elem_flag_disable(l2->f, BM_ELEM_TAG); } } @@ -532,7 +532,7 @@ void bmesh_similarfaces_exec(BMesh *bm, BMOperator *op) */ BMO_ITER(fs, &fs_iter, bm, op, "faces", BM_FACE) { if (!BMO_elem_flag_test(bm, fs, FACE_MARK)) { /* is this really needed ? */ - BMO_elem_flag_set(bm, fs, FACE_MARK); + BMO_elem_flag_enable(bm, fs, FACE_MARK); num_sels++; } } @@ -600,14 +600,14 @@ void bmesh_similarfaces_exec(BMesh *bm, BMOperator *op) switch (type) { case SIMFACE_MATERIAL: if (fm->mat_nr == fs->mat_nr) { - BMO_elem_flag_set(bm, fm, FACE_MARK); + BMO_elem_flag_enable(bm, fm, FACE_MARK); cont = 0; } break; case SIMFACE_IMAGE: if (f_ext[i].t == f_ext[indices[idx]].t) { - BMO_elem_flag_set(bm, fm, FACE_MARK); + BMO_elem_flag_enable(bm, fm, FACE_MARK); cont = 0; } break; @@ -615,7 +615,7 @@ void bmesh_similarfaces_exec(BMesh *bm, BMOperator *op) case SIMFACE_NORMAL: angle = RAD2DEGF(angle_v3v3(fs->no, fm->no)); /* if the angle between the normals -> 0 */ if (angle / 180.0f <= thresh) { - BMO_elem_flag_set(bm, fm, FACE_MARK); + BMO_elem_flag_enable(bm, fm, FACE_MARK); cont = 0; } break; @@ -624,7 +624,7 @@ void bmesh_similarfaces_exec(BMesh *bm, BMOperator *op) angle = RAD2DEGF(angle_v3v3(fs->no, fm->no)); /* angle -> 0 */ if (angle / 180.0f <= thresh) { /* and dot product difference -> 0 */ if (fabsf(f_ext[i].d - f_ext[indices[idx]].d) <= thresh) { - BMO_elem_flag_set(bm, fm, FACE_MARK); + BMO_elem_flag_enable(bm, fm, FACE_MARK); cont = 0; } } @@ -632,14 +632,14 @@ void bmesh_similarfaces_exec(BMesh *bm, BMOperator *op) case SIMFACE_AREA: if (fabsf(f_ext[i].area - f_ext[indices[idx]].area) <= thresh) { - BMO_elem_flag_set(bm, fm, FACE_MARK); + BMO_elem_flag_enable(bm, fm, FACE_MARK); cont = 0; } break; case SIMFACE_PERIMETER: if (fabsf(f_ext[i].perim - f_ext[indices[idx]].perim) <= thresh) { - BMO_elem_flag_set(bm, fm, FACE_MARK); + BMO_elem_flag_enable(bm, fm, FACE_MARK); cont = 0; } break; @@ -721,7 +721,7 @@ void bmesh_similaredges_exec(BMesh *bm, BMOperator *op) /* iterate through all selected edges and mark them */ BMO_ITER(es, &es_iter, bm, op, "edges", BM_EDGE) { - BMO_elem_flag_set(bm, es, EDGE_MARK); + BMO_elem_flag_enable(bm, es, EDGE_MARK); num_sels++; } @@ -774,7 +774,7 @@ void bmesh_similaredges_exec(BMesh *bm, BMOperator *op) switch (type) { case SIMEDGE_LENGTH: if (fabsf(e_ext[i].length - e_ext[indices[idx]].length) <= thresh) { - BMO_elem_flag_set(bm, e, EDGE_MARK); + BMO_elem_flag_enable(bm, e, EDGE_MARK); cont = 0; } break; @@ -787,14 +787,14 @@ void bmesh_similaredges_exec(BMesh *bm, BMOperator *op) angle = fabsf(angle - 180.0f); if (angle / 90.0f <= thresh) { - BMO_elem_flag_set(bm, e, EDGE_MARK); + BMO_elem_flag_enable(bm, e, EDGE_MARK); cont = 0; } break; case SIMEDGE_FACE: if (e_ext[i].faces == e_ext[indices[idx]].faces) { - BMO_elem_flag_set(bm, e, EDGE_MARK); + BMO_elem_flag_enable(bm, e, EDGE_MARK); cont = 0; } break; @@ -803,7 +803,7 @@ void bmesh_similaredges_exec(BMesh *bm, BMOperator *op) if (e_ext[i].faces == 2) { if (e_ext[indices[idx]].faces == 2) { if (fabsf(e_ext[i].angle - e_ext[indices[idx]].angle) <= thresh) { - BMO_elem_flag_set(bm, e, EDGE_MARK); + BMO_elem_flag_enable(bm, e, EDGE_MARK); cont = 0; } } @@ -821,7 +821,7 @@ void bmesh_similaredges_exec(BMesh *bm, BMOperator *op) c2 = CustomData_bmesh_get(&bm->edata, es->head.data, CD_CREASE); if (c1 && c2 && fabsf(*c1 - *c2) <= thresh) { - BMO_elem_flag_set(bm, e, EDGE_MARK); + BMO_elem_flag_enable(bm, e, EDGE_MARK); cont = 0; } } @@ -829,14 +829,14 @@ void bmesh_similaredges_exec(BMesh *bm, BMOperator *op) case SIMEDGE_SEAM: if (BM_elem_flag_test(e, BM_ELEM_SEAM) == BM_elem_flag_test(es, BM_ELEM_SEAM)) { - BMO_elem_flag_set(bm, e, EDGE_MARK); + BMO_elem_flag_enable(bm, e, EDGE_MARK); cont = 0; } break; case SIMEDGE_SHARP: if (BM_elem_flag_test(e, BM_ELEM_SHARP) == BM_elem_flag_test(es, BM_ELEM_SHARP)) { - BMO_elem_flag_set(bm, e, EDGE_MARK); + BMO_elem_flag_enable(bm, e, EDGE_MARK); cont = 0; } break; @@ -885,7 +885,7 @@ void bmesh_similarverts_exec(BMesh *bm, BMOperator *op) /* iterate through all selected edges and mark them */ BMO_ITER(vs, &vs_iter, bm, op, "verts", BM_VERT) { - BMO_elem_flag_set(bm, vs, VERT_MARK); + BMO_elem_flag_enable(bm, vs, VERT_MARK); num_sels++; } @@ -931,14 +931,14 @@ void bmesh_similarverts_exec(BMesh *bm, BMOperator *op) case SIMVERT_NORMAL: /* compare the angle between the normals */ if (RAD2DEGF(angle_v3v3(v->no, vs->no)) / 180.0f <= thresh) { - BMO_elem_flag_set(bm, v, VERT_MARK); + BMO_elem_flag_enable(bm, v, VERT_MARK); cont = 0; } break; case SIMVERT_FACE: /* number of adjacent faces */ if (v_ext[i].num_faces == v_ext[indices[idx]].num_faces) { - BMO_elem_flag_set(bm, v, VERT_MARK); + BMO_elem_flag_enable(bm, v, VERT_MARK); cont = 0; } break; @@ -949,7 +949,7 @@ void bmesh_similarverts_exec(BMesh *bm, BMOperator *op) for (v1 = 0; v1 < v_ext[i].dvert->totweight && cont == 1; v1++) { for (v2 = 0; v2 < v_ext[indices[idx]].dvert->totweight; v2++) { if (v_ext[i].dvert->dw[v1].def_nr == v_ext[indices[idx]].dvert->dw[v2].def_nr) { - BMO_elem_flag_set(bm, v, VERT_MARK); + BMO_elem_flag_enable(bm, v, VERT_MARK); cont = 0; break; } @@ -1286,7 +1286,7 @@ void bmesh_vertexshortestpath_exec(BMesh *bm, BMOperator *op) v = ev; while (vert_list[BM_elem_index_get(v)].parent != NULL) { - BMO_elem_flag_set(bm, v, VERT_MARK); + BMO_elem_flag_enable(bm, v, VERT_MARK); v = vert_list[BM_elem_index_get(v)].parent; } diff --git a/source/blender/bmesh/tools/BME_bevel.c b/source/blender/bmesh/tools/BME_bevel.c index 6821bea34f7..cb92d215719 100644 --- a/source/blender/bmesh/tools/BME_bevel.c +++ b/source/blender/bmesh/tools/BME_bevel.c @@ -294,8 +294,8 @@ static BMVert *BME_bevel_split_edge(BMesh *bm, BMVert *v, BMVert *v1, BMLoop *l, //BME_data_interp_from_faceverts(bm, v, ov, sv, 0.25); //BME_data_interp_from_faceverts(bm, ov, v, sv, 0.25); BME_assign_transdata(td, bm, sv, sv->co, sv->co, NULL, sv->co, 0, -1, -1, NULL); /* quick default */ - BMO_elem_flag_set(bm, sv, BME_BEVEL_BEVEL); - BMO_elem_flag_set(bm, ne, BME_BEVEL_ORIG); /* mark edge as original, even though it isn't */ + BMO_elem_flag_enable(bm, sv, BME_BEVEL_BEVEL); + BMO_elem_flag_enable(bm, ne, BME_BEVEL_ORIG); /* mark edge as original, even though it isn't */ BME_bevel_get_vec(vec1, v1, v, td); BME_bevel_get_vec(vec2, v2, v, td); cross_v3_v3v3(t_up_vec, vec1, vec2); @@ -337,8 +337,8 @@ static BMVert *BME_bevel_split_edge(BMesh *bm, BMVert *v, BMVert *v1, BMLoop *l, //BME_data_interp_from_faceverts(bm, v, ov, sv, 0.25); //BME_data_interp_from_faceverts(bm, ov, v, sv, 0.25); BME_assign_transdata(td, bm, sv, sv->co, sv->co, NULL, sv->co, 0, -1, -1, NULL); /* quick default */ - BMO_elem_flag_set(bm, sv, BME_BEVEL_BEVEL); - BMO_elem_flag_set(bm, ne, BME_BEVEL_ORIG); /* mark edge as original, even though it isn't */ + BMO_elem_flag_enable(bm, sv, BME_BEVEL_BEVEL); + BMO_elem_flag_enable(bm, ne, BME_BEVEL_ORIG); /* mark edge as original, even though it isn't */ } if (BME_bevel_is_split_vert(bm, lv2)) { @@ -460,9 +460,9 @@ static BMVert *BME_bevel_wire(BMesh *bm, BMVert *v, float value, int res, int UN /* split the edges */ v1 = BME_bevel_split_edge(bm, v, ov1, NULL, NULL, value, td); - BMO_elem_flag_set(bm, v1, BME_BEVEL_NONMAN); + BMO_elem_flag_enable(bm, v1, BME_BEVEL_NONMAN); v2 = BME_bevel_split_edge(bm, v, ov2, NULL, NULL, value, td); - BMO_elem_flag_set(bm, v2, BME_BEVEL_NONMAN); + BMO_elem_flag_enable(bm, v2, BME_BEVEL_NONMAN); if (value > 0.5) { BME_bevel_set_max(v1, ov1, value, td); @@ -594,7 +594,7 @@ static BMLoop *BME_bevel_edge(BMesh *bm, BMLoop *l, float value, int UNUSED(opti if (!BMO_elem_flag_test(bm, v1, BME_BEVEL_NONMAN) || !BMO_elem_flag_test(bm, v2, BME_BEVEL_NONMAN)) { BM_face_split(bm, f, v2, v1, &l, e); - BMO_elem_flag_set(bm, l->e, BME_BEVEL_BEVEL); + BMO_elem_flag_enable(bm, l->e, BME_BEVEL_BEVEL); l = l->radial_next; } @@ -734,7 +734,7 @@ static void BME_bevel_add_vweight(BME_TransData_Head *td, BMesh *bm, BMVert *v, BME_TransData *vtd; if (BMO_elem_flag_test(bm, v, BME_BEVEL_NONMAN)) return; - BMO_elem_flag_set(bm, v, BME_BEVEL_BEVEL); + BMO_elem_flag_enable(bm, v, BME_BEVEL_BEVEL); if ((vtd = BME_get_transdata(td, v))) { if (options & BME_BEVEL_EMIN) { vtd->factor = 1.0; @@ -781,7 +781,7 @@ static void bevel_init_verts(BMesh *bm, int options, BME_TransData_Head *td) else weight = 1.0; if(weight > 0.0){ - BMO_elem_flag_set(bm, v, BME_BEVEL_BEVEL); + BMO_elem_flag_enable(bm, v, BME_BEVEL_BEVEL); BME_assign_transdata(td, bm, v, v->co, v->co, NULL, NULL, 1.0, weight, -1, NULL); } } @@ -807,9 +807,9 @@ static void bevel_init_edges(BMesh *bm, int options, BME_TransData_Head *td) weight = 1.0; } if(weight > 0.0){ - BMO_elem_flag_set(bm, e, BME_BEVEL_BEVEL); - BMO_elem_flag_set(bm, e->v1, BME_BEVEL_BEVEL); - BMO_elem_flag_set(bm, e->v2, BME_BEVEL_BEVEL); + BMO_elem_flag_enable(bm, e, BME_BEVEL_BEVEL); + BMO_elem_flag_enable(bm, e->v1, BME_BEVEL_BEVEL); + BMO_elem_flag_enable(bm, e->v2, BME_BEVEL_BEVEL); BME_bevel_add_vweight(td, bm, e->v1, weight, 1.0, options); BME_bevel_add_vweight(td, bm, e->v2, weight, 1.0, options); } @@ -820,7 +820,7 @@ static void bevel_init_edges(BMesh *bm, int options, BME_TransData_Head *td) BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) { if(BMO_elem_flag_test(bm, e, BME_BEVEL_BEVEL)) { count = BM_face_share_edges(e->l->f, e->l->radial_next->f); - if(count > 1) BMO_elem_flag_clear(bm, e, BME_BEVEL_BEVEL); + if(count > 1) BMO_elem_flag_disable(bm, e, BME_BEVEL_BEVEL); } } } @@ -835,32 +835,32 @@ static BMesh *BME_bevel_initialize(BMesh *bm, int options, int UNUSED(defgrp_ind /* tag non-manifold geometr */ BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) { - BMO_elem_flag_set(bm, v, BME_BEVEL_ORIG); + BMO_elem_flag_enable(bm, v, BME_BEVEL_ORIG); if(v->e){ BME_assign_transdata(td, bm, v, v->co, v->co, NULL, NULL, 0, -1, -1, NULL); if (BM_vert_is_nonmanifold(bm, v)) - BMO_elem_flag_set(bm, v, BME_BEVEL_NONMAN); + BMO_elem_flag_enable(bm, v, BME_BEVEL_NONMAN); /* test wire ver */ len = BM_vert_edge_count(v); if (len == 2 && BM_vert_is_wire(bm, v)) - BMO_elem_flag_clear(bm, v, BME_BEVEL_NONMAN); + BMO_elem_flag_disable(bm, v, BME_BEVEL_NONMAN); } else - BMO_elem_flag_set(bm, v, BME_BEVEL_NONMAN); + BMO_elem_flag_enable(bm, v, BME_BEVEL_NONMAN); } BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) { - BMO_elem_flag_set(bm, e, BME_BEVEL_ORIG); + BMO_elem_flag_enable(bm, e, BME_BEVEL_ORIG); if (BM_edge_is_nonmanifold(bm, e)) { - BMO_elem_flag_set(bm, e->v1, BME_BEVEL_NONMAN); - BMO_elem_flag_set(bm, e->v2, BME_BEVEL_NONMAN); - BMO_elem_flag_set(bm, e, BME_BEVEL_NONMAN); + BMO_elem_flag_enable(bm, e->v1, BME_BEVEL_NONMAN); + BMO_elem_flag_enable(bm, e->v2, BME_BEVEL_NONMAN); + BMO_elem_flag_enable(bm, e, BME_BEVEL_NONMAN); } - if(BMO_elem_flag_test(bm, e->v1, BME_BEVEL_NONMAN) || BMO_elem_flag_test(bm, e->v2, BME_BEVEL_NONMAN)) BMO_elem_flag_set(bm, e, BME_BEVEL_NONMAN); + if(BMO_elem_flag_test(bm, e->v1, BME_BEVEL_NONMAN) || BMO_elem_flag_test(bm, e->v2, BME_BEVEL_NONMAN)) BMO_elem_flag_enable(bm, e, BME_BEVEL_NONMAN); } BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) - BMO_elem_flag_set(bm, f, BME_BEVEL_ORIG); + BMO_elem_flag_enable(bm, f, BME_BEVEL_ORIG); if(options & BME_BEVEL_VERT) bevel_init_verts(bm, options, td); else bevel_init_edges(bm, options, td); return bm; @@ -875,13 +875,13 @@ static BMesh *BME_bevel_reinitialize(BMesh *bm) BMIter iter; BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) { - BMO_elem_flag_set(bm, v, BME_BEVEL_ORIG); + BMO_elem_flag_enable(bm, v, BME_BEVEL_ORIG); } BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) { - BMO_elem_flag_set(bm, e, BME_BEVEL_ORIG); + BMO_elem_flag_enable(bm, e, BME_BEVEL_ORIG); } BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) { - BMO_elem_flag_set(bm, f, BME_BEVEL_ORIG); + BMO_elem_flag_enable(bm, f, BME_BEVEL_ORIG); } return bm; diff --git a/source/blender/bmesh/tools/BME_dupe_ops.c b/source/blender/bmesh/tools/BME_dupe_ops.c index df4e4c0967d..b7df4b70f43 100644 --- a/source/blender/bmesh/tools/BME_dupe_ops.c +++ b/source/blender/bmesh/tools/BME_dupe_ops.c @@ -29,10 +29,10 @@ static BMVert *copy_vertex(BMMesh *source_mesh, BMVert *source_vertex, BMMesh *t CustomData_bmesh_copy_data(&source_mesh->vdata, &target_mesh->vdata, source_vertex->data, &target_vertex->data); /*Copy Markings*/ - if(BM_Is_Selected((BMHeader*)source_vertex)) BM_vert_select(target_mesh, target_vertex, TRUE); + if(BM_Is_Selected((BMHeader*)source_vertex)) BM_vert_select_set(target_mesh, target_vertex, TRUE); if(BM_Is_Hidden((BMHeader*)source_vertex)) BM_Mark_Hidden((BMHeader*)target_vertex, 1); - BMO_elem_flag_set(target_mesh, (BMHeader*)target_vertex, DUPE_NEW); + BMO_elem_flag_enable(target_mesh, (BMHeader*)target_vertex, DUPE_NEW); return target_vertex; } @@ -63,13 +63,13 @@ static BMEdge *copy_edge(BMMesh *source_mesh, BMEdge *source_edge, BMMesh *targe CustomData_bmesh_copy_data(&source_mesh->edata, &target_mesh->edata, source_edge->data, &target_edge->data); /*copy flags*/ - if(BM_Is_Selected((BMHeader*) source_edge)) BM_edge_select(target_mesh, target_edge, TRUE); + if(BM_Is_Selected((BMHeader*) source_edge)) BM_edge_select_set(target_mesh, target_edge, TRUE); if(BM_Is_Hidden((BMHeader*) source_edge)) BM_Mark_Hidden(target_mesh, target_edge, 1); if(BM_Is_Sharp((BMHeader*) source_edge)) BM_Mark_Sharp(target_edge, 1); if(BM_Is_Seam((BMHeader*) source_edge)) BM_Mark_Seam(target_edge, 1); if(BM_Is_Fgon((BMHeader*) source_edge)) BM_Mark_Fgon(target_edge, 1); - BMO_elem_flag_set(target_mesh, (BMHeader*)target_edge, DUPE_NEW); + BMO_elem_flag_enable(target_mesh, (BMHeader*)target_edge, DUPE_NEW); return target_edge; } @@ -113,7 +113,7 @@ static BMFace *copy_face(BMMesh *source_mesh, BMFace *source_face, BMMesh *targe if(BM_Is_Hidden((BMHeader*)source_face)) BM_Mark_Hidden((BMHeader*)target_face, 1); /*mark the face for output*/ - BMO_elem_flag_set(target_mesh, (BMHeader*)target_face, DUPE_NEW); + BMO_elem_flag_enable(target_mesh, (BMHeader*)target_face, DUPE_NEW); /*copy per-loop custom data*/ source_loop = source_face->lbase; @@ -175,7 +175,7 @@ static void copy_mesh(BMMesh *source, BMMesh *target) for(v = BM_iter_new(&verts, source, BM_VERT_OF_FACE, f, 0, NULL); v; v = BM_iter_step(&verts)){ if(!BMO_elem_flag_test(source, (BMHeader*)v, DUPE_DONE)){ copy_vertex(source,v, target, vhash); - BMO_elem_flag_set(source, (BMHeader*)v, DUPE_DONE); + BMO_elem_flag_enable(source, (BMHeader*)v, DUPE_DONE); } } @@ -183,11 +183,11 @@ static void copy_mesh(BMMesh *source, BMMesh *target) for(e = BM_iter_new(&edges, source, BM_EDGE_OF_FACE, f, 0, NULL); e; e = BMeshIter_step(&edges)){ if(!BMO_elem_flag_test(source, (BMHeader*)e, DUPE_DONE)){ copy_edge(source, e, target, vhash, ehash); - BMO_elem_flag_set(source, (BMHeader*)e, DUPE_DONE); + BMO_elem_flag_enable(source, (BMHeader*)e, DUPE_DONE); } } copy_face(source, f, target, edar, vhash, ehash); - BMO_elem_flag_set(source, (BMHeader*)f, DUPE_DONE); + BMO_elem_flag_enable(source, (BMHeader*)f, DUPE_DONE); } } @@ -197,15 +197,15 @@ static void copy_mesh(BMMesh *source, BMMesh *target) /*make sure that verts are copied*/ if(!BMO_elem_flag_test(source, (BMHeader*)e->v1, DUPE_DONE){ copy_vertex(source, e->v1, target, vhash); - BMO_elem_flag_set(source, (BMHeader*)e->v1, DUPE_DONE); + BMO_elem_flag_enable(source, (BMHeader*)e->v1, DUPE_DONE); } if(!BMO_elem_flag_test(source, (BMHeader*)e->v2, DUPE_DONE){ copy_vertex(source, e->v2, target, vhash); - BMO_elem_flag_set(source, (BMHeader*)e->v2, DUPE_DONE); + BMO_elem_flag_enable(source, (BMHeader*)e->v2, DUPE_DONE); } /*now copy the actual edge*/ copy_edge(source, e, target, vhash, ehash); - BMO_elem_flag_set(source, (BMHeader*)e, DUPE_DONE); + BMO_elem_flag_enable(source, (BMHeader*)e, DUPE_DONE); } } @@ -213,7 +213,7 @@ static void copy_mesh(BMMesh *source, BMMesh *target) for(v = BM_iter_new(&verts, source, BM_VERTS, source, 0, NULL); v; v = BM_iter_step(&verts)){ if(BMO_elem_flag_test(source, (BMHeader*)v, DUPE_INPUT) && (!BMO_elem_flag_test(source, (BMHeader*)v, DUPE_DONE))){ copy_vertex(source, v, target, vhash); - BMO_elem_flag_set(source, (BMHeader*)v, DUPE_DONE); + BMO_elem_flag_enable(source, (BMHeader*)v, DUPE_DONE); } } diff --git a/source/blender/bmesh/tools/BME_extrude.c b/source/blender/bmesh/tools/BME_extrude.c deleted file mode 100644 index 038ee16ce1c..00000000000 --- a/source/blender/bmesh/tools/BME_extrude.c +++ /dev/null @@ -1,221 +0,0 @@ -#if 0 - -/** - * BMESH EXTRUDE TOOL - * - * A rewrite of the old editmesh extrude code with the - * redundant parts broken into multiple functions - * in an effort to reduce code. This works with multiple - * selection modes, and is intended to build the - * extrusion in steps, depending on what elements are selected. - * Also decoupled the calculation of transform normal - * and put it in UI where it probably is more appropriate - * for the moment. - * - * TODO: - * -Fit this into the new 'easy' API. -*/ - -void BME_extrude_verts(BME_Mesh *bm, GHash *vhash) -{ - BMVert *v, *nv = NULL; - BMEdge *ne = NULL; - float vec[3]; - - //extrude the vertices - for(v=BME_first(bm,BME_VERT);v;v=BME_next(bm,BME_VERT,v)){ - if(BME_SELECTED(v)){ - copy_v3_v3(vec,v->co); - nv = BME_MV(bm,vec); - nv->tflag2 =1; //mark for select - ne = BME_ME(bm,v,nv); - ne->tflag1 = 2; //mark as part of skirt 'ring' - BLI_ghash_insert(vhash,v,nv); - BME_VISIT(v); - } - } -} - -void BME_extrude_skirt(BME_Mesh *bm, GHash *ehash) -{ - BMFace *nf=NULL; - BMEdge *e, *l=NULL, *r=NULL, *edar[4], *ne; - BMVert *v, *v1, *v2, *lv, *rv, *nv; - - for(e=BME_first(bm,BME_EDGE);e;e=BME_next(bm,BME_EDGE,e)){ - if(BME_SELECTED(e)){ - /*find one face incident upon e and use it for winding of new face*/ - if(e->l){ - v1 = e->l->next->v; - v2 = e->l->v; - } - else{ - v1 = e->v1; - v2 = e->v2; - } - - if(v1->e->tflag1 == 2) l = v1->e; - else l = BME_disk_next_edgeflag(v1->e, v1, 0, 2); - if(v2->e->tflag1 == 2) r = v2->e; - else r = BME_disk_next_edgeflag(v2->e, v2, 0, 2); - - lv = BME_edge_getothervert(l,v1); - rv = BME_edge_getothervert(r,v2); - - ne = BME_ME(bm,lv,rv); - ne->tflag2 = 1; //mark for select - BLI_ghash_insert(ehash,e,ne); - BME_VISIT(e); - - edar[0] = e; - edar[1] = l; - edar[2] = ne; - edar[3] = r; - BME_MF(bm,v1,v2,edar,4); - } - } -} - -void BME_cap_skirt(BME_Mesh *bm, GHash *vhash, GHash *ehash) -{ - BMVert *v, *nv, *v1, *v2; - BMEdge *e, **edar, *ne; - BME_Loop *l; - BMFace *f, *nf; - MemArena *edgearena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE); - float vec[3]; - int i, j, del_old =0; - - - //loop through faces, then loop through their verts. If the verts havnt been visited yet, duplicate these. - for(f=BME_first(bm,BME_POLY);f;f=BME_next(bm,BME_POLY,f)){ - if(BME_SELECTED(f)){ - l = f->loopbase; - do{ - if(!(BME_ISVISITED(l->v))){ //interior vertex - //dupe vert - copy_v3_v3(vec,l->v->co); - nv = BME_MV(bm,vec); - BLI_ghash_insert(vhash,l->v,nv); - //mark for delete - l->v->tflag1 = 1; - BME_VISIT(l->v); //we dont want to dupe it again. - } - l=l->next; - }while(l!=f->lbase); - } - } - - //find out if we delete old faces or not. This needs to be improved a lot..... - for(e=BME_first(bm,BME_EDGE);e;e=BME_next(bm,BME_EDGE,e)){ - if(BME_SELECTED(e) && e->l){ - i= BME_cycle_length(&(e->l->radial)); - if(i > 2){ - del_old = 1; - break; - } - } - } - - - //build a new edge net, insert the new edges into the edge hash - for(f=BME_first(bm,BME_POLY);f;f=BME_next(bm,BME_POLY,f)){ - if(BME_SELECTED(f)){ - l=f->loopbase; - do{ - if(!(BME_ISVISITED(l->e))){ //interior edge - //dupe edge - ne = BME_ME(bm,BLI_ghash_lookup(vhash,l->e->v1),BLI_ghash_lookup(vhash,l->e->v2)); - BLI_ghash_insert(ehash,l->e,ne); - //mark for delete - l->e->tflag1 = 1; - BME_VISIT(l->e); //we dont want to dupe it again. - } - l=l->next; - }while(l!=f->lbase); - } - } - - //build new faces. grab edges from edge hash. - for(f=BME_first(bm,BME_POLY);f;f=BME_next(bm,BME_POLY,f)){ - if(BME_SELECTED(f)){ - edar = MEM_callocN(sizeof(BMEdge*)*f->len,"Extrude array"); - v1 = BLI_ghash_lookup(vhash,f->loopbase->v); - v2 = BLI_ghash_lookup(vhash,f->loopbase->next->v); - for(i=0,l=f->loopbase; i < f->len; i++,l=l->next){ - ne = BLI_ghash_lookup(ehash,l->e); - edar[i] = ne; - } - nf=BME_MF(bm,v1,v2,edar,f->len); - nf->tflag2 = 1; // mark for select - if(del_old) f->tflag1 = 1; //mark for delete - MEM_freeN(edar); - } - } - BLI_memarena_free(edgearena); -} - -/*unified extrude code*/ -void BME_extrude_mesh(BME_Mesh *bm, int type) -{ - BMVert *v; - BMEdge *e; - BMFace *f; - BME_Loop *l; - - struct GHash *vhash, *ehash; - /*Build a hash table of old pointers and new pointers.*/ - vhash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp); - ehash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp); - - BME_selectmode_flush(bm); //ensure consistent selection. contains hack to make sure faces get consistent select. - if(type & BME_EXTRUDE_FACES){ //Find selected edges with more than one incident face that is also selected. deselect them. - for(e=BME_first(bm,BME_EDGE);e;e=BME_next(bm,BME_EDGE,e)){ - int totsel=0; - if(e->l){ - l= e->l; - do{ - if(BME_SELECTED(l->f)) totsel++; - l=BME_radial_nextloop(l); - }while(l!=e->l); - } - if(totsel > 1) BME_select_edge(bm,e,0); - } - } - - /*another hack to ensure consistent selection.....*/ - for(e=BME_first(bm,BME_EDGE);e;e=BME_next(bm,BME_EDGE,e)){ - if(BME_SELECTED(e)) BME_select_edge(bm,e,1); - } - - /*now we are ready to extrude*/ - if(type & BME_EXTRUDE_VERTS) BME_extrude_verts(bm,vhash); - if(type & BME_EXTRUDE_EDGES) BME_extrude_skirt(bm,ehash); - if(type & BME_EXTRUDE_FACES) BME_cap_skirt(bm,vhash,ehash); - - /*clear all selection flags*/ - BME_clear_flag_all(bm, SELECT|BME_VISITED); - /*go through and fix up selection flags. Anything with BME_NEW should be selected*/ - for(f=BME_first(bm,BME_POLY);f;f=BME_next(bm,BME_POLY,f)){ - if(f->tflag2 == 1) BME_select_poly(bm,f,1); - if(f->tflag1 == 1) BME_VISIT(f); //mark for delete - } - for(e=BME_first(bm,BME_EDGE);e;e=BME_next(bm,BME_EDGE,e)){ - if(e->tflag2 == 1) BME_select_edge(bm,e,1); - if(e->tflag1 == 1) BME_VISIT(e); // mark for delete - } - for(v=BME_first(bm,BME_VERT);v;v=BME_next(bm,BME_VERT,v)){ - if(v->tflag2 == 1) BME_select_vert(bm,v,1); - if(v->tflag1 == 1) BME_VISIT(v); //mark for delete - } - /*go through and delete all of our old faces , edges and vertices.*/ - remove_tagged_polys(bm); - remove_tagged_edges(bm); - remove_tagged_verts(bm); - /*free our hash tables*/ - BLI_ghash_free(vhash,NULL, NULL); //check usage! - BLI_ghash_free(ehash,NULL, NULL); //check usage! - BME_selectmode_flush(bm); -} - -#endif 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); } } } diff --git a/source/blender/modifiers/intern/MOD_bevel.c b/source/blender/modifiers/intern/MOD_bevel.c index f06f595ae1f..789244c6e88 100644 --- a/source/blender/modifiers/intern/MOD_bevel.c +++ b/source/blender/modifiers/intern/MOD_bevel.c @@ -132,7 +132,7 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Object *ob, (l2= e->l->radial_next) != l1) { if (dot_v3v3(l1->f->no, l2->f->no) < threshold) { - BMO_elem_flag_set(bm, e, EDGE_MARK); + BMO_elem_flag_enable(bm, e, EDGE_MARK); } } } @@ -140,7 +140,7 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Object *ob, else { /* crummy, is there a way just to operator on all? - campbell */ BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) { - BMO_elem_flag_set(bm, e, EDGE_MARK); + BMO_elem_flag_enable(bm, e, EDGE_MARK); } } diff --git a/source/blender/modifiers/intern/MOD_edgesplit.c b/source/blender/modifiers/intern/MOD_edgesplit.c index 56e2550f6dd..ed52ebe47ba 100644 --- a/source/blender/modifiers/intern/MOD_edgesplit.c +++ b/source/blender/modifiers/intern/MOD_edgesplit.c @@ -80,7 +80,7 @@ static DerivedMesh *doEdgeSplit(DerivedMesh *dm, EdgeSplitModifierData *emd, Obj (l2= e->l->radial_next) != l1) { if (dot_v3v3(l1->f->no, l2->f->no) < threshold) { - BMO_elem_flag_set(bm, e, EDGE_MARK); + BMO_elem_flag_enable(bm, e, EDGE_MARK); } } } @@ -89,7 +89,7 @@ static DerivedMesh *doEdgeSplit(DerivedMesh *dm, EdgeSplitModifierData *emd, Obj if (emd->flags & MOD_EDGESPLIT_FROMFLAG) { BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) { if (BM_elem_flag_test(e, BM_ELEM_SHARP)) - BMO_elem_flag_set(bm, e, EDGE_MARK); + BMO_elem_flag_enable(bm, e, EDGE_MARK); } } |