From df201548ead1ef341e18c003661d136fdce8eca9 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Wed, 27 Jun 2012 15:39:14 +0000 Subject: [PATCH] Utility function to get the first loop of a vert. Behaves identical to the iterator initialization function. --- source/blender/bmesh/intern/bmesh_queries.c | 11 +++++++++++ source/blender/bmesh/intern/bmesh_queries.h | 1 + 2 files changed, 12 insertions(+) diff --git a/source/blender/bmesh/intern/bmesh_queries.c b/source/blender/bmesh/intern/bmesh_queries.c index 3ec4c51bcb1..ce4ce87b31f 100644 --- a/source/blender/bmesh/intern/bmesh_queries.c +++ b/source/blender/bmesh/intern/bmesh_queries.c @@ -189,6 +189,17 @@ BMLoop *BM_loop_other_vert_loop(BMLoop *l, BMVert *v) #endif } +/** + * Get the first loop of a vert. Uses the same initialization code for the first loop of the + * iterator API + */ + +BMLoop *BM_vert_find_first_loop(BMVert *v) +{ + BMEdge *e = bmesh_disk_faceedge_find_first(v->e, v); + return bmesh_radial_faceloop_find_first(e->l, v); +} + /** * Returns TRUE if the vertex is used in a given face. */ diff --git a/source/blender/bmesh/intern/bmesh_queries.h b/source/blender/bmesh/intern/bmesh_queries.h index 2df5adcfae3..36ffc296759 100644 --- a/source/blender/bmesh/intern/bmesh_queries.h +++ b/source/blender/bmesh/intern/bmesh_queries.h @@ -42,6 +42,7 @@ BMVert *BM_edge_other_vert(BMEdge *e, BMVert *v); BMLoop *BM_face_other_edge_loop(BMFace *f, BMEdge *e, BMVert *v); BMLoop *BM_face_other_vert_loop(BMFace *f, BMVert *v_prev, BMVert *v); BMLoop *BM_loop_other_vert_loop(BMLoop *l, BMVert *v); +BMLoop *BM_vert_find_first_loop(BMVert *v); int BM_vert_edge_count_nonwire(BMVert *v); int BM_vert_edge_count(BMVert *v);