From c7aed8b2af38f7b99f9df9d8e18006421ccb900e Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Fri, 30 Mar 2012 17:30:49 +0000 Subject: For BMesh functions that test flags, add enabled/disabled variants. --- source/blender/bmesh/intern/bmesh_marking.c | 22 +++-- source/blender/bmesh/intern/bmesh_marking.h | 3 +- source/blender/bmesh/intern/bmesh_operator_api.h | 41 ++++++--- source/blender/bmesh/intern/bmesh_operators.c | 109 ++++++++++++++++++----- source/blender/bmesh/operators/bmo_bevel.c | 4 +- source/blender/bmesh/operators/bmo_connect.c | 2 +- source/blender/bmesh/operators/bmo_create.c | 4 +- source/blender/bmesh/operators/bmo_dissolve.c | 2 +- source/blender/bmesh/operators/bmo_dupe.c | 6 +- source/blender/bmesh/operators/bmo_edgesplit.c | 2 +- source/blender/bmesh/operators/bmo_extrude.c | 8 +- source/blender/bmesh/operators/bmo_inset.c | 2 +- source/blender/bmesh/operators/bmo_mirror.c | 2 +- source/blender/bmesh/operators/bmo_primitive.c | 14 +-- source/blender/bmesh/operators/bmo_subdivide.c | 10 +-- source/blender/bmesh/operators/bmo_triangulate.c | 8 +- source/blender/bmesh/operators/bmo_utils.c | 14 +-- 17 files changed, 173 insertions(+), 80 deletions(-) (limited to 'source/blender/bmesh') diff --git a/source/blender/bmesh/intern/bmesh_marking.c b/source/blender/bmesh/intern/bmesh_marking.c index 0318fd94b92..2116acc337e 100644 --- a/source/blender/bmesh/intern/bmesh_marking.c +++ b/source/blender/bmesh/intern/bmesh_marking.c @@ -437,36 +437,48 @@ void BM_select_mode_set(BMesh *bm, int selectmode) } /** - * counts number of elements with flag set + * counts number of elements with flag enabled/disabled */ -int BM_mesh_count_flag(BMesh *bm, const char htype, const char hflag, int respecthide) +static int bm_mesh_flag_count(BMesh *bm, const char htype, const char hflag, + int respecthide, int test_for_enabled) { BMElem *ele; BMIter iter; + int test = (test_for_enabled ? hflag : 0); int tot = 0; if (htype & BM_VERT) { for (ele = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL); ele; ele = BM_iter_step(&iter)) { if (respecthide && BM_elem_flag_test(ele, BM_ELEM_HIDDEN)) continue; - if (BM_elem_flag_test(ele, hflag)) tot++; + if (BM_elem_flag_test(ele, hflag) == test) tot++; } } if (htype & BM_EDGE) { for (ele = BM_iter_new(&iter, bm, BM_EDGES_OF_MESH, NULL); ele; ele = BM_iter_step(&iter)) { if (respecthide && BM_elem_flag_test(ele, BM_ELEM_HIDDEN)) continue; - if (BM_elem_flag_test(ele, hflag)) tot++; + if (BM_elem_flag_test(ele, hflag) == test) tot++; } } if (htype & BM_FACE) { for (ele = BM_iter_new(&iter, bm, BM_FACES_OF_MESH, NULL); ele; ele = BM_iter_step(&iter)) { if (respecthide && BM_elem_flag_test(ele, BM_ELEM_HIDDEN)) continue; - if (BM_elem_flag_test(ele, hflag)) tot++; + if (BM_elem_flag_test(ele, hflag) == test) tot++; } } return tot; } +int BM_mesh_enabled_flag_count(BMesh *bm, const char htype, const char hflag, int respecthide) +{ + return bm_mesh_flag_count(bm, htype, hflag, respecthide, TRUE); +} + +int BM_mesh_disabled_flag_count(BMesh *bm, const char htype, const char hflag, int respecthide) +{ + return bm_mesh_flag_count(bm, htype, hflag, respecthide, FALSE); +} + /** * \note use BM_elem_flag_test(ele, BM_ELEM_SELECT) to test selection * \note by design, this will not touch the editselection history stuff diff --git a/source/blender/bmesh/intern/bmesh_marking.h b/source/blender/bmesh/intern/bmesh_marking.h index f0e81b1dd9f..a02931b0e88 100644 --- a/source/blender/bmesh/intern/bmesh_marking.h +++ b/source/blender/bmesh/intern/bmesh_marking.h @@ -60,7 +60,8 @@ void BM_mesh_select_mode_flush(BMesh *bm); void BM_mesh_deselect_flush(BMesh *bm); void BM_mesh_select_flush(BMesh *bm); -int BM_mesh_count_flag(BMesh *bm, const char htype, const char hflag, int respecthide); +int BM_mesh_enabled_flag_count(BMesh *bm, const char htype, const char hflag, int respecthide); +int BM_mesh_disabled_flag_count(BMesh *bm, const char htype, const char hflag, int respecthide); /* edit selection stuff */ void BM_active_face_set(BMesh *em, BMFace *f); diff --git a/source/blender/bmesh/intern/bmesh_operator_api.h b/source/blender/bmesh/intern/bmesh_operator_api.h index e2062bdf8f8..bb980a63861 100644 --- a/source/blender/bmesh/intern/bmesh_operator_api.h +++ b/source/blender/bmesh/intern/bmesh_operator_api.h @@ -182,9 +182,13 @@ void BMO_op_exec(BMesh *bm, BMOperator *op); * after it finishes executing in BMO_op_exec).*/ void BMO_op_finish(BMesh *bm, BMOperator *op); -/* count the number of elements with a specific flag. +/* count the number of elements with the specified flag enabled. * type can be a bitmask of BM_FACE, BM_EDGE, or BM_FACE. */ -int BMO_mesh_flag_count(BMesh *bm, const char htype, const short oflag); +int BMO_mesh_enabled_flag_count(BMesh *bm, const char htype, const short oflag); + +/* count the number of elements with the specified flag disabled. + * type can be a bitmask of BM_FACE, BM_EDGE, or BM_FACE. */ +int BMO_mesh_disabled_flag_count(BMesh *bm, const char htype, const short oflag); /*---------formatted operator initialization/execution-----------*/ /* @@ -209,8 +213,10 @@ int BMO_mesh_flag_count(BMesh *bm, const char htype, const short oflag); * so e.g. %hf will do faces, %hfe will do faces and edges, * %hv will do verts, etc. must pass in at least one * element type letter. + * %H[f/e/v] - same as %h, but tests if the flag is disabled * %f[f/e/v] - same as %h, except it deals with tool flags instead of * header flags. + * %F[f/e/v] - same as %f, but tests if the flag is disabled * %a[f/e/v] - pass all elements (of types specified by f/e/v) to the * slot. * %e - pass in a single element. @@ -293,10 +299,15 @@ void BMO_mesh_flag_disable_all(BMesh *bm, BMOperator *op, const char htype, cons void BMO_slot_buffer_append(BMOperator *output_op, const char *output_op_slot, BMOperator *other_op, const char *other_op_slot); -/* puts every element of type type (which is a bitmask) with tool flag flag, - * into a slot. */ -void BMO_slot_buffer_from_flag(BMesh *bm, BMOperator *op, const char *slotname, - const char htype, const short oflag); +/* puts every element of type 'type' (which is a bitmask) with tool + * flag 'flag', into a slot. */ +void BMO_slot_buffer_from_enabled_flag(BMesh *bm, BMOperator *op, const char *slotname, + const char htype, const short oflag); + +/* puts every element of type 'type' (which is a bitmask) without tool + * flag 'flag', into a slot. */ +void BMO_slot_buffer_from_disabled_flag(BMesh *bm, BMOperator *op, const char *slotname, + const char htype, const short oflag); /* tool-flags all elements inside an element slot array with flag flag. */ void BMO_slot_buffer_flag_enable(BMesh *bm, BMOperator *op, const char *slotname, @@ -312,11 +323,19 @@ void BMO_slot_buffer_hflag_enable(BMesh *bm, BMOperator *op, const char *slotnam void BMO_slot_buffer_hflag_disable(BMesh *bm, BMOperator *op, const char *slotname, const char htype, const char hflag, const char do_flush); -/* 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 - * header flag BM_ELEM_HIDDEN set).*/ -void BMO_slot_buffer_from_hflag(BMesh *bm, BMOperator *op, const char *slotname, - const char htype, const char hflag); +/* 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 header flag BM_ELEM_HIDDEN set).*/ +void BMO_slot_buffer_from_enabled_hflag(BMesh *bm, BMOperator *op, + const char *slotname, + const char htype, const char hflag); + +/* puts every element of type 'type' (which is a bitmask) without + * header flag 'flag', into a slot. note: ignores hidden elements + * (e.g. elements with header flag BM_ELEM_HIDDEN set).*/ +void BMO_slot_buffer_from_disabled_hflag(BMesh *bm, BMOperator *op, + const char *slotname, + const char htype, const char hflag); /* counts number of elements inside a slot array. */ int BMO_slot_buffer_count(BMesh *bm, BMOperator *op, const char *slotname); diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c index 58c38def33f..e09be79633e 100644 --- a/source/blender/bmesh/intern/bmesh_operators.c +++ b/source/blender/bmesh/intern/bmesh_operators.c @@ -451,32 +451,34 @@ void BMO_slot_vec_get(BMOperator *op, const char *slotname, float r_vec[3]) /* * BMO_COUNTFLAG * - * Counts the number of elements of a certain type that - * have a specific flag set. + * Counts the number of elements of a certain type that have a + * specific flag enabled (or disabled if test_for_enabled is false). * */ -int BMO_mesh_flag_count(BMesh *bm, const char htype, const short oflag) +static int bmo_mesh_flag_count(BMesh *bm, const char htype, const short oflag, + int test_for_enabled) { BMIter elements; int count = 0; BMElemF *ele_f; + int test = (test_for_enabled ? oflag : 0); if (htype & BM_VERT) { for (ele_f = BM_iter_new(&elements, bm, BM_VERTS_OF_MESH, bm); ele_f; ele_f = BM_iter_step(&elements)) { - if (BMO_elem_flag_test(bm, ele_f, oflag)) + if (BMO_elem_flag_test(bm, ele_f, oflag) == test) count++; } } if (htype & BM_EDGE) { for (ele_f = BM_iter_new(&elements, bm, BM_EDGES_OF_MESH, bm); ele_f; ele_f = BM_iter_step(&elements)) { - if (BMO_elem_flag_test(bm, ele_f, oflag)) + if (BMO_elem_flag_test(bm, ele_f, oflag) == test) count++; } } if (htype & BM_FACE) { for (ele_f = BM_iter_new(&elements, bm, BM_FACES_OF_MESH, bm); ele_f; ele_f = BM_iter_step(&elements)) { - if (BMO_elem_flag_test(bm, ele_f, oflag)) + if (BMO_elem_flag_test(bm, ele_f, oflag) == test) count++; } } @@ -484,6 +486,17 @@ int BMO_mesh_flag_count(BMesh *bm, const char htype, const short oflag) return count; } + +int BMO_mesh_enabled_flag_count(BMesh *bm, const char htype, const short oflag) +{ + return bmo_mesh_flag_count(bm, htype, oflag, TRUE); +} + +int BMO_mesh_disabled_flag_count(BMesh *bm, const char htype, const short oflag) +{ + return bmo_mesh_flag_count(bm, htype, oflag, FALSE); +} + 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, @@ -676,25 +689,32 @@ static void BMO_slot_buffer_from_all(BMesh *bm, BMOperator *op, const char *slot /** * \brief BMO_HEADERFLAG_TO_SLOT * - * Copies elements of a certain type, which have a certain header flag set - * into a slot for an operator. + * Copies elements of a certain type, which have a certain header flag + * enabled/disabled into a slot for an operator. */ -void BMO_slot_buffer_from_hflag(BMesh *bm, BMOperator *op, const char *slotname, - const char htype, const char hflag) +static void bmo_slot_buffer_from_hflag(BMesh *bm, BMOperator *op, const char *slotname, + const char htype, const char hflag, + int test_for_enabled) { BMIter elements; BMElem *ele; BMOpSlot *output = BMO_slot_get(op, slotname); int totelement = 0, i = 0; - - totelement = BM_mesh_count_flag(bm, htype, hflag, TRUE); + + if (test_for_enabled) + totelement = BM_mesh_enabled_flag_count(bm, htype, hflag, TRUE); + else + totelement = BM_mesh_disabled_flag_count(bm, htype, hflag, TRUE); if (totelement) { + int test = (test_for_enabled ? hflag : 0); + bmo_slot_buffer_alloc(op, slotname, totelement); if (htype & BM_VERT) { for (ele = BM_iter_new(&elements, bm, BM_VERTS_OF_MESH, bm); ele; ele = BM_iter_step(&elements)) { - if (!BM_elem_flag_test(ele, BM_ELEM_HIDDEN) && BM_elem_flag_test(ele, hflag)) { + if (!BM_elem_flag_test(ele, BM_ELEM_HIDDEN) && + BM_elem_flag_test(ele, hflag) == test) { ((BMElem **)output->data.p)[i] = ele; i++; } @@ -703,7 +723,8 @@ void BMO_slot_buffer_from_hflag(BMesh *bm, BMOperator *op, const char *slotname, if (htype & BM_EDGE) { for (ele = BM_iter_new(&elements, bm, BM_EDGES_OF_MESH, bm); ele; ele = BM_iter_step(&elements)) { - if (!BM_elem_flag_test(ele, BM_ELEM_HIDDEN) && BM_elem_flag_test(ele, hflag)) { + if (!BM_elem_flag_test(ele, BM_ELEM_HIDDEN) && + BM_elem_flag_test(ele, hflag) == test) { ((BMElem **)output->data.p)[i] = ele; i++; } @@ -712,7 +733,8 @@ void BMO_slot_buffer_from_hflag(BMesh *bm, BMOperator *op, const char *slotname, if (htype & BM_FACE) { for (ele = BM_iter_new(&elements, bm, BM_FACES_OF_MESH, bm); ele; ele = BM_iter_step(&elements)) { - if (!BM_elem_flag_test(ele, BM_ELEM_HIDDEN) && BM_elem_flag_test(ele, hflag)) { + if (!BM_elem_flag_test(ele, BM_ELEM_HIDDEN) && + BM_elem_flag_test(ele, hflag) == test) { ((BMElem **)output->data.p)[i] = ele; i++; } @@ -724,6 +746,18 @@ void BMO_slot_buffer_from_hflag(BMesh *bm, BMOperator *op, const char *slotname, } } +void BMO_slot_buffer_from_enabled_hflag(BMesh *bm, BMOperator *op, const char *slotname, + const char htype, const char hflag) +{ + bmo_slot_buffer_from_hflag(bm, op, slotname, htype, hflag, TRUE); +} + +void BMO_slot_buffer_from_disabled_hflag(BMesh *bm, BMOperator *op, const char *slotname, + const char htype, const char hflag) +{ + bmo_slot_buffer_from_hflag(bm, op, slotname, htype, hflag, FALSE); +} + /** * Copies the values from another slot to the end of the output slot. */ @@ -762,18 +796,25 @@ void BMO_slot_buffer_append(BMOperator *output_op, const char *output_slot_name, * Copies elements of a certain type, which have a certain flag set * into an output slot for an operator. */ -void BMO_slot_buffer_from_flag(BMesh *bm, BMOperator *op, const char *slotname, - const char htype, const short oflag) +static void bmo_slot_buffer_from_flag(BMesh *bm, BMOperator *op, const char *slotname, + const char htype, const short oflag, + int test_for_enabled) { BMIter elements; BMOpSlot *slot = BMO_slot_get(op, slotname); - int totelement = BMO_mesh_flag_count(bm, htype, oflag), i = 0; + int totelement, i = 0; + + if (test_for_enabled) + totelement = BMO_mesh_enabled_flag_count(bm, htype, oflag); + else + totelement = BMO_mesh_disabled_flag_count(bm, htype, oflag); BLI_assert(slot->slottype == BMO_OP_SLOT_ELEMENT_BUF); if (totelement) { BMHeader *ele; BMHeader **ele_array; + int test = (test_for_enabled ? oflag : 0); bmo_slot_buffer_alloc(op, slotname, totelement); @@ -781,7 +822,7 @@ void BMO_slot_buffer_from_flag(BMesh *bm, BMOperator *op, const char *slotname, if (htype & BM_VERT) { for (ele = BM_iter_new(&elements, bm, BM_VERTS_OF_MESH, bm); ele; ele = BM_iter_step(&elements)) { - if (BMO_elem_flag_test(bm, (BMElemF *)ele, oflag)) { + if (BMO_elem_flag_test(bm, (BMElemF *)ele, oflag) == test) { ele_array[i] = ele; i++; } @@ -790,7 +831,7 @@ void BMO_slot_buffer_from_flag(BMesh *bm, BMOperator *op, const char *slotname, if (htype & BM_EDGE) { for (ele = BM_iter_new(&elements, bm, BM_EDGES_OF_MESH, bm); ele; ele = BM_iter_step(&elements)) { - if (BMO_elem_flag_test(bm, (BMElemF *)ele, oflag)) { + if (BMO_elem_flag_test(bm, (BMElemF *)ele, oflag) == test) { ele_array[i] = ele; i++; } @@ -799,7 +840,7 @@ void BMO_slot_buffer_from_flag(BMesh *bm, BMOperator *op, const char *slotname, if (htype & BM_FACE) { for (ele = BM_iter_new(&elements, bm, BM_FACES_OF_MESH, bm); ele; ele = BM_iter_step(&elements)) { - if (BMO_elem_flag_test(bm, (BMElemF *)ele, oflag)) { + if (BMO_elem_flag_test(bm, (BMElemF *)ele, oflag) == test) { ele_array[i] = ele; i++; } @@ -811,6 +852,18 @@ void BMO_slot_buffer_from_flag(BMesh *bm, BMOperator *op, const char *slotname, } } +void BMO_slot_buffer_from_enabled_flag(BMesh *bm, BMOperator *op, const char *slotname, + const char htype, const short oflag) +{ + bmo_slot_buffer_from_flag(bm, op, slotname, htype, oflag, TRUE); +} + +void BMO_slot_buffer_from_disabled_flag(BMesh *bm, BMOperator *op, const char *slotname, + const char htype, const short oflag) +{ + bmo_slot_buffer_from_flag(bm, op, slotname, htype, oflag, FALSE); +} + /** * \brief BMO_FLAG_BUFFER * @@ -1403,7 +1456,9 @@ int BMO_op_vinitf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist) state = 1; break; case 'f': + case 'F': case 'h': + case 'H': case 'a': type = *fmt; @@ -1430,13 +1485,19 @@ int BMO_op_vinitf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist) } if (type == 'h') { - BMO_slot_buffer_from_hflag(bm, op, slotname, htype, va_arg(vlist, int)); + BMO_slot_buffer_from_enabled_hflag(bm, op, slotname, htype, va_arg(vlist, int)); + } + else if (type == 'H') { + BMO_slot_buffer_from_disabled_hflag(bm, op, slotname, htype, va_arg(vlist, int)); } else if (type == 'a') { BMO_slot_buffer_from_all(bm, op, slotname, htype); } - else { - BMO_slot_buffer_from_flag(bm, op, slotname, htype, va_arg(vlist, int)); + else if (type == 'f') { + BMO_slot_buffer_from_enabled_flag(bm, op, slotname, htype, va_arg(vlist, int)); + } + else if (type == 'F') { + BMO_slot_buffer_from_disabled_flag(bm, op, slotname, htype, va_arg(vlist, int)); } } diff --git a/source/blender/bmesh/operators/bmo_bevel.c b/source/blender/bmesh/operators/bmo_bevel.c index 3be3000e4ae..ab57c80ff1a 100644 --- a/source/blender/bmesh/operators/bmo_bevel.c +++ b/source/blender/bmesh/operators/bmo_bevel.c @@ -877,6 +877,6 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) BLI_array_free(edges); BLI_array_free(faces); - BMO_slot_buffer_from_flag(bm, op, "face_spans", BM_FACE, FACE_SPAN); - BMO_slot_buffer_from_flag(bm, op, "face_holes", BM_FACE, FACE_HOLE); + BMO_slot_buffer_from_enabled_flag(bm, op, "face_spans", BM_FACE, FACE_SPAN); + BMO_slot_buffer_from_enabled_flag(bm, op, "face_holes", BM_FACE, FACE_HOLE); } diff --git a/source/blender/bmesh/operators/bmo_connect.c b/source/blender/bmesh/operators/bmo_connect.c index 20af3463891..5c60704d0ee 100644 --- a/source/blender/bmesh/operators/bmo_connect.c +++ b/source/blender/bmesh/operators/bmo_connect.c @@ -116,7 +116,7 @@ void bmo_connectverts_exec(BMesh *bm, BMOperator *op) } } - BMO_slot_buffer_from_flag(bm, op, "edgeout", BM_EDGE, EDGE_OUT); + BMO_slot_buffer_from_enabled_flag(bm, op, "edgeout", BM_EDGE, EDGE_OUT); BLI_array_free(loops); BLI_array_free(verts); diff --git a/source/blender/bmesh/operators/bmo_create.c b/source/blender/bmesh/operators/bmo_create.c index a761520dabb..876d440a0fa 100644 --- a/source/blender/bmesh/operators/bmo_create.c +++ b/source/blender/bmesh/operators/bmo_create.c @@ -1053,7 +1053,7 @@ void bmo_edgenet_fill_exec(BMesh *bm, BMOperator *op) edge_free_path(pathbase, path); } - BMO_slot_buffer_from_flag(bm, op, "faceout", BM_FACE, FACE_NEW); + BMO_slot_buffer_from_enabled_flag(bm, op, "faceout", BM_FACE, FACE_NEW); BLI_array_free(edges); BLI_array_free(verts); @@ -1250,7 +1250,7 @@ void bmo_edgenet_prepare(BMesh *bm, BMOperator *op) } } - BMO_slot_buffer_from_flag(bm, op, "edgeout", BM_EDGE, ELE_NEW); + BMO_slot_buffer_from_enabled_flag(bm, op, "edgeout", BM_EDGE, ELE_NEW); BLI_array_free(edges1); BLI_array_free(edges2); diff --git a/source/blender/bmesh/operators/bmo_dissolve.c b/source/blender/bmesh/operators/bmo_dissolve.c index fe5c8cd048e..40650f45fed 100644 --- a/source/blender/bmesh/operators/bmo_dissolve.c +++ b/source/blender/bmesh/operators/bmo_dissolve.c @@ -181,7 +181,7 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op) goto cleanup; } - BMO_slot_buffer_from_flag(bm, op, "regionout", BM_FACE, FACE_NEW); + BMO_slot_buffer_from_enabled_flag(bm, op, "regionout", BM_FACE, FACE_NEW); cleanup: /* free/cleanup */ diff --git a/source/blender/bmesh/operators/bmo_dupe.c b/source/blender/bmesh/operators/bmo_dupe.c index 4c6ad7e268a..814045f2528 100644 --- a/source/blender/bmesh/operators/bmo_dupe.c +++ b/source/blender/bmesh/operators/bmo_dupe.c @@ -336,7 +336,7 @@ void bmo_dupe_exec(BMesh *bm, BMOperator *op) BMO_slot_copy(dupeop, dupeop, "geom", "origout"); /* Now alloc the new output buffers */ - BMO_slot_buffer_from_flag(bm, dupeop, "newout", BM_ALL, DUPE_NEW); + BMO_slot_buffer_from_enabled_flag(bm, dupeop, "newout", BM_ALL, DUPE_NEW); } #if 0 /* UNUSED */ @@ -349,7 +349,7 @@ void BMO_dupe_from_flag(BMesh *bm, int htype, const char hflag) BMOperator dupeop; BMO_op_init(bm, &dupeop, "dupe"); - BMO_slot_buffer_from_hflag(bm, &dupeop, "geom", htype, hflag); + BMO_slot_buffer_from_enabled_hflag(bm, &dupeop, "geom", htype, hflag); BMO_op_exec(bm, &dupeop); BMO_op_finish(bm, &dupeop); @@ -430,7 +430,7 @@ void bmo_split_exec(BMesh *bm, BMOperator *op) /* connect outputs of dupe to delete, exluding keep geometry */ BMO_slot_int_set(&delop, "context", DEL_FACES); - BMO_slot_buffer_from_flag(bm, &delop, "geom", BM_ALL, SPLIT_INPUT); + BMO_slot_buffer_from_enabled_flag(bm, &delop, "geom", BM_ALL, SPLIT_INPUT); BMO_op_exec(bm, &delop); diff --git a/source/blender/bmesh/operators/bmo_edgesplit.c b/source/blender/bmesh/operators/bmo_edgesplit.c index 549f773a250..6601fb1cd48 100644 --- a/source/blender/bmesh/operators/bmo_edgesplit.c +++ b/source/blender/bmesh/operators/bmo_edgesplit.c @@ -161,5 +161,5 @@ void bmo_edgesplit_exec(BMesh *bm, BMOperator *op) } } - BMO_slot_buffer_from_hflag(bm, op, "edgeout", BM_EDGE, BM_ELEM_INTERNAL_TAG); + BMO_slot_buffer_from_enabled_hflag(bm, op, "edgeout", BM_EDGE, BM_ELEM_INTERNAL_TAG); } diff --git a/source/blender/bmesh/operators/bmo_extrude.c b/source/blender/bmesh/operators/bmo_extrude.c index bfafd778837..77ba69b2372 100644 --- a/source/blender/bmesh/operators/bmo_extrude.c +++ b/source/blender/bmesh/operators/bmo_extrude.c @@ -110,7 +110,7 @@ void bmo_extrude_face_indiv_exec(BMesh *bm, BMOperator *op) BLI_array_free(edges); BMO_op_callf(bm, "del geom=%ff context=%i", EXT_DEL, DEL_ONLYFACES); - BMO_slot_buffer_from_flag(bm, op, "faceout", BM_FACE, EXT_KEEP); + BMO_slot_buffer_from_enabled_flag(bm, op, "faceout", BM_FACE, EXT_KEEP); } static void bm_extrude_copy_face_loop_attributes(BMesh *bm, BMFace *f, BMEdge *e, BMEdge *newedge) @@ -211,7 +211,7 @@ void bmo_extrude_edge_only_exec(BMesh *bm, BMOperator *op) BMO_op_finish(bm, &dupeop); - BMO_slot_buffer_from_flag(bm, op, "geomout", BM_ALL, EXT_KEEP); + BMO_slot_buffer_from_enabled_flag(bm, op, "geomout", BM_ALL, EXT_KEEP); } void bmo_extrude_vert_indiv_exec(BMesh *bm, BMOperator *op) @@ -230,8 +230,8 @@ void bmo_extrude_vert_indiv_exec(BMesh *bm, BMOperator *op) BMO_elem_flag_enable(bm, dupev, EXT_KEEP); } - BMO_slot_buffer_from_flag(bm, op, "vertout", BM_VERT, EXT_KEEP); - BMO_slot_buffer_from_flag(bm, op, "edgeout", BM_EDGE, EXT_KEEP); + BMO_slot_buffer_from_enabled_flag(bm, op, "vertout", BM_VERT, EXT_KEEP); + BMO_slot_buffer_from_enabled_flag(bm, op, "edgeout", BM_EDGE, EXT_KEEP); } void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) diff --git a/source/blender/bmesh/operators/bmo_inset.c b/source/blender/bmesh/operators/bmo_inset.c index c8804877723..4a426b40995 100644 --- a/source/blender/bmesh/operators/bmo_inset.c +++ b/source/blender/bmesh/operators/bmo_inset.c @@ -482,5 +482,5 @@ void bmo_inset_exec(BMesh *bm, BMOperator *op) MEM_freeN(edge_info); /* we could flag new edges/verts too, is it useful? */ - BMO_slot_buffer_from_flag(bm, op, "faceout", BM_FACE, ELE_NEW); + BMO_slot_buffer_from_enabled_flag(bm, op, "faceout", BM_FACE, ELE_NEW); } diff --git a/source/blender/bmesh/operators/bmo_mirror.c b/source/blender/bmesh/operators/bmo_mirror.c index 268009dc9af..c516b8a7605 100644 --- a/source/blender/bmesh/operators/bmo_mirror.c +++ b/source/blender/bmesh/operators/bmo_mirror.c @@ -120,7 +120,7 @@ void bmo_mirror_exec(BMesh *bm, BMOperator *op) BMO_op_finish(bm, &weldop); BMO_op_finish(bm, &dupeop); - BMO_slot_buffer_from_flag(bm, op, "newout", BM_ALL, ELE_NEW); + BMO_slot_buffer_from_enabled_flag(bm, op, "newout", BM_ALL, ELE_NEW); BLI_array_free(vmap); BLI_array_free(emap); diff --git a/source/blender/bmesh/operators/bmo_primitive.c b/source/blender/bmesh/operators/bmo_primitive.c index 76d7e08f74a..3d3cbf09f9a 100644 --- a/source/blender/bmesh/operators/bmo_primitive.c +++ b/source/blender/bmesh/operators/bmo_primitive.c @@ -283,7 +283,7 @@ void bmo_create_grid_exec(BMesh *bm, BMOperator *op) if (a) BMO_op_finish(bm, &bmop); - BMO_slot_buffer_from_flag(bm, op, "vertout", BM_VERT, VERT_MARK); + BMO_slot_buffer_from_enabled_flag(bm, op, "vertout", BM_VERT, VERT_MARK); } void bmo_create_uvsphere_exec(BMesh *bm, BMOperator *op) @@ -372,7 +372,7 @@ void bmo_create_uvsphere_exec(BMesh *bm, BMOperator *op) } } - BMO_slot_buffer_from_flag(bm, op, "vertout", BM_VERT, VERT_MARK); + BMO_slot_buffer_from_enabled_flag(bm, op, "vertout", BM_VERT, VERT_MARK); } void bmo_create_icosphere_exec(BMesh *bm, BMOperator *op) @@ -439,7 +439,7 @@ void bmo_create_icosphere_exec(BMesh *bm, BMOperator *op) } } - BMO_slot_buffer_from_flag(bm, op, "vertout", BM_VERT, VERT_MARK); + BMO_slot_buffer_from_enabled_flag(bm, op, "vertout", BM_VERT, VERT_MARK); } void bmo_create_monkey_exec(BMesh *bm, BMOperator *op) @@ -486,7 +486,7 @@ void bmo_create_monkey_exec(BMesh *bm, BMOperator *op) MEM_freeN(tv); - BMO_slot_buffer_from_flag(bm, op, "vertout", BM_VERT, VERT_MARK); + BMO_slot_buffer_from_enabled_flag(bm, op, "vertout", BM_VERT, VERT_MARK); } @@ -558,7 +558,7 @@ void bmo_create_circle_exec(BMesh *bm, BMOperator *op) BMO_op_callf(bm, "dissolve_faces faces=%ff", FACE_NEW); } - BMO_slot_buffer_from_flag(bm, op, "vertout", BM_VERT, VERT_MARK); + BMO_slot_buffer_from_enabled_flag(bm, op, "vertout", BM_VERT, VERT_MARK); } void bmo_create_cone_exec(BMesh *bm, BMOperator *op) @@ -654,7 +654,7 @@ void bmo_create_cone_exec(BMesh *bm, BMOperator *op) BM_face_create_quad_tri(bm, v1, v2, firstv2, firstv1, NULL, FALSE); BMO_op_callf(bm, "removedoubles verts=%fv dist=%f", VERT_MARK, 0.000001); - BMO_slot_buffer_from_flag(bm, op, "vertout", BM_VERT, VERT_MARK); + BMO_slot_buffer_from_enabled_flag(bm, op, "vertout", BM_VERT, VERT_MARK); } void bmo_create_cube_exec(BMesh *bm, BMOperator *op) @@ -732,5 +732,5 @@ void bmo_create_cube_exec(BMesh *bm, BMOperator *op) BM_face_create_quad_tri(bm, v1, v2, v3, v4, NULL, FALSE); BM_face_create_quad_tri(bm, v8, v7, v6, v5, NULL, FALSE); - BMO_slot_buffer_from_flag(bm, op, "vertout", BM_VERT, VERT_MARK); + BMO_slot_buffer_from_enabled_flag(bm, op, "vertout", BM_VERT, VERT_MARK); } diff --git a/source/blender/bmesh/operators/bmo_subdivide.c b/source/blender/bmesh/operators/bmo_subdivide.c index f0683d8f49d..03f9fe04394 100644 --- a/source/blender/bmesh/operators/bmo_subdivide.c +++ b/source/blender/bmesh/operators/bmo_subdivide.c @@ -744,7 +744,7 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op) } /* first go through and tag edges */ - BMO_slot_buffer_from_flag(bmesh, op, "edges", BM_EDGE, SUBD_SPLIT); + BMO_slot_buffer_from_enabled_flag(bmesh, op, "edges", BM_EDGE, SUBD_SPLIT); params.numcuts = numcuts; params.op = op; @@ -1015,10 +1015,10 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op) BLI_array_free(splits); BLI_array_free(loops); - BMO_slot_buffer_from_flag(bmesh, op, "outinner", BM_ALL, ELE_INNER); - BMO_slot_buffer_from_flag(bmesh, op, "outsplit", BM_ALL, ELE_SPLIT); + BMO_slot_buffer_from_enabled_flag(bmesh, op, "outinner", BM_ALL, ELE_INNER); + BMO_slot_buffer_from_enabled_flag(bmesh, op, "outsplit", BM_ALL, ELE_SPLIT); - BMO_slot_buffer_from_flag(bmesh, op, "geomout", BM_ALL, ELE_INNER|ELE_SPLIT|SUBD_SPLIT); + BMO_slot_buffer_from_enabled_flag(bmesh, op, "geomout", BM_ALL, ELE_INNER|ELE_SPLIT|SUBD_SPLIT); } /* editmesh-emulating function */ @@ -1106,7 +1106,7 @@ void bmo_edgebisect_exec(BMesh *bm, BMOperator *op) bm_subdivide_multicut(bm, e, ¶ms, e->v1, e->v2); } - BMO_slot_buffer_from_flag(bm, op, "outsplit", BM_ALL, ELE_SPLIT); + BMO_slot_buffer_from_enabled_flag(bm, op, "outsplit", BM_ALL, ELE_SPLIT); BM_data_layer_free_n(bm, &bm->vdata, CD_SHAPEKEY, skey); } diff --git a/source/blender/bmesh/operators/bmo_triangulate.c b/source/blender/bmesh/operators/bmo_triangulate.c index 679efdcf030..47d17717567 100644 --- a/source/blender/bmesh/operators/bmo_triangulate.c +++ b/source/blender/bmesh/operators/bmo_triangulate.c @@ -72,8 +72,8 @@ void bmo_triangulate_exec(BMesh *bm, BMOperator *op) } } - BMO_slot_buffer_from_flag(bm, op, "edgeout", BM_EDGE, EDGE_NEW); - BMO_slot_buffer_from_flag(bm, op, "faceout", BM_FACE, FACE_NEW); + BMO_slot_buffer_from_enabled_flag(bm, op, "edgeout", BM_EDGE, EDGE_NEW); + BMO_slot_buffer_from_enabled_flag(bm, op, "faceout", BM_FACE, FACE_NEW); BLI_array_free(projectverts); BLI_array_free(newfaces); @@ -152,7 +152,7 @@ void bmo_beautify_fill_exec(BMesh *bm, BMOperator *op) } } - BMO_slot_buffer_from_flag(bm, op, "geomout", BM_EDGE|BM_FACE, ELE_NEW); + BMO_slot_buffer_from_enabled_flag(bm, op, "geomout", BM_EDGE|BM_FACE, ELE_NEW); } void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op) @@ -216,5 +216,5 @@ void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op) BMO_slot_buffer_flag_enable(bm, &bmop, "geomout", BM_FACE|BM_EDGE, ELE_NEW); BMO_op_finish(bm, &bmop); - BMO_slot_buffer_from_flag(bm, op, "geomout", BM_EDGE|BM_FACE, ELE_NEW); + BMO_slot_buffer_from_enabled_flag(bm, op, "geomout", BM_EDGE|BM_FACE, ELE_NEW); } diff --git a/source/blender/bmesh/operators/bmo_utils.c b/source/blender/bmesh/operators/bmo_utils.c index 100cf788054..6a994524e5f 100644 --- a/source/blender/bmesh/operators/bmo_utils.c +++ b/source/blender/bmesh/operators/bmo_utils.c @@ -49,7 +49,7 @@ void bmo_makevert_exec(BMesh *bm, BMOperator *op) BMO_slot_vec_get(op, "co", vec); BMO_elem_flag_enable(bm, BM_vert_create(bm, vec, NULL), 1); - BMO_slot_buffer_from_flag(bm, op, "newvertout", BM_VERT, 1); + BMO_slot_buffer_from_enabled_flag(bm, op, "newvertout", BM_VERT, 1); } void bmo_transform_exec(BMesh *bm, BMOperator *op) @@ -163,7 +163,7 @@ void bmo_edgerotate_exec(BMesh *bm, BMOperator *op) } } - BMO_slot_buffer_from_flag(bm, op, "edgeout", BM_EDGE, EDGE_OUT); + BMO_slot_buffer_from_enabled_flag(bm, op, "edgeout", BM_EDGE, EDGE_OUT); #undef EDGE_OUT #undef FACE_TAINT @@ -266,7 +266,7 @@ void bmo_regionextend_exec(BMesh *bm, BMOperator *op) else bmo_regionextend_extend(bm, op, use_faces); - BMO_slot_buffer_from_flag(bm, op, "geomout", BM_ALL, SEL_FLAG); + BMO_slot_buffer_from_enabled_flag(bm, op, "geomout", BM_ALL, SEL_FLAG); } /********* righthand faces implementation ****** */ @@ -686,7 +686,7 @@ void bmo_similarfaces_exec(BMesh *bm, BMOperator *op) MEM_freeN(indices); /* transfer all marked faces to the output slot */ - BMO_slot_buffer_from_flag(bm, op, "faceout", BM_FACE, FACE_MARK); + BMO_slot_buffer_from_enabled_flag(bm, op, "faceout", BM_FACE, FACE_MARK); } /**************************************************************************** * @@ -883,7 +883,7 @@ void bmo_similaredges_exec(BMesh *bm, BMOperator *op) MEM_freeN(indices); /* transfer all marked edges to the output slot */ - BMO_slot_buffer_from_flag(bm, op, "edgeout", BM_EDGE, EDGE_MARK); + BMO_slot_buffer_from_enabled_flag(bm, op, "edgeout", BM_EDGE, EDGE_MARK); } /**************************************************************************** * @@ -999,7 +999,7 @@ void bmo_similarverts_exec(BMesh *bm, BMOperator *op) MEM_freeN(indices); MEM_freeN(v_ext); - BMO_slot_buffer_from_flag(bm, op, "vertout", BM_VERT, VERT_MARK); + BMO_slot_buffer_from_enabled_flag(bm, op, "vertout", BM_VERT, VERT_MARK); } /**************************************************************************** * @@ -1327,5 +1327,5 @@ void bmo_vertexshortestpath_exec(BMesh *bm, BMOperator *op) BLI_heap_free(h, NULL); MEM_freeN(vert_list); - BMO_slot_buffer_from_flag(bm, op, "vertout", BM_VERT, VERT_MARK); + BMO_slot_buffer_from_enabled_flag(bm, op, "vertout", BM_VERT, VERT_MARK); } -- cgit v1.2.3