[Bf-blender-cvs] [550c3c2] master: Dyntopo: avoid over-counting /w neighbor average

Campbell Barton noreply at git.blender.org
Sun Apr 19 08:06:19 CEST 2015


Commit: 550c3c2c1ec6fb3ad064a59cfd23f2472766a4d2
Author: Campbell Barton
Date:   Sun Apr 19 14:42:54 2015 +1000
Branches: master
https://developer.blender.org/rB550c3c2c1ec6fb3ad064a59cfd23f2472766a4d2

Dyntopo: avoid over-counting /w neighbor average

===================================================================

M	source/blender/editors/sculpt_paint/sculpt.c

===================================================================

diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 8efd6ab..b0f4cf0 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++;
 				}




More information about the Bf-blender-cvs mailing list