diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-04 20:36:31 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-04 20:36:31 +0400 |
commit | a0ab2eefb9c99140ebb3daad3be2303caea64b96 (patch) | |
tree | 406ed46881486425ada0baca05b67ed92d5bd01d /source/blender/editors | |
parent | 76e9f91d1c9ff5f026ff4e05e76b751f936f83f7 (diff) |
* rename BM_face_other_loop --> BM_face_other_edge_loop
* optimize BM_face_other_edge_loop to do about half as many iterations for quad heavy meshes, with ngons the gain is much more since searching around the entire ngon when the edge already stores its loop is silly.
... also nicer in cases where edge has no face users it avoids a loop on all face corners.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/mesh/bmesh_tools.c | 8 | ||||
-rw-r--r-- | source/blender/editors/mesh/loopcut.c | 2 | ||||
-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/bmesh_tools.c b/source/blender/editors/mesh/bmesh_tools.c index 037a64127d1..b1833bc660c 100644 --- a/source/blender/editors/mesh/bmesh_tools.c +++ b/source/blender/editors/mesh/bmesh_tools.c @@ -2398,12 +2398,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(l->f, e2, v)->e; + e = BM_face_other_edge_loop(l->f, e2, v)->e; 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(l->f, e2, v)->e; + e = BM_face_other_edge_loop(l->f, e2, v)->e; BM_elem_flag_enable(e, BM_ELEM_TAG); BM_elem_select_set(bm, e, TRUE); } @@ -2423,9 +2423,9 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) } if (i == 1 && e2->l) { - l = BM_face_other_loop(e2->l->f, e2, v); + l = BM_face_other_edge_loop(e2->l->f, e2, v); l = l->radial_next; - l = BM_face_other_loop(l->f, l->e, v); + l = BM_face_other_edge_loop(l->f, l->e, v); if (l) { BM_elem_select_set(bm, l->e, TRUE); diff --git a/source/blender/editors/mesh/loopcut.c b/source/blender/editors/mesh/loopcut.c index bbc495706ac..59151cf107c 100644 --- a/source/blender/editors/mesh/loopcut.c +++ b/source/blender/editors/mesh/loopcut.c @@ -161,7 +161,7 @@ static void edgering_find_order(BMEditMesh *em, BMEdge *lasteed, BMEdge *eed, return; } - l2 = BM_face_other_loop(l->f, l->e, eed->v1); + l2 = BM_face_other_edge_loop(l->f, l->e, 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/transform/transform.c b/source/blender/editors/transform/transform.c index 8d2d4c462d2..dc012619ba4 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -4310,7 +4310,7 @@ static BMLoop *get_next_loop(BMesh *UNUSED(bm), BMVert *v, BMLoop *l, firstl = l; do { - l = BM_face_other_loop(l->f, l->e, v); + l = BM_face_other_edge_loop(l->f, l->e, v); if (l->radial_next == l) return NULL; @@ -4339,12 +4339,12 @@ static BMLoop *get_next_loop(BMesh *UNUSED(bm), BMVert *v, BMLoop *l, i += 1; } - if (BM_face_other_loop(l->f, l->e, v)->e == nexte) { + if (BM_face_other_edge_loop(l->f, l->e, v)->e == nexte) { if (i) mul_v3_fl(a, 1.0f / (float)i); copy_v3_v3(vec, a); - return BM_face_other_loop(l->f, l->e, v); + return BM_face_other_edge_loop(l->f, l->e, v); } l = l->radial_next; @@ -4477,11 +4477,11 @@ static int createSlideVerts(TransInfo *t) l1 = e->l; l2 = e->l->radial_next; - l = BM_face_other_loop(l1->f, l1->e, v); + l = BM_face_other_edge_loop(l1->f, l1->e, v); sub_v3_v3v3(vec, BM_edge_other_vert(l->e, v)->co, v->co); if (l2 != l1) { - l = BM_face_other_loop(l2->f, l2->e, v); + l = BM_face_other_edge_loop(l2->f, l2->e, v); sub_v3_v3v3(vec2, BM_edge_other_vert(l->e, v)->co, v->co); } else { l2 = NULL; @@ -4498,11 +4498,11 @@ static int createSlideVerts(TransInfo *t) if (l2) copy_v3_v3(sv->downvec, vec2); - l = BM_face_other_loop(l1->f, l1->e, v); + l = BM_face_other_edge_loop(l1->f, l1->e, v); sv->up = BM_edge_other_vert(l->e, v); if (l2) { - l = BM_face_other_loop(l2->f, l2->e, v); + l = BM_face_other_edge_loop(l2->f, l2->e, v); sv->down = BM_edge_other_vert(l->e, v); } @@ -4517,12 +4517,12 @@ static int createSlideVerts(TransInfo *t) sv->v = v; sv->origvert = *v; - l = BM_face_other_loop(l1->f, l1->e, v); + l = BM_face_other_edge_loop(l1->f, l1->e, 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_loop(l2->f, l2->e, v); + l = BM_face_other_edge_loop(l2->f, l2->e, 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 8f9d32f0899..06309293f9a 100644 --- a/source/blender/editors/util/crazyspace.c +++ b/source/blender/editors/util/crazyspace.c @@ -153,7 +153,7 @@ void crazyspace_set_quats_editmesh(BMEditMesh *em, float *origcos, float *mapped continue; BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_VERT, v) { - BMLoop *l2 = BM_face_other_loop(l->f, l->e, v); + BMLoop *l2 = BM_face_other_edge_loop(l->f, l->e, v); /* retrieve mapped coordinates */ v1= mappedcos + 3*BM_elem_index_get(l->v); |