diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-19 17:47:58 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-19 17:47:58 +0400 |
commit | 475ecbb0ce11d48ef41774ce1f982f992547beca (patch) | |
tree | 316c679f1c9e3d581078a2aa0a269caf304a8c2c /source/blender/bmesh/operators | |
parent | 9276d7aeb2679a4eecbdd97f0ed699712920e4fb (diff) |
remove BM_ITER, BM_ITER_INDEX macros, use ELEM or MESH variants only (the maceros had unused args in both cases).
Diffstat (limited to 'source/blender/bmesh/operators')
-rw-r--r-- | source/blender/bmesh/operators/bmo_bevel.c | 54 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_connect.c | 8 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_create.c | 18 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_dissolve.c | 10 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_dupe.c | 18 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_edgesplit.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_extrude.c | 44 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_inset.c | 8 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_join_triangles.c | 12 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_mirror.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_primitive.c | 6 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_removedoubles.c | 34 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_slide.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_subdivide.c | 14 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_triangulate.c | 4 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_utils.c | 52 |
16 files changed, 144 insertions, 144 deletions
diff --git a/source/blender/bmesh/operators/bmo_bevel.c b/source/blender/bmesh/operators/bmo_bevel.c index dd94e14ba1c..99c70cc7c13 100644 --- a/source/blender/bmesh/operators/bmo_bevel.c +++ b/source/blender/bmesh/operators/bmo_bevel.c @@ -80,7 +80,7 @@ static void calc_corner_co(BMesh *bm, BMLoop *l, const float fac, float r_co[3], copy_v3_v3(l_co_prev, l->prev->v->co); copy_v3_v3(l_co, l->v->co); - BM_ITER (l2, &iter, bm, BM_LOOPS_OF_VERT, l->v) { + BM_ITER_ELEM (l2, &iter, l->v, BM_LOOPS_OF_VERT) { if (l2->f != l->f) { copy_v3_v3(l_co_next, BM_edge_other_vert(l2->e, l2->next->v)->co); break; @@ -228,14 +228,14 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) #endif } - BM_ITER (v, &iter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { BMO_elem_flag_enable(bm, v, VERT_OLD); } #if 0 //a bit of cleaner code that, alas, doens't work. /* build edge tag */ - BM_ITER (e, &iter, bm, BM_EDGES_OF_MESH, NULL) { + BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { if (BMO_elem_flag_test(bm, e->v1, BEVEL_FLAG) || BMO_elem_flag_test(bm, e->v2, BEVEL_FLAG)) { BMIter liter; BMLoop *l; @@ -247,14 +247,14 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) BMO_elem_flag_enable(bm, e, EDGE_OLD); } - BM_ITER (l, &liter, bm, BM_LOOPS_OF_EDGE, e) { + BM_ITER_ELEM (l, &liter, e, BM_LOOPS_OF_EDGE) { BMLoop *l2; BMIter liter2; if (BMO_elem_flag_test(bm, l->f, BEVEL_FLAG)) continue; - BM_ITER (l2, &liter2, bm, BM_LOOPS_OF_FACE, l->f) { + BM_ITER_ELEM (l2, &liter2, l->f, BM_LOOPS_OF_FACE) { BM_elem_index_set(l2, BLI_array_count(tags)); /* set_loop */ BLI_array_growone(tags); @@ -299,7 +299,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) /* find all faces surrounding e->v1 and, e->v2 */ for (i = 0; i < 2; i++) { - BM_ITER (l, &liter, bm, BM_LOOPS_OF_VERT, i ? e->v2:e->v1) { + BM_ITER_ELEM (l, &liter, i ? e->v2:e->v1, BM_LOOPS_OF_VERT) { BMLoop *l2; BMIter liter2; @@ -308,7 +308,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) continue; /* create tags for all loops in l-> */ - BM_ITER (l2, &liter2, bm, BM_LOOPS_OF_FACE, l->f) { + BM_ITER_ELEM (l2, &liter2, l->f, BM_LOOPS_OF_FACE) { BLI_array_growone(tags); BM_elem_index_set(l2, BLI_array_count(tags) - 1); /* set_loop */ @@ -329,13 +329,13 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) bm->elem_index_dirty |= BM_EDGE; - BM_ITER (v, &iter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { BMIter eiter; if (!BMO_elem_flag_test(bm, v, BEVEL_FLAG)) continue; - BM_ITER (e, &eiter, bm, BM_EDGES_OF_VERT, v) { + BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) { if (!BMO_elem_flag_test(bm, e, BEVEL_FLAG) && !ETAG_GET(e, v)) { BMVert *v2; float co[3]; @@ -364,7 +364,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) BMO_elem_flag_enable(bm, faces[i], FACE_OLD); - BM_ITER (l, &liter, bm, BM_LOOPS_OF_FACE, faces[i]) { + BM_ITER_ELEM (l, &liter, faces[i], BM_LOOPS_OF_FACE) { float co[3]; if (BMO_elem_flag_test(bm, l->e, BEVEL_FLAG)) { @@ -438,7 +438,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) BLI_array_empty(verts); BLI_array_empty(edges); - BM_ITER (l, &liter, bm, BM_LOOPS_OF_FACE, faces[i]) { + BM_ITER_ELEM (l, &liter, faces[i], BM_LOOPS_OF_FACE) { BMVert *v2; tag = tags + BM_elem_index_get(l); @@ -489,7 +489,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) int j; /* create quad spans between split edge */ - BM_ITER (l, &liter, bm, BM_LOOPS_OF_FACE, faces[i]) { + BM_ITER_ELEM (l, &liter, faces[i], BM_LOOPS_OF_FACE) { BMVert *v1 = NULL, *v2 = NULL, *v3 = NULL, *v4 = NULL; if (!BMO_elem_flag_test(bm, l->e, BEVEL_FLAG)) @@ -516,7 +516,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) BMIter eiter; BMVert *v = j ? v4 : v3; - BM_ITER (e, &eiter, bm, BM_EDGES_OF_VERT, v) { + BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) { if (!BM_vert_in_edge(e, v3) || !BM_vert_in_edge(e, v4)) continue; @@ -600,7 +600,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) 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) { + BM_ITER_ELEM (l2, &liter2, f, BM_LOOPS_OF_FACE) { BMO_elem_flag_disable(bm, l2->e, BEVEL_DEL); } } @@ -611,7 +611,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) } /* fill in holes at vertices */ - BM_ITER (v, &iter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { BMIter eiter; BMVert *vv, *vstart = NULL, *lastv = NULL; SmallHash tmphash; @@ -625,7 +625,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) BLI_array_empty(verts); BLI_array_empty(edges); - BM_ITER (e, &eiter, bm, BM_EDGES_OF_VERT, v) { + BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) { BMIter liter; BMVert *v1 = NULL, *v2 = NULL; BMLoop *l; @@ -637,7 +637,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) continue; rad = 0; - BM_ITER (l, &liter, bm, BM_LOOPS_OF_EDGE, e) { + BM_ITER_ELEM (l, &liter, e, BM_LOOPS_OF_EDGE) { if (!BMO_elem_flag_test(bm, l->f, FACE_OLD)) continue; @@ -685,7 +685,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) vstart = vstart ? vstart : verts[0]; vv = vstart; do { - BM_ITER (e, &eiter, bm, BM_EDGES_OF_VERT, vv) { + BM_ITER_ELEM (e, &eiter, vv, BM_EDGES_OF_VERT) { BMVert *vv2 = BM_edge_other_vert(e, vv); if (vv2 != lastv && BLI_smallhash_haskey(&tmphash, (intptr_t)vv2)) { @@ -730,7 +730,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) lastv = NULL; BLI_array_empty(edges); do { - BM_ITER (e, &eiter, bm, BM_EDGES_OF_VERT, vv) { + BM_ITER_ELEM (e, &eiter, vv, BM_EDGES_OF_VERT) { BMVert *vv2 = BM_edge_other_vert(e, vv); if (vv2 != lastv && BLI_smallhash_haskey(&tmphash, (intptr_t)vv2)) { @@ -787,7 +787,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) BMIter liter; BMFace *f = faces[i]; - BM_ITER (l, &liter, bm, BM_LOOPS_OF_FACE, f) { + BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) { BMLoop *l2; BMIter liter2; @@ -795,7 +795,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) if (!tag->newv) continue; - BM_ITER (l2, &liter2, bm, BM_LOOPS_OF_VERT, tag->newv) { + BM_ITER_ELEM (l2, &liter2, tag->newv, BM_LOOPS_OF_VERT) { if (!BMO_elem_flag_test(bm, l2->f, FACE_NEW) || (l2->v != tag->newv && l2->v != l->v)) continue; @@ -812,7 +812,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) BMLoop *l3; BMIter liter3; - BM_ITER (l3, &liter3, bm, BM_LOOPS_OF_FACE, l2->f) { + BM_ITER_ELEM (l3, &liter3, l2->f, BM_LOOPS_OF_FACE) { BM_loop_interp_multires(bm, l3, l->f); } } @@ -821,7 +821,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) } /* handle vertices along boundary edge */ - BM_ITER (v, &iter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { if (BMO_elem_flag_test(bm, v, VERT_OLD) && BMO_elem_flag_test(bm, v, BEVEL_FLAG) && !BMO_elem_flag_test(bm, v, BEVEL_DEL)) @@ -830,7 +830,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) BMLoop *lorig = NULL; BMIter liter; - BM_ITER (l, &liter, bm, BM_LOOPS_OF_VERT, v) { + BM_ITER_ELEM (l, &liter, v, BM_LOOPS_OF_VERT) { // BMIter liter2; // BMLoop *l2 = l->v == v ? l : l->next, *l3; @@ -843,7 +843,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) if (!lorig) continue; - BM_ITER (l, &liter, bm, BM_LOOPS_OF_VERT, v) { + BM_ITER_ELEM (l, &liter, v, BM_LOOPS_OF_VERT) { BMLoop *l2 = l->v == v ? l : l->next; BM_elem_attrs_copy(bm, bm, lorig->f, l2->f); @@ -853,7 +853,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) } #if 0 /* clean up any remaining 2-edged face */ - BM_ITER (f, &iter, bm, BM_FACES_OF_MESH, NULL) { + BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) { if (f->len == 2) { BMFace *faces[2] = {f, BM_FACE_FIRST_LOOP(f)->radial_next->f}; @@ -868,7 +868,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) BMO_op_callf(bm, "del geom=%fv context=%i", BEVEL_DEL, DEL_VERTS); /* clean up any edges that might not get properly delete */ - BM_ITER (e, &iter, bm, BM_EDGES_OF_MESH, NULL) { + BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { if (BMO_elem_flag_test(bm, e, EDGE_OLD) && !e->l) BMO_elem_flag_enable(bm, e, BEVEL_DEL); } diff --git a/source/blender/bmesh/operators/bmo_connect.c b/source/blender/bmesh/operators/bmo_connect.c index 98bf22fb833..3c1f10be4c4 100644 --- a/source/blender/bmesh/operators/bmo_connect.c +++ b/source/blender/bmesh/operators/bmo_connect.c @@ -135,7 +135,7 @@ static BMVert *get_outer_vert(BMesh *bm, BMEdge *e) int i; i = 0; - BM_ITER (e2, &iter, bm, BM_EDGES_OF_VERT, e->v1) { + BM_ITER_ELEM (e2, &iter, e->v1, BM_EDGES_OF_VERT) { if (BMO_elem_flag_test(bm, e2, EDGE_MARK)) { i++; } @@ -191,7 +191,7 @@ static void bm_vert_loop_pair(BMesh *bm, BMVert *v1, BMVert *v2, BMLoop **l1, BM if ((v1->e && v1->e->l) && (v2->e && v2->e->l)) { - BM_ITER (l, &liter, bm, BM_LOOPS_OF_VERT, v1) { + BM_ITER_ELEM (l, &liter, v1, BM_LOOPS_OF_VERT) { if (l->prev->v == v2) { *l1 = l; *l2 = l->prev; @@ -241,7 +241,7 @@ void bmo_bridge_loops_exec(BMesh *bm, BMOperator *op) do { v = BM_edge_other_vert(e2, v); nexte = NULL; - BM_ITER (e3, &iter, bm, BM_EDGES_OF_VERT, v) { + BM_ITER_ELEM (e3, &iter, v, BM_EDGES_OF_VERT) { if (e3 != e2 && BMO_elem_flag_test(bm, e3, EDGE_MARK)) { if (nexte == NULL) { nexte = e3; @@ -278,7 +278,7 @@ void bmo_bridge_loops_exec(BMesh *bm, BMOperator *op) 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) { + BM_ITER_ELEM (e3, &iter, v, BM_EDGES_OF_VERT) { if (e3 != e2 && BMO_elem_flag_test(bm, e3, EDGE_MARK) && !BMO_elem_flag_test(bm, e3, EDGE_DONE)) { break; } diff --git a/source/blender/bmesh/operators/bmo_create.c b/source/blender/bmesh/operators/bmo_create.c index a090536fbe0..9e09f71d123 100644 --- a/source/blender/bmesh/operators/bmo_create.c +++ b/source/blender/bmesh/operators/bmo_create.c @@ -225,7 +225,7 @@ static int UNUSED_FUNCTION(rotsys_fill_faces)(BMesh *bm, EdgeData *edata, VertDa SmallHash visithash, *hash = &visithash; int i; - BM_ITER (e, &iter, bm, BM_EDGES_OF_MESH, NULL) { + BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { BMEdge *e2, *starte; BMVert *startv; int rad, ok; @@ -366,7 +366,7 @@ static void init_rotsys(BMesh *bm, EdgeData *edata, VertData *vdata) #define SIGN(n) ((n)<0.0f) - BM_ITER (v, &iter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { BMIter eiter; float no[3], cent[3]; int j, k = 0, totedge = 0; @@ -376,7 +376,7 @@ static void init_rotsys(BMesh *bm, EdgeData *edata, VertData *vdata) BLI_array_empty(edges); - BM_ITER (e, &eiter, bm, BM_EDGES_OF_VERT, v) { + BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) { if (BMO_elem_flag_test(bm, e, EDGE_MARK)) { BLI_array_append(edges, e); totedge++; @@ -581,7 +581,7 @@ static void init_rotsys(BMesh *bm, EdgeData *edata, VertData *vdata) #if 0 /* create visualizing geometr */ BMVert *lastv; - BM_ITER (v, &iter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { BMVert *v2; BMFace *f; int totedge = BM_vert_edge_count(v); @@ -915,12 +915,12 @@ void bmo_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) { + BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) { BMO_elem_flag_enable(bm, f, ELE_ORIG); } i = 0; - BM_ITER (e, &iter, bm, BM_EDGES_OF_MESH, NULL) { + BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { BM_elem_index_set(e, i); /* set_inline */ if (!BMO_elem_flag_test(bm, e, EDGE_MARK)) { @@ -1076,7 +1076,7 @@ static BMEdge *edge_next(BMesh *bm, BMEdge *e) int i; for (i = 0; i < 2; i++) { - BM_ITER (e2, &iter, bm, BM_EDGES_OF_VERT, i ? e->v2 : e->v1) { + BM_ITER_ELEM (e2, &iter, i ? e->v2 : e->v1, BM_EDGES_OF_VERT) { if ((BMO_elem_flag_test(bm, e2, EDGE_MARK)) && (!BMO_elem_flag_test(bm, e2, EDGE_VIS)) && (e2 != e)) @@ -1317,7 +1317,7 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op) BMO_ITER (v, &oiter, bm, op, "geom", BM_VERT) { /* count how many flagged edges this vertex uses */ int tot_edges = 0; - BM_ITER (e, &iter, bm, BM_EDGES_OF_VERT, v) { + BM_ITER_ELEM (e, &iter, v, BM_EDGES_OF_VERT) { if (BMO_elem_flag_test(bm, e, ELE_NEW)) { tot_edges++; if (tot_edges > 2) { @@ -1392,7 +1392,7 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op) /* now, count how many verts we have */ amount = 0; - BM_ITER (v, &iter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { if (BMO_elem_flag_test(bm, v, ELE_NEW)) { verts[amount] = v; amount++; diff --git a/source/blender/bmesh/operators/bmo_dissolve.c b/source/blender/bmesh/operators/bmo_dissolve.c index b69408480d0..3e3dae11ab9 100644 --- a/source/blender/bmesh/operators/bmo_dissolve.c +++ b/source/blender/bmesh/operators/bmo_dissolve.c @@ -93,7 +93,7 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op) BMIter viter; BMVert *v; - BM_ITER (v, &viter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &viter, bm, BM_VERTS_OF_MESH) { BMO_elem_flag_set(bm, v, VERT_MARK, (BM_vert_edge_count(v) != 2)); } } @@ -171,7 +171,7 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op) BMIter viter; BMVert *v; - BM_ITER (v, &viter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &viter, bm, BM_VERTS_OF_MESH) { if (BMO_elem_flag_test(bm, v, VERT_MARK)) { if (BM_vert_edge_count(v) == 2) { BM_vert_collapse_edge(bm, v->e, v, TRUE); @@ -219,7 +219,7 @@ void bmo_dissolve_edgeloop_exec(BMesh *bm, BMOperator *op) } } - BM_ITER (v, &iter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { if (BMO_elem_flag_test(bm, v, VERT_MARK) && BM_vert_edge_count(v) == 2) { BLI_array_append(verts, v); } @@ -257,7 +257,7 @@ void bmo_dissolve_edges_exec(BMesh *bm, BMOperator *op) int use_verts = BMO_slot_bool_get(op, "use_verts"); if (use_verts) { - BM_ITER (v, &viter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &viter, bm, BM_VERTS_OF_MESH) { BMO_elem_flag_set(bm, v, VERT_MARK, (BM_vert_edge_count(v) != 2)); } } @@ -276,7 +276,7 @@ void bmo_dissolve_edges_exec(BMesh *bm, BMOperator *op) } if (use_verts) { - BM_ITER (v, &viter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &viter, bm, BM_VERTS_OF_MESH) { if (BMO_elem_flag_test(bm, v, VERT_MARK)) { if (BM_vert_edge_count(v) == 2) { BM_vert_collapse_edge(bm, v->e, v, TRUE); diff --git a/source/blender/bmesh/operators/bmo_dupe.c b/source/blender/bmesh/operators/bmo_dupe.c index 1a067430239..36d446a0a8c 100644 --- a/source/blender/bmesh/operators/bmo_dupe.c +++ b/source/blender/bmesh/operators/bmo_dupe.c @@ -163,8 +163,8 @@ static BMFace *copy_face(BMOperator *op, BMesh *source_mesh, BMO_elem_flag_enable(target_mesh, target_face, DUPE_NEW); /* copy per-loop custom data */ - BM_ITER (source_loop, &iter, source_mesh, BM_LOOPS_OF_FACE, source_face) { - BM_ITER (target_loop, &iter2, target_mesh, BM_LOOPS_OF_FACE, target_face) { + BM_ITER_ELEM (source_loop, &iter, source_face, BM_LOOPS_OF_FACE) { + BM_ITER_ELEM (target_loop, &iter2, target_face, BM_LOOPS_OF_FACE) { if (BLI_ghash_lookup(vhash, source_loop->v) == target_loop->v) { BM_elem_attrs_copy(source_mesh, target_mesh, source_loop, target_loop); break; @@ -201,7 +201,7 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target) ehash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "bmesh dupeops e"); /* duplicate flagged vertices */ - BM_ITER (v, &viter, source, BM_VERTS_OF_MESH, source) { + BM_ITER_MESH (v, &viter, source, BM_VERTS_OF_MESH) { if (BMO_elem_flag_test(source, v, DUPE_INPUT) && !BMO_elem_flag_test(source, v, DUPE_DONE)) { @@ -210,7 +210,7 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target) v2 = copy_vertex(source, v, target, vhash); - BM_ITER (f, &iter, source, BM_FACES_OF_VERT, v) { + BM_ITER_ELEM (f, &iter, v, BM_FACES_OF_VERT) { if (BMO_elem_flag_test(source, f, DUPE_INPUT)) { isolated = 0; break; @@ -218,7 +218,7 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target) } if (isolated) { - BM_ITER (e, &iter, source, BM_EDGES_OF_VERT, v) { + BM_ITER_ELEM (e, &iter, v, BM_EDGES_OF_VERT) { if (BMO_elem_flag_test(source, e, DUPE_INPUT)) { isolated = 0; break; @@ -235,7 +235,7 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target) } /* now we dupe all the edges */ - BM_ITER (e, &eiter, source, BM_EDGES_OF_MESH, source) { + BM_ITER_MESH (e, &eiter, source, BM_EDGES_OF_MESH) { if (BMO_elem_flag_test(source, e, DUPE_INPUT) && !BMO_elem_flag_test(source, e, DUPE_DONE)) { @@ -255,10 +255,10 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target) } /* first we dupe all flagged faces and their elements from source */ - BM_ITER (f, &fiter, source, BM_FACES_OF_MESH, source) { + BM_ITER_MESH (f, &fiter, source, BM_FACES_OF_MESH) { if (BMO_elem_flag_test(source, f, DUPE_INPUT)) { /* vertex pass */ - BM_ITER (v, &viter, source, BM_VERTS_OF_FACE, f) { + BM_ITER_ELEM (v, &viter, f, BM_VERTS_OF_FACE) { if (!BMO_elem_flag_test(source, v, DUPE_DONE)) { copy_vertex(source, v, target, vhash); BMO_elem_flag_enable(source, v, DUPE_DONE); @@ -266,7 +266,7 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target) } /* edge pass */ - BM_ITER (e, &eiter, source, BM_EDGES_OF_FACE, f) { + BM_ITER_ELEM (e, &eiter, f, BM_EDGES_OF_FACE) { if (!BMO_elem_flag_test(source, e, DUPE_DONE)) { copy_edge(op, source, e, target, vhash, ehash); BMO_elem_flag_enable(source, e, DUPE_DONE); diff --git a/source/blender/bmesh/operators/bmo_edgesplit.c b/source/blender/bmesh/operators/bmo_edgesplit.c index 05703ce1933..ccbcb293915 100644 --- a/source/blender/bmesh/operators/bmo_edgesplit.c +++ b/source/blender/bmesh/operators/bmo_edgesplit.c @@ -60,7 +60,7 @@ static void bm_edgesplit_validate_seams(BMesh *bm, BMOperator *op) vtouch = MEM_callocN(sizeof(char) * bm->totvert, __func__); /* tag all boundary verts so as not to untag an edge which is inbetween only 2 faces [] */ - BM_ITER (e, &iter, bm, BM_EDGES_OF_MESH, NULL) { + BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { /* unrelated to flag assignment in this function - since this is the * only place we loop over all edges, disable tag */ diff --git a/source/blender/bmesh/operators/bmo_extrude.c b/source/blender/bmesh/operators/bmo_extrude.c index af62abaeec9..4124eafda74 100644 --- a/source/blender/bmesh/operators/bmo_extrude.c +++ b/source/blender/bmesh/operators/bmo_extrude.c @@ -62,7 +62,7 @@ void bmo_extrude_face_indiv_exec(BMesh *bm, BMOperator *op) i = 0; firstv = lastv = NULL; - BM_ITER (l, &liter, bm, BM_LOOPS_OF_FACE, f) { + BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) { v = BM_vert_create(bm, l->v->co, l->v); /* skip on the first iteration */ @@ -93,7 +93,7 @@ void bmo_extrude_face_indiv_exec(BMesh *bm, BMOperator *op) BM_elem_attrs_copy(bm, bm, f, f2); l2 = BM_iter_new(&liter2, bm, BM_LOOPS_OF_FACE, f2); - BM_ITER (l, &liter, bm, BM_LOOPS_OF_FACE, f) { + BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) { BM_elem_attrs_copy(bm, bm, l, l2); l3 = l->next; @@ -258,7 +258,7 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) /* if one flagged face is bordered by an un-flagged face, then we delete * original geometry unless caller explicitly asked to keep it. */ if (!BMO_slot_bool_get(op, "alwayskeeporig")) { - BM_ITER (e, &iter, bm, BM_EDGES_OF_MESH, NULL) { + BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { int edge_face_tot; @@ -269,7 +269,7 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) found = FALSE; /* found a face that isn't input? */ edge_face_tot = 0; /* edge/face count */ - BM_ITER (f, &fiter, bm, BM_FACES_OF_EDGE, e) { + BM_ITER_ELEM (f, &fiter, e, BM_FACES_OF_EDGE) { if (!BMO_elem_flag_test(bm, f, EXT_INPUT)) { found = TRUE; delorig = TRUE; @@ -287,10 +287,10 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) } /* calculate verts to delete */ - BM_ITER (v, &iter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { found = FALSE; - BM_ITER (e, &viter, bm, BM_EDGES_OF_VERT, v) { + BM_ITER_ELEM (e, &viter, v, BM_EDGES_OF_VERT) { if (!BMO_elem_flag_test(bm, e, EXT_INPUT) || !BMO_elem_flag_test(bm, e, EXT_DEL)) { found = TRUE; break; @@ -299,7 +299,7 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) /* avoid an extra loop */ if (found == TRUE) { - BM_ITER (f, &viter, bm, BM_FACES_OF_VERT, v) { + BM_ITER_ELEM (f, &viter, v, BM_FACES_OF_VERT) { if (!BMO_elem_flag_test(bm, f, EXT_INPUT)) { found = TRUE; break; @@ -312,7 +312,7 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) } } - BM_ITER (f, &iter, bm, BM_FACES_OF_MESH, NULL) { + BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) { if (BMO_elem_flag_test(bm, f, EXT_INPUT)) { BMO_elem_flag_enable(bm, f, EXT_DEL); } @@ -335,7 +335,7 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) /* if not delorig, reverse loops of original face */ if (!delorig) { - BM_ITER (f, &iter, bm, BM_FACES_OF_MESH, NULL) { + BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) { if (BMO_elem_flag_test(bm, f, EXT_INPUT)) { BM_face_normal_flip(bm, f); } @@ -418,18 +418,18 @@ static void calc_solidify_normals(BMesh *bm) /* can't use BM_edge_face_count because we need to count only marked faces */ int *edge_face_count = MEM_callocN(sizeof(int) * bm->totedge, __func__); - BM_ITER (v, &viter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &viter, bm, BM_VERTS_OF_MESH) { BM_elem_flag_enable(v, BM_ELEM_TAG); } BM_mesh_elem_index_ensure(bm, BM_EDGE); - BM_ITER (f, &fiter, bm, BM_FACES_OF_MESH, NULL) { + BM_ITER_MESH (f, &fiter, bm, BM_FACES_OF_MESH) { if (!BMO_elem_flag_test(bm, f, FACE_MARK)) { continue; } - BM_ITER (e, &eiter, bm, BM_EDGES_OF_FACE, f) { + BM_ITER_ELEM (e, &eiter, f, BM_EDGES_OF_FACE) { /* And mark all edges and vertices on the * marked faces */ @@ -440,7 +440,7 @@ static void calc_solidify_normals(BMesh *bm) } } - BM_ITER (e, &eiter, bm, BM_EDGES_OF_MESH, NULL) { + BM_ITER_MESH (e, &eiter, bm, BM_EDGES_OF_MESH) { if (!BMO_elem_flag_test(bm, e, EDGE_MARK)) { continue; } @@ -458,7 +458,7 @@ static void calc_solidify_normals(BMesh *bm) MEM_freeN(edge_face_count); edge_face_count = NULL; /* don't re-use */ - BM_ITER (v, &viter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &viter, bm, BM_VERTS_OF_MESH) { if (!BM_vert_is_manifold(v)) { BMO_elem_flag_enable(bm, v, VERT_NONMAN); continue; @@ -469,7 +469,7 @@ static void calc_solidify_normals(BMesh *bm) } } - BM_ITER (e, &eiter, bm, BM_EDGES_OF_MESH, NULL) { + BM_ITER_MESH (e, &eiter, bm, BM_EDGES_OF_MESH) { /* If the edge is not part of a the solidify region * its normal should not be considered */ @@ -485,7 +485,7 @@ static void calc_solidify_normals(BMesh *bm) f1 = f2 = NULL; - BM_ITER (f, &fiter, bm, BM_FACES_OF_EDGE, e) { + BM_ITER_ELEM (f, &fiter, e, BM_FACES_OF_EDGE) { if (BMO_elem_flag_test(bm, f, FACE_MARK)) { if (f1 == NULL) { f1 = f; @@ -530,7 +530,7 @@ static void calc_solidify_normals(BMesh *bm) } /* normalize accumulated vertex normal */ - BM_ITER (v, &viter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &viter, bm, BM_VERTS_OF_MESH) { if (!BMO_elem_flag_test(bm, v, VERT_MARK)) { continue; } @@ -542,7 +542,7 @@ static void calc_solidify_normals(BMesh *bm) else if (normalize_v3(v->no) == 0.0f && !BM_elem_flag_test(v, BM_ELEM_TAG)) { /* exceptional case, totally flat. use the normal * of any marked face around the vertex */ - BM_ITER (f, &fiter, bm, BM_FACES_OF_VERT, v) { + BM_ITER_ELEM (f, &fiter, v, BM_FACES_OF_VERT) { if (BMO_elem_flag_test(bm, f, FACE_MARK)) { break; } @@ -571,13 +571,13 @@ static void solidify_add_thickness(BMesh *bm, const float dist) BM_mesh_elem_index_ensure(bm, BM_VERT); - BM_ITER (f, &iter, bm, BM_FACES_OF_MESH, NULL) { + BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) { if (!BMO_elem_flag_test(bm, f, FACE_MARK)) { continue; } BLI_array_growitems(verts, f->len); - BM_ITER_INDEX (l, &loopIter, bm, BM_LOOPS_OF_FACE, f, i) { + BM_ITER_ELEM_INDEX (l, &loopIter, f, BM_LOOPS_OF_FACE, i) { verts[i] = l->v->co; } @@ -585,7 +585,7 @@ static void solidify_add_thickness(BMesh *bm, const float dist) angle_poly_v3(face_angles, (const float **)verts, f->len); i = 0; - BM_ITER (l, &loopIter, bm, BM_LOOPS_OF_FACE, f) { + BM_ITER_ELEM (l, &loopIter, f, BM_LOOPS_OF_FACE) { v = l->v; index = BM_elem_index_get(v); vert_accum[index] += face_angles[i]; @@ -597,7 +597,7 @@ static void solidify_add_thickness(BMesh *bm, const float dist) BLI_array_empty(face_angles); } - BM_ITER (v, &iter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { index = BM_elem_index_get(v); if (vert_accum[index]) { /* zero if unselected */ madd_v3_v3fl(v->co, v->no, dist * (vert_angles[index] / vert_accum[index])); diff --git a/source/blender/bmesh/operators/bmo_inset.c b/source/blender/bmesh/operators/bmo_inset.c index 38fa7237e9c..4e4ea655414 100644 --- a/source/blender/bmesh/operators/bmo_inset.c +++ b/source/blender/bmesh/operators/bmo_inset.c @@ -122,7 +122,7 @@ void bmo_inset_exec(BMesh *bm, BMOperator *op) /* first count all inset edges we will split */ /* fill in array and initialize tagging */ - BM_ITER (e, &iter, bm, BM_EDGES_OF_MESH, NULL) { + BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { if ( /* tag if boundary is enabled */ (use_boundary && BM_edge_is_boundary(e) && BM_elem_flag_test(e->l->f, BM_ELEM_TAG)) || @@ -152,7 +152,7 @@ void bmo_inset_exec(BMesh *bm, BMOperator *op) /* fill in array and initialize tagging */ es = edge_info; - BM_ITER (e, &iter, bm, BM_EDGES_OF_MESH, NULL) { + BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { i = BM_elem_index_get(e); if (i != -1) { /* calc edge-split info */ @@ -246,7 +246,7 @@ void bmo_inset_exec(BMesh *bm, BMOperator *op) int vecpair[2]; /* find adjacent */ - BM_ITER (e, &iter, bm, BM_EDGES_OF_VERT, v_split) { + BM_ITER_ELEM (e, &iter, v_split, BM_EDGES_OF_VERT) { if (BM_elem_flag_test(e, BM_ELEM_TAG) && e->l && BM_elem_flag_test(e->l->f, BM_ELEM_TAG)) { @@ -411,7 +411,7 @@ void bmo_inset_exec(BMesh *bm, BMOperator *op) if (r_vout_len > 2) { int ok = TRUE; /* last step, NULL this vertex if has a tagged face */ - BM_ITER (f, &iter, bm, BM_FACES_OF_VERT, v_split) { + BM_ITER_ELEM (f, &iter, v_split, BM_FACES_OF_VERT) { if (BM_elem_flag_test(f, BM_ELEM_TAG)) { ok = FALSE; break; diff --git a/source/blender/bmesh/operators/bmo_join_triangles.c b/source/blender/bmesh/operators/bmo_join_triangles.c index a31b635021b..c8c36f94c0c 100644 --- a/source/blender/bmesh/operators/bmo_join_triangles.c +++ b/source/blender/bmesh/operators/bmo_join_triangles.c @@ -239,13 +239,13 @@ void bmo_join_triangles_exec(BMesh *bm, BMOperator *op) /* flag all edges of all input face */ BMO_ITER (f1, &siter, bm, op, "faces", BM_FACE) { BMO_elem_flag_enable(bm, f1, FACE_INPUT); - BM_ITER (l, &liter, bm, BM_LOOPS_OF_FACE, f1) { + BM_ITER_ELEM (l, &liter, f1, BM_LOOPS_OF_FACE) { BMO_elem_flag_enable(bm, l->e, EDGE_MARK); } } /* unflag edges that are invalid; e.g. aren't surrounded by triangle */ - BM_ITER (e, &iter, bm, BM_EDGES_OF_MESH, NULL) { + BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { if (!BMO_elem_flag_test(bm, e, EDGE_MARK)) continue; @@ -266,7 +266,7 @@ void bmo_join_triangles_exec(BMesh *bm, BMOperator *op) } i = 0; - BM_ITER (e, &iter, bm, BM_EDGES_OF_MESH, NULL) { + BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { BMVert *v1, *v2, *v3, *v4; BMFace *f1, *f2; float measure; @@ -323,7 +323,7 @@ void bmo_join_triangles_exec(BMesh *bm, BMOperator *op) BMO_elem_flag_enable(bm, e, EDGE_CHOSEN); } - BM_ITER (e, &iter, bm, BM_EDGES_OF_MESH, NULL) { + BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { if (!BMO_elem_flag_test(bm, e, EDGE_CHOSEN)) continue; @@ -332,7 +332,7 @@ void bmo_join_triangles_exec(BMesh *bm, BMOperator *op) BM_faces_join_pair(bm, f1, f2, e, TRUE); } - BM_ITER (e, &iter, bm, BM_EDGES_OF_MESH, NULL) { + BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { if (BMO_elem_flag_test(bm, e, EDGE_MARK)) { /* ok, this edge wasn't merged, check if it's * in a 2-tri-pair island, and if so merg */ @@ -344,7 +344,7 @@ void bmo_join_triangles_exec(BMesh *bm, BMOperator *op) continue; for (i = 0; i < 2; i++) { - BM_ITER (l, &liter, bm, BM_LOOPS_OF_FACE, i ? f2 : f1) { + BM_ITER_ELEM (l, &liter, i ? f2 : f1, BM_LOOPS_OF_FACE) { if (l->e != e && BMO_elem_flag_test(bm, l->e, EDGE_MARK)) { break; } diff --git a/source/blender/bmesh/operators/bmo_mirror.c b/source/blender/bmesh/operators/bmo_mirror.c index 003cb49164f..cf1669d441e 100644 --- a/source/blender/bmesh/operators/bmo_mirror.c +++ b/source/blender/bmesh/operators/bmo_mirror.c @@ -102,7 +102,7 @@ void bmo_mirror_exec(BMesh *bm, BMOperator *op) BMIter liter; BMO_ITER (f, &siter, bm, &dupeop, "newout", BM_FACE) { - BM_ITER (l, &liter, bm, BM_LOOPS_OF_FACE, f) { + BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) { totlayer = CustomData_number_of_layers(&bm->ldata, CD_MLOOPUV); for (i = 0; i < totlayer; i++) { luv = CustomData_bmesh_get_n(&bm->ldata, l->head.data, CD_MLOOPUV, i); diff --git a/source/blender/bmesh/operators/bmo_primitive.c b/source/blender/bmesh/operators/bmo_primitive.c index ec2504c3976..e526e2eaca0 100644 --- a/source/blender/bmesh/operators/bmo_primitive.c +++ b/source/blender/bmesh/operators/bmo_primitive.c @@ -370,7 +370,7 @@ void bmo_create_uvsphere_exec(BMesh *bm, BMOperator *op) } /* and now do imat */ - BM_ITER (eve, &iter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (eve, &iter, bm, BM_VERTS_OF_MESH) { if (BMO_elem_flag_test(bm, eve, VERT_MARK)) { mul_m4_v3(mat, eve->co); } @@ -415,7 +415,7 @@ void bmo_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) { + BM_ITER_ELEM (l, &liter, eftemp, BM_LOOPS_OF_FACE) { BMO_elem_flag_enable(bm, l->e, EDGE_MARK); } @@ -437,7 +437,7 @@ void bmo_create_icosphere_exec(BMesh *bm, BMOperator *op) } /* must transform after because of sphere subdivision */ - BM_ITER (v, &viter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &viter, bm, BM_VERTS_OF_MESH) { if (BMO_elem_flag_test(bm, v, VERT_MARK)) { mul_m4_v3(mat, v->co); } diff --git a/source/blender/bmesh/operators/bmo_removedoubles.c b/source/blender/bmesh/operators/bmo_removedoubles.c index 3eec9437299..8cdb3b9b373 100644 --- a/source/blender/bmesh/operators/bmo_removedoubles.c +++ b/source/blender/bmesh/operators/bmo_removedoubles.c @@ -43,7 +43,7 @@ static void remdoubles_splitface(BMFace *f, BMesh *bm, BMOperator *op) BMVert *v2, *doub; int split = FALSE; - BM_ITER (l, &liter, bm, BM_LOOPS_OF_FACE, f) { + BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) { v2 = BMO_slot_map_ptr_get(bm, op, "targetmap", l->v); /* ok: if v2 is NULL (e.g. not in the map) then it's * a target vert, otherwise it's a double */ @@ -108,7 +108,7 @@ void bmo_weldverts_exec(BMesh *bm, BMOperator *op) int a, b; /* mark merge verts for deletion */ - BM_ITER (v, &iter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { if ((v2 = BMO_slot_map_ptr_get(bm, op, "targetmap", v))) { BMO_elem_flag_enable(bm, v, ELE_DEL); @@ -119,11 +119,11 @@ void bmo_weldverts_exec(BMesh *bm, BMOperator *op) /* check if any faces are getting their own corners merged together, split face if so */ - BM_ITER (f, &iter, bm, BM_FACES_OF_MESH, NULL) { + BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) { remdoubles_splitface(f, bm, op); } - BM_ITER (e, &iter, bm, BM_EDGES_OF_MESH, NULL) { + BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { if (BMO_elem_flag_test(bm, e->v1, ELE_DEL) || BMO_elem_flag_test(bm, e->v2, ELE_DEL)) { v = BMO_slot_map_ptr_get(bm, op, "targetmap", e->v1); v2 = BMO_slot_map_ptr_get(bm, op, "targetmap", e->v2); @@ -143,9 +143,9 @@ void bmo_weldverts_exec(BMesh *bm, BMOperator *op) } /* BMESH_TODO, stop abusing face index here */ - BM_ITER (f, &iter, bm, BM_FACES_OF_MESH, NULL) { + BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) { BM_elem_index_set(f, 0); /* set_dirty! */ - BM_ITER (l, &liter, bm, BM_LOOPS_OF_FACE, f) { + BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) { if (BMO_elem_flag_test(bm, l->v, ELE_DEL)) { BMO_elem_flag_enable(bm, f, FACE_MARK|ELE_DEL); } @@ -158,7 +158,7 @@ void bmo_weldverts_exec(BMesh *bm, BMOperator *op) /* faces get "modified" by creating new faces here, then at the end the old faces are deleted */ - BM_ITER (f, &iter, bm, BM_FACES_OF_MESH, NULL) { + BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) { if (!BMO_elem_flag_test(bm, f, FACE_MARK)) continue; @@ -170,7 +170,7 @@ void bmo_weldverts_exec(BMesh *bm, BMOperator *op) BLI_array_empty(edges); BLI_array_empty(loops); a = 0; - BM_ITER (l, &liter, bm, BM_LOOPS_OF_FACE, f) { + BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) { v = l->v; v2 = l->next->v; if (BMO_elem_flag_test(bm, v, ELE_DEL)) { @@ -218,7 +218,7 @@ void bmo_weldverts_exec(BMesh *bm, BMOperator *op) BM_elem_attrs_copy(bm, bm, f, f2); a = 0; - BM_ITER (l, &liter, bm, BM_LOOPS_OF_FACE, f2) { + BM_ITER_ELEM (l, &liter, f2, BM_LOOPS_OF_FACE) { l2 = loops[a]; BM_elem_attrs_copy(bm, bm, l2, l); @@ -269,7 +269,7 @@ void bmo_pointmerge_facedata_exec(BMesh *bm, BMOperator *op) return; fac = 1.0f / tot; - BM_ITER (l, &iter, bm, BM_LOOPS_OF_VERT, snapv) { + BM_ITER_ELEM (l, &iter, snapv, BM_LOOPS_OF_VERT) { if (!firstl) { firstl = l; } @@ -291,7 +291,7 @@ void bmo_pointmerge_facedata_exec(BMesh *bm, BMOperator *op) } BMO_ITER (v, &siter, bm, op, "verts", BM_VERT) { - BM_ITER (l, &iter, bm, BM_LOOPS_OF_VERT, v) { + BM_ITER_ELEM (l, &iter, v, BM_LOOPS_OF_VERT) { if (l == firstl) { continue; } @@ -319,7 +319,7 @@ void bmo_vert_average_facedata_exec(BMesh *bm, BMOperator *op) CustomData_data_initminmax(type, &min, &max); BMO_ITER (v, &siter, bm, op, "verts", BM_VERT) { - BM_ITER (l, &iter, bm, BM_LOOPS_OF_VERT, v) { + BM_ITER_ELEM (l, &iter, v, BM_LOOPS_OF_VERT) { block = CustomData_bmesh_get_layer_n(&bm->ldata, l->head.data, i); CustomData_data_dominmax(type, block, &min, &max); } @@ -330,7 +330,7 @@ void bmo_vert_average_facedata_exec(BMesh *bm, BMOperator *op) CustomData_data_add(type, &min, &max); BMO_ITER (v, &siter, bm, op, "verts", BM_VERT) { - BM_ITER (l, &iter, bm, BM_LOOPS_OF_VERT, v) { + BM_ITER_ELEM (l, &iter, v, BM_LOOPS_OF_VERT) { block = CustomData_bmesh_get_layer_n(&bm->ldata, l->head.data, i); CustomData_data_copy_value(type, &min, block); } @@ -384,7 +384,7 @@ void bmo_collapse_exec(BMesh *bm, BMOperator *op) BMW_FLAG_NOP, /* no need to use BMW_FLAG_TEST_HIDDEN, already marked data */ BMW_NIL_LAY); - BM_ITER (e, &iter, bm, BM_EDGES_OF_MESH, NULL) { + BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { if (!BMO_elem_flag_test(bm, e, EDGE_MARK)) continue; @@ -444,8 +444,8 @@ static void bmo_collapsecon_do_layer(BMesh *bm, BMOperator *op, int layer) BMW_FLAG_NOP, /* no need to use BMW_FLAG_TEST_HIDDEN, already marked data */ layer); - BM_ITER (f, &iter, bm, BM_FACES_OF_MESH, NULL) { - BM_ITER (l, &liter, bm, BM_LOOPS_OF_FACE, f) { + BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) { + BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) { if (BMO_elem_flag_test(bm, l->e, EDGE_MARK)) { /* walk */ BLI_array_empty(blocks); @@ -583,7 +583,7 @@ void bmo_automerge_exec(BMesh *bm, BMOperator *op) * can be merged away into any other verts. Mark all other verts * as VERT_KEEP. */ BMO_slot_buffer_flag_enable(bm, op, "verts", BM_VERT, VERT_IN); - BM_ITER (v, &viter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &viter, bm, BM_VERTS_OF_MESH) { if (!BMO_elem_flag_test(bm, v, VERT_IN)) { BMO_elem_flag_enable(bm, v, VERT_KEEP); } diff --git a/source/blender/bmesh/operators/bmo_slide.c b/source/blender/bmesh/operators/bmo_slide.c index 4b1c2b56f05..57bda579603 100644 --- a/source/blender/bmesh/operators/bmo_slide.c +++ b/source/blender/bmesh/operators/bmo_slide.c @@ -88,7 +88,7 @@ void bmo_vertex_slide_exec(BMesh *bm, BMOperator *op) } /* Make sure we get the correct edge. */ - BM_ITER (edge, &iter, bm, BM_EDGES_OF_VERT, vertex) { + BM_ITER_ELEM (edge, &iter, vertex, BM_EDGES_OF_VERT) { if (BMO_elem_flag_test(bm, edge, EDGE_MARK) && BM_vert_in_edge(edge, vertex)) { slide_edge = edge; break; diff --git a/source/blender/bmesh/operators/bmo_subdivide.c b/source/blender/bmesh/operators/bmo_subdivide.c index 3d148d6268f..b5ca85ebe81 100644 --- a/source/blender/bmesh/operators/bmo_subdivide.c +++ b/source/blender/bmesh/operators/bmo_subdivide.c @@ -742,7 +742,7 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op) BM_data_layer_add(bmesh, &bmesh->vdata, CD_SHAPEKEY); skey = CustomData_number_of_layers(&bmesh->vdata, CD_SHAPEKEY) - 1; - BM_ITER (v, &viter, bmesh, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &viter, bmesh, BM_VERTS_OF_MESH) { float *co = CustomData_bmesh_get_n(&bmesh->vdata, v->head.data, CD_SHAPEKEY, skey); copy_v3_v3(co, v->co); } @@ -768,7 +768,7 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op) BM_EDGE, EDGE_PERCENT); - BM_ITER (face, &fiter, bmesh, BM_FACES_OF_MESH, NULL) { + BM_ITER_MESH (face, &fiter, bmesh, BM_FACES_OF_MESH) { BMEdge *e1 = NULL, *e2 = NULL; float vec1[3], vec2[3]; @@ -783,7 +783,7 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op) matched = 0; totesel = 0; - BM_ITER_INDEX (nl, &liter, bmesh, BM_LOOPS_OF_FACE, face, i) { + BM_ITER_ELEM_INDEX (nl, &liter, face, BM_LOOPS_OF_FACE, i) { edges[i] = nl->e; verts[i] = nl->v; @@ -894,7 +894,7 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op) } /* copy original-geometry displacements to current coordinates */ - BM_ITER (v, &viter, bmesh, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &viter, bmesh, BM_VERTS_OF_MESH) { float *co = CustomData_bmesh_get_n(&bmesh->vdata, v->head.data, CD_SHAPEKEY, skey); copy_v3_v3(v->co, co); } @@ -916,7 +916,7 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op) BLI_array_empty(splits); /* for case of two edges, connecting them shouldn't be too hard */ - BM_ITER (l, &liter, bmesh, BM_LOOPS_OF_FACE, face) { + BM_ITER_ELEM (l, &liter, face, BM_LOOPS_OF_FACE) { BLI_array_growone(loops); loops[BLI_array_count(loops) - 1] = l; } @@ -1003,7 +1003,7 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op) } /* copy original-geometry displacements to current coordinates */ - BM_ITER (v, &viter, bmesh, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &viter, bmesh, BM_VERTS_OF_MESH) { float *co = CustomData_bmesh_get_n(&bmesh->vdata, v->head.data, CD_SHAPEKEY, skey); copy_v3_v3(v->co, co); } @@ -1064,7 +1064,7 @@ void BM_mesh_esubdivideflag(Object *UNUSED(obedit), BMesh *bm, int flag, float s BMEdge *e; BMIter eiter; - BM_ITER (e, &eiter, bm, BM_EDGES_OF_VERT, ele) { + BM_ITER_ELEM (e, &eiter, ele, BM_EDGES_OF_VERT) { if (!BM_elem_flag_test(e, BM_ELEM_SELECT) && BM_elem_flag_test(e->v1, BM_ELEM_SELECT) && BM_elem_flag_test(e->v2, BM_ELEM_SELECT)) diff --git a/source/blender/bmesh/operators/bmo_triangulate.c b/source/blender/bmesh/operators/bmo_triangulate.c index 33c4cfc45e8..916b10d707e 100644 --- a/source/blender/bmesh/operators/bmo_triangulate.c +++ b/source/blender/bmesh/operators/bmo_triangulate.c @@ -103,7 +103,7 @@ void bmo_beautify_fill_exec(BMesh *bm, BMOperator *op) while (!stop) { stop = 1; - BM_ITER (e, &iter, bm, BM_EDGES_OF_MESH, NULL) { + BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { BMVert *v1, *v2, *v3, *v4; if (!BM_edge_is_manifold(e) || BMO_elem_flag_test(bm, e, EDGE_MARK)) { @@ -206,7 +206,7 @@ void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op) BMIter liter; BMO_elem_flag_enable(bm, f, ELE_NEW); - BM_ITER (l, &liter, bm, BM_LOOPS_OF_FACE, f) { + BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) { if (!BMO_elem_flag_test(bm, l->e, EDGE_MARK)) { 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 b35bcc8eaec..30bb1d2913d 100644 --- a/source/blender/bmesh/operators/bmo_utils.c +++ b/source/blender/bmesh/operators/bmo_utils.c @@ -181,13 +181,13 @@ static void bmo_regionextend_extend(BMesh *bm, BMOperator *op, int usefaces) if (!usefaces) { BMO_ITER (v, &siter, bm, op, "geom", BM_VERT) { - BM_ITER (e, &eiter, bm, BM_EDGES_OF_VERT, v) { + BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) { if (!BMO_elem_flag_test(bm, e, SEL_ORIG)) break; } if (e) { - BM_ITER (e, &eiter, bm, BM_EDGES_OF_VERT, v) { + BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) { BMO_elem_flag_enable(bm, e, SEL_FLAG); BMO_elem_flag_enable(bm, BM_edge_other_vert(e, v), SEL_FLAG); } @@ -200,8 +200,8 @@ static void bmo_regionextend_extend(BMesh *bm, BMOperator *op, int usefaces) BMLoop *l; BMO_ITER (f, &siter, bm, op, "geom", BM_FACE) { - BM_ITER (l, &liter, bm, BM_LOOPS_OF_FACE, f) { - BM_ITER (f2, &fiter, bm, BM_FACES_OF_EDGE, l->e) { + BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) { + BM_ITER_ELEM (f2, &fiter, l->e, BM_FACES_OF_EDGE) { if (!BMO_elem_flag_test(bm, f2, SEL_ORIG)) { BMO_elem_flag_enable(bm, f2, SEL_FLAG); } @@ -220,7 +220,7 @@ static void bmo_regionextend_constrict(BMesh *bm, BMOperator *op, int usefaces) if (!usefaces) { BMO_ITER (v, &siter, bm, op, "geom", BM_VERT) { - BM_ITER (e, &eiter, bm, BM_EDGES_OF_VERT, v) { + BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) { if (!BMO_elem_flag_test(bm, e, SEL_ORIG)) break; } @@ -228,7 +228,7 @@ static void bmo_regionextend_constrict(BMesh *bm, BMOperator *op, int usefaces) if (e) { BMO_elem_flag_enable(bm, v, SEL_FLAG); - BM_ITER (e, &eiter, bm, BM_EDGES_OF_VERT, v) { + BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) { BMO_elem_flag_enable(bm, e, SEL_FLAG); } @@ -241,8 +241,8 @@ static void bmo_regionextend_constrict(BMesh *bm, BMOperator *op, int usefaces) BMLoop *l; BMO_ITER (f, &siter, bm, op, "geom", BM_FACE) { - BM_ITER (l, &liter, bm, BM_LOOPS_OF_FACE, f) { - BM_ITER (f2, &fiter, bm, BM_FACES_OF_EDGE, l->e) { + BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) { + BM_ITER_ELEM (f2, &fiter, l->e, BM_FACES_OF_EDGE) { if (!BMO_elem_flag_test(bm, f2, SEL_ORIG)) { BMO_elem_flag_enable(bm, f, SEL_FLAG); break; @@ -358,8 +358,8 @@ void bmo_righthandfaces_exec(BMesh *bm, BMOperator *op) f = fstack[i]; i--; - BM_ITER (l, &liter, bm, BM_LOOPS_OF_FACE, f) { - BM_ITER (l2, &liter2, bm, BM_LOOPS_OF_LOOP, l) { + BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) { + BM_ITER_ELEM (l2, &liter2, l, BM_LOOPS_OF_LOOP) { if (!BMO_elem_flag_test(bm, l2->f, FACE_FLAG) || l2 == l) continue; @@ -424,7 +424,7 @@ void bmo_vertexsmooth_exec(BMesh *bm, BMOperator *op) co = cos[i]; j = 0; - BM_ITER (e, &iter, bm, BM_EDGES_OF_VERT, v) { + BM_ITER_ELEM (e, &iter, v, BM_EDGES_OF_VERT) { co2 = BM_edge_other_vert(e, v)->co; add_v3_v3v3(co, co, co2); j += 1; @@ -475,7 +475,7 @@ static float ngon_fake_area(BMesh *bm, BMFace *f) BM_face_center_mean_calc(bm, f, c); - BM_ITER (l, &liter, bm, BM_LOOPS_OF_FACE, f) { + BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) { if (num_verts == 0) { copy_v3_v3(v, l->v->co); copy_v3_v3(sv, l->v->co); @@ -545,7 +545,7 @@ void bmo_similarfaces_exec(BMesh *bm, BMOperator *op) f_ext = (SimSel_FaceExt *)MEM_callocN(sizeof(SimSel_FaceExt) * num_total, "f_ext util.c"); /* loop through all the faces and fill the faces/indices structure */ - BM_ITER (fm, &fm_iter, bm, BM_FACES_OF_MESH, NULL) { + BM_ITER_MESH (fm, &fm_iter, bm, BM_FACES_OF_MESH) { f_ext[i].f = fm; if (BMO_elem_flag_test(bm, fm, FACE_MARK)) { indices[idx] = i; @@ -673,7 +673,7 @@ static float edge_angle(BMesh *bm, BMEdge *e) /* first edge faces, don't account for 3+ */ - BM_ITER (f, &fiter, bm, BM_FACES_OF_EDGE, e) { + BM_ITER_ELEM (f, &fiter, e, BM_FACES_OF_EDGE) { if (f_prev == NULL) { f_prev = f; } @@ -733,7 +733,7 @@ void bmo_similaredges_exec(BMesh *bm, BMOperator *op) e_ext = (SimSel_EdgeExt *)MEM_callocN(sizeof(SimSel_EdgeExt) * num_total, "e_ext util.c"); /* loop through all the edges and fill the edges/indices structure */ - BM_ITER (e, &e_iter, bm, BM_EDGES_OF_MESH, NULL) { + BM_ITER_MESH (e, &e_iter, bm, BM_EDGES_OF_MESH) { e_ext[i].e = e; if (BMO_elem_flag_test(bm, e, EDGE_MARK)) { indices[idx] = i; @@ -897,7 +897,7 @@ void bmo_similarverts_exec(BMesh *bm, BMOperator *op) v_ext = (SimSel_VertExt *)MEM_mallocN(sizeof(SimSel_VertExt) * num_total, "vertex extra"); /* loop through all the vertices and fill the vertices/indices structure */ - BM_ITER (v, &v_iter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &v_iter, bm, BM_VERTS_OF_MESH) { v_ext[i].v = v; if (BMO_elem_flag_test(bm, v, VERT_MARK)) { indices[idx] = i; @@ -993,7 +993,7 @@ void bmo_face_rotateuvs_exec(BMesh *bm, BMOperator *op) float t_uv[2]; /* tmp uvs */ int n = 0; - BM_ITER (lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs) { + BM_ITER_ELEM (lf, &l_iter, fs, BM_LOOPS_OF_FACE) { /* current loop uv is the previous loop uv */ MLoopUV *luv = CustomData_bmesh_get(&bm->ldata, lf->head.data, CD_MLOOPUV); if (n == 0) { @@ -1017,7 +1017,7 @@ void bmo_face_rotateuvs_exec(BMesh *bm, BMOperator *op) float t_uv[2]; /* current uvs */ int n = 0; - BM_ITER (lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs) { + BM_ITER_ELEM (lf, &l_iter, fs, BM_LOOPS_OF_FACE) { /* previous loop uv is the current loop uv */ luv = CustomData_bmesh_get(&bm->ldata, lf->head.data, CD_MLOOPUV); if (n == 0) { @@ -1058,7 +1058,7 @@ void bmo_face_reverseuvs_exec(BMesh *bm, BMOperator *op) BLI_array_empty(uvs); BLI_array_growitems(uvs, fs->len); - BM_ITER_INDEX (lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs, i) { + BM_ITER_ELEM_INDEX (lf, &l_iter, fs, BM_LOOPS_OF_FACE, i) { MLoopUV *luv = CustomData_bmesh_get(&bm->ldata, lf->head.data, CD_MLOOPUV); /* current loop uv is the previous loop uv */ @@ -1067,7 +1067,7 @@ void bmo_face_reverseuvs_exec(BMesh *bm, BMOperator *op) /* now that we have the uvs in the array, reverse! */ i = 0; - BM_ITER (lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs) { + BM_ITER_ELEM (lf, &l_iter, fs, BM_LOOPS_OF_FACE) { /* current loop uv is the previous loop uv */ MLoopUV *luv = CustomData_bmesh_get(&bm->ldata, lf->head.data, CD_MLOOPUV); luv->uv[0] = uvs[(fs->len - i - 1)][0]; @@ -1102,7 +1102,7 @@ void bmo_rotatecolors_exec(BMesh *bm, BMOperator *op) MLoopCol t_col; /* tmp color */ int n = 0; - BM_ITER (lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs) { + BM_ITER_ELEM (lf, &l_iter, fs, BM_LOOPS_OF_FACE) { /* current loop color is the previous loop color */ MLoopCol *luv = CustomData_bmesh_get(&bm->ldata, lf->head.data, CD_MLOOPCOL); if (n == 0) { @@ -1126,7 +1126,7 @@ void bmo_rotatecolors_exec(BMesh *bm, BMOperator *op) MLoopCol t_col; /* current color */ int n = 0; - BM_ITER (lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs) { + BM_ITER_ELEM (lf, &l_iter, fs, BM_LOOPS_OF_FACE) { /* previous loop color is the current loop color */ lcol = CustomData_bmesh_get(&bm->ldata, lf->head.data, CD_MLOOPCOL); if (n == 0) { @@ -1164,7 +1164,7 @@ void bmo_face_reversecolors_exec(BMesh *bm, BMOperator *op) int i = 0; BLI_array_empty(cols); - BM_ITER (lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs) { + BM_ITER_ELEM (lf, &l_iter, fs, BM_LOOPS_OF_FACE) { MLoopCol *lcol = CustomData_bmesh_get(&bm->ldata, lf->head.data, CD_MLOOPCOL); /* current loop uv is the previous loop color */ @@ -1175,7 +1175,7 @@ void bmo_face_reversecolors_exec(BMesh *bm, BMOperator *op) /* now that we have the uvs in the array, reverse! */ i = 0; - BM_ITER (lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs) { + BM_ITER_ELEM (lf, &l_iter, fs, BM_LOOPS_OF_FACE) { /* current loop uv is the previous loop color */ MLoopCol *lcol = CustomData_bmesh_get(&bm->ldata, lf->head.data, CD_MLOOPCOL); *lcol = cols[(fs->len - i - 1)]; @@ -1227,7 +1227,7 @@ void bmo_vertexshortestpath_exec(BMesh *bm, BMOperator *op) /* iterate through all the mesh vertices */ /* loop through all the vertices and fill the vertices/indices structure */ i = 0; - BM_ITER (v, &v_iter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER_MESH (v, &v_iter, bm, BM_VERTS_OF_MESH) { vert_list[i].v = v; vert_list[i].parent = NULL; vert_list[i].weight = FLT_MAX; @@ -1262,7 +1262,7 @@ void bmo_vertexshortestpath_exec(BMesh *bm, BMOperator *op) v_weight = vert_list[BM_elem_index_get(v)].weight; - BM_ITER (e, &e_i, bm, BM_EDGES_OF_VERT, v) { + BM_ITER_ELEM (e, &e_i, v, BM_EDGES_OF_VERT) { BMVert *u; float e_weight = v_weight; |