Dyntopo: avoid over-counting /w neighbor average

This commit is contained in:
Campbell Barton 2015-04-19 14:42:54 +10:00
parent 2448c21cb3
commit 550c3c2c1e
1 changed files with 3 additions and 2 deletions

View File

@ -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++;
}