diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-04-19 07:42:54 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-04-19 07:46:32 +0300 |
commit | 550c3c2c1ec6fb3ad064a59cfd23f2472766a4d2 (patch) | |
tree | 59e49eef786ed34aebd425daf794b952356f5828 | |
parent | 2448c21cb365af0afc22008953f4ebe08de7cb0f (diff) |
Dyntopo: avoid over-counting /w neighbor average
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 8efd6ab3fbe..b0f4cf062f6 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -1232,7 +1232,8 @@ static float neighbor_average_mask(SculptSession *ss, unsigned vert) /* Same logic as neighbor_average(), but for bmesh rather than mesh */ static void bmesh_neighbor_average(float avg[3], BMVert *v) { - const int vfcount = BM_vert_face_count(v); + /* logic for 3 or more is identical */ + const int vfcount = BM_vert_face_count_ex(v, 3); /* Don't modify corner vertices */ if (vfcount > 1) { @@ -1247,7 +1248,7 @@ static void bmesh_neighbor_average(float avg[3], BMVert *v) for (i = 0; i < ARRAY_SIZE(adj_v); i++) { const BMVert *v_other = adj_v[i]; - if (vfcount != 2 || BM_vert_face_count(v_other) <= 2) { + if (vfcount != 2 || BM_vert_face_count_ex(v_other, 2) <= 2) { add_v3_v3(avg, v_other->co); total++; } |