Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2012-06-27 19:39:14 +0400
committerAntony Riakiotakis <kalast@gmail.com>2012-06-27 19:39:14 +0400
commitdf201548ead1ef341e18c003661d136fdce8eca9 (patch)
treee99da54e87b667def715c08b4190cfe7666b1d8a /source/blender/bmesh
parent7518654a51f888ddc143bc10e4b8df1f9b7d2c3e (diff)
Utility function to get the first loop of a vert. Behaves identical to
the iterator initialization function.
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r--source/blender/bmesh/intern/bmesh_queries.c11
-rw-r--r--source/blender/bmesh/intern/bmesh_queries.h1
2 files changed, 12 insertions, 0 deletions
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
@@ -190,6 +190,17 @@ BMLoop *BM_loop_other_vert_loop(BMLoop *l, BMVert *v)
}
/**
+ * 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);