[Bf-blender-cvs] [431b088] hair_immediate_fixes: Sanity check for strand root/tip checks, now supports single vertices.
Lukas Tönne
noreply at git.blender.org
Sat Dec 6 10:30:41 CET 2014
Commit: 431b08880b564b3628963924a8a96f64a562680e
Author: Lukas Tönne
Date: Sat Dec 6 10:29:49 2014 +0100
Branches: hair_immediate_fixes
https://developer.blender.org/rB431b08880b564b3628963924a8a96f64a562680e
Sanity check for strand root/tip checks, now supports single vertices.
===================================================================
M source/blender/bmesh/intern/bmesh_strands.h
===================================================================
diff --git a/source/blender/bmesh/intern/bmesh_strands.h b/source/blender/bmesh/intern/bmesh_strands.h
index 66284ee..a0b0cfb 100644
--- a/source/blender/bmesh/intern/bmesh_strands.h
+++ b/source/blender/bmesh/intern/bmesh_strands.h
@@ -39,6 +39,8 @@ BLI_INLINE bool BM_strands_vert_is_root(BMVert *v)
BMEdge *e_first = v->e;
BMEdge *e_next;
+ if (!e_first)
+ return true; /* single vertex is both root and tip */
e_next = bmesh_disk_edge_next(e_first, v);
/* with a single edge, the vertex is either first or last of the curve;
@@ -57,6 +59,8 @@ BLI_INLINE bool BM_strands_vert_is_tip(BMVert *v)
BMEdge *e_first = v->e;
BMEdge *e_next;
+ if (!e_first)
+ return true; /* single vertex is both root and tip */
e_next = bmesh_disk_edge_next(e_first, v);
/* with a single edge, the vertex is either first or last of the curve;
More information about the Bf-blender-cvs
mailing list