[Bf-blender-cvs] [5f7de54243f] master: Fix T52639: Weight paint smooth tool crash

Campbell Barton noreply at git.blender.org
Thu Sep 7 05:13:27 CEST 2017


Commit: 5f7de54243f0a07b080d01122bd982af78e4201b
Author: Campbell Barton
Date:   Thu Sep 7 13:20:39 2017 +1000
Branches: master
https://developer.blender.org/rB5f7de54243f0a07b080d01122bd982af78e4201b

Fix T52639: Weight paint smooth tool crash

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

M	source/blender/editors/object/object_vgroup.c

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

diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index 1ae3961360c..d9ad037daea 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -1798,10 +1798,11 @@ static void vgroup_smooth_subset(
 	}
 	else {
 		for (int i = 0; i < dvert_tot; i++) {
-			MVert *v = &me->mvert[i];
+			const MVert *v = &me->mvert[i];
 			if (v->flag & SELECT) {
 				for (int j = 0; j < emap[i].count; j++) {
-					MVert *v_other = &me->mvert[emap[i].indices[j]];
+					const MEdge *e = &me->medge[emap[i].indices[j]];
+					const MVert *v_other = &me->mvert[(e->v1 == i) ? e->v2 : e->v1];
 					if ((source == WEIGHT_SMOOTH_ALL) ||
 					    (source == ((v_other->flag & SELECT) != 0)))
 					{



More information about the Bf-blender-cvs mailing list