diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-04-19 05:02:58 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-04-19 05:02:58 +0400 |
commit | 34f993241840120c1847410756cb2bf8af1be119 (patch) | |
tree | 5af1464868f7ee20b53cc5b4336af5721d004db2 /source/blender/editors | |
parent | f2f27bf8325432ec8995f16385c7d65ef975eee1 (diff) |
simple optimization, replace BM_face_other_edge_loop() with BM_loop_other_edge_loop() in situations where the loop is known this avoids a lookup.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/mesh/editmesh_loopcut.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_rip.c | 8 | ||||
-rw-r--r-- | source/blender/editors/transform/transform.c | 18 | ||||
-rw-r--r-- | source/blender/editors/util/crazyspace.c | 2 |
4 files changed, 15 insertions, 15 deletions
diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c index 1bd6f285706..626f372c661 100644 --- a/source/blender/editors/mesh/editmesh_loopcut.c +++ b/source/blender/editors/mesh/editmesh_loopcut.c @@ -137,7 +137,7 @@ static void edgering_find_order(BMEdge *lasteed, BMEdge *eed, return; } - l2 = BM_face_other_edge_loop(l->f, l->e, eed->v1); + l2 = BM_loop_other_edge_loop(l, eed->v1); rev = (l2 == l->prev); while (l2->v != lasteed->v1 && l2->v != lasteed->v2) { l2 = rev ? l2->prev : l2->next; diff --git a/source/blender/editors/mesh/editmesh_rip.c b/source/blender/editors/mesh/editmesh_rip.c index b4c31b2df91..c9e248e575d 100644 --- a/source/blender/editors/mesh/editmesh_rip.c +++ b/source/blender/editors/mesh/editmesh_rip.c @@ -770,11 +770,11 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve else { if (BM_edge_is_manifold(e2)) { l = e2->l; - e = BM_face_other_edge_loop(l->f, e2, v)->e; + e = BM_loop_other_edge_loop(l, v)->e; BM_elem_flag_enable(e, BM_ELEM_TAG); l = e2->l->radial_next; - e = BM_face_other_edge_loop(l->f, e2, v)->e; + e = BM_loop_other_edge_loop(l, v)->e; BM_elem_flag_enable(e, BM_ELEM_TAG); } else { @@ -920,14 +920,14 @@ static int edbm_rip_invoke__edge(bContext *C, wmOperator *op, const wmEvent *eve l = (edbm_rip_edge_side_measure(e2, l_a, ar, projectMat, fmval) < edbm_rip_edge_side_measure(e2, l_b, ar, projectMat, fmval)) ? l_a : l_b; - l = BM_face_other_edge_loop(l->f, e2, v); + l = BM_loop_other_edge_loop(l, v); /* important edge is manifold else we can be attempting to split off a fan that don't budge, * not crashing but adds duplicate edge. */ if (BM_edge_is_manifold(l->e)) { l = l->radial_next; if (totedge_manifold != 3) - l = BM_face_other_edge_loop(l->f, l->e, v); + l = BM_loop_other_edge_loop(l, v); if (l) { BLI_assert(!BM_elem_flag_test(l->e, BM_ELEM_TAG)); diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index ca73405fb16..2bc587d8f73 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -5017,7 +5017,7 @@ static BMLoop *get_next_loop(BMVert *v, BMLoop *l, l_first = l; do { - l = BM_face_other_edge_loop(l->f, l->e, v); + l = BM_loop_other_edge_loop(l, v); if (l->radial_next == l) return NULL; @@ -5077,13 +5077,13 @@ static BMLoop *get_next_loop(BMVert *v, BMLoop *l, i += 1; } - if (BM_face_other_edge_loop(l->f, l->e, v)->e == e_next) { + if (BM_loop_other_edge_loop(l, v)->e == e_next) { if (i) { len_v3_ensure(vec_accum, vec_accum_len / (float)i); } copy_v3_v3(r_slide_vec, vec_accum); - return BM_face_other_edge_loop(l->f, l->e, v); + return BM_loop_other_edge_loop(l, v); } BLI_assert(l != l->radial_next); @@ -5301,11 +5301,11 @@ static int createEdgeSlideVerts(TransInfo *t) l1 = e->l; l2 = e->l->radial_next; - l = BM_face_other_edge_loop(l1->f, l1->e, v); + l = BM_loop_other_edge_loop(l1, v); sub_v3_v3v3(vec, BM_edge_other_vert(l->e, v)->co, v->co); if (l2 != l1) { - l = BM_face_other_edge_loop(l2->f, l2->e, v); + l = BM_loop_other_edge_loop(l2, v); sub_v3_v3v3(vec2, BM_edge_other_vert(l->e, v)->co, v->co); } else { @@ -5328,11 +5328,11 @@ static int createEdgeSlideVerts(TransInfo *t) if (l2) copy_v3_v3(sv->downvec, vec2); - l = BM_face_other_edge_loop(l1->f, l1->e, v); + l = BM_loop_other_edge_loop(l1, v); sv->up = BM_edge_other_vert(l->e, v); if (l2) { - l = BM_face_other_edge_loop(l2->f, l2->e, v); + l = BM_loop_other_edge_loop(l2, v); sv->down = BM_edge_other_vert(l->e, v); } @@ -5347,12 +5347,12 @@ static int createEdgeSlideVerts(TransInfo *t) sv->origvert = *v; sv->loop_nr = loop_nr; - l = BM_face_other_edge_loop(l1->f, l1->e, v); + l = BM_loop_other_edge_loop(l1, v); sv->up = BM_edge_other_vert(l->e, v); sub_v3_v3v3(sv->upvec, BM_edge_other_vert(l->e, v)->co, v->co); if (l2) { - l = BM_face_other_edge_loop(l2->f, l2->e, v); + l = BM_loop_other_edge_loop(l2, v); sv->down = BM_edge_other_vert(l->e, v); sub_v3_v3v3(sv->downvec, BM_edge_other_vert(l->e, v)->co, v->co); } diff --git a/source/blender/editors/util/crazyspace.c b/source/blender/editors/util/crazyspace.c index c37d1cc2df4..ea3687ad715 100644 --- a/source/blender/editors/util/crazyspace.c +++ b/source/blender/editors/util/crazyspace.c @@ -154,7 +154,7 @@ void crazyspace_set_quats_editmesh(BMEditMesh *em, float *origcos, float *mapped continue; BM_ITER_ELEM (l, &liter, v, BM_LOOPS_OF_VERT) { - BMLoop *l2 = BM_face_other_edge_loop(l->f, l->e, v); + BMLoop *l2 = BM_loop_other_edge_loop(l, v); /* retrieve mapped coordinates */ v1 = mappedcos + 3 * BM_elem_index_get(l->v); |