diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2014-12-04 16:02:27 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2015-04-20 13:23:14 +0300 |
commit | b2ea8c1022565f1b5e99bf35033b76117c7c685e (patch) | |
tree | 9c061a70e766249094e09f56f8ebc000615bc709 /source/blender/bmesh/intern/bmesh_strands.h | |
parent | 339a8b7521555ac9bd432405cae18e20298bec1d (diff) |
Added back different selection modes (strands, verts, tips) for hair
editing.
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_strands.h')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_strands.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/bmesh/intern/bmesh_strands.h b/source/blender/bmesh/intern/bmesh_strands.h index 96d5fa9f8aa..8410bfd8443 100644 --- a/source/blender/bmesh/intern/bmesh_strands.h +++ b/source/blender/bmesh/intern/bmesh_strands.h @@ -51,6 +51,24 @@ BLI_INLINE bool BM_strands_vert_is_root(BMVert *v) return false; } +/* True if v is the tip of a strand */ +BLI_INLINE bool BM_strands_vert_is_tip(BMVert *v) +{ + BMEdge *e_first = v->e; + BMEdge *e_next; + + e_next = bmesh_disk_edge_next(e_first, v); + + /* with a single edge, the vertex is either first or last of the curve; + * last vertex is defined as the tip + */ + if (e_next == e_first) { + if (e_first->v2 == v) + return true; + } + return false; +} + int BM_strands_count(BMesh *bm); int BM_strands_keys_count(BMVert *root); |