diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2016-04-17 16:08:46 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2016-04-17 16:08:46 +0300 |
commit | a85c9b241af2c37905072caa77b0f17f941a233d (patch) | |
tree | 2c5eb1f32460711725a56777d9888896c2041497 /source/blender/bmesh/intern/bmesh_strands.c | |
parent | 07221e980b8b6899ccb0d145210c699b4fca175c (diff) |
Corrected implementation of the strand relaxation method ported from particles.
This is still the same algorithm as in particle edit mode, but cleaned up
some unnecessary complications and use much more meaningful variable names.
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_strands.c')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_strands.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/bmesh/intern/bmesh_strands.c b/source/blender/bmesh/intern/bmesh_strands.c index ec1b7781dd6..87477716562 100644 --- a/source/blender/bmesh/intern/bmesh_strands.c +++ b/source/blender/bmesh/intern/bmesh_strands.c @@ -116,6 +116,19 @@ int BM_strands_keys_count(BMVert *root) return count; } +int BM_strands_keys_count_max(BMesh *bm) +{ + BMVert *v; + BMIter iter; + int maxkeys = 0; + BM_ITER_STRANDS(v, &iter, bm, BM_STRANDS_OF_MESH) { + int n = BM_strands_keys_count(v); + if (n > maxkeys) + maxkeys = n; + } + return maxkeys; +} + /* ------------------------------------------------------------------------- */ /* Create a new strand */ |