[Bf-blender-cvs] [f2017083a19] soc-2017-vertex_paint: vertex mask selection works with tool fill now

Darshan Kadu noreply at git.blender.org
Mon Aug 14 19:50:42 CEST 2017


Commit: f2017083a19e5c83aadc575625dce0642ffce6c5
Author: Darshan Kadu
Date:   Mon Aug 14 23:18:06 2017 +0530
Branches: soc-2017-vertex_paint
https://developer.blender.org/rBf2017083a19e5c83aadc575625dce0642ffce6c5

vertex mask selection works with tool fill now

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

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

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

diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 3a499966893..d7845f80b46 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -329,17 +329,26 @@ bool ED_vpaint_fill(Object *ob, unsigned int paintcol)
 	}
 
 	const bool use_face_sel = (me->editflag & ME_EDIT_PAINT_FACE_SEL) != 0;
+	const bool use_vert_sel = (me->editflag & ME_EDIT_PAINT_VERT_SEL) != 0;
 
 	mp = me->mpoly;
 	for (i = 0; i < me->totpoly; i++, mp++) {
-		MLoopCol *lcol = me->mloopcol + mp->loopstart;
+		MLoopCol *lcol = &me->mloopcol[mp->loopstart];
 
 		if (use_face_sel && !(mp->flag & ME_FACE_SEL))
 			continue;
 
-		for (j = 0; j < mp->totloop; j++, lcol++) {
-			*(int *)lcol = paintcol;
-		}
+		j = 0;
+		do {
+			unsigned int vidx = me->mloop[mp->loopstart + j].v;
+			const bool v_flag = me->mvert[vidx].flag;
+			if (v_flag || !use_vert_sel) {
+				*(int *)lcol = paintcol;
+			}
+			lcol++;
+			j++;
+		} while (j <= mp->totloop - 1);
+
 	}
 	
 	/* remove stale me->mcol, will be added later */




More information about the Bf-blender-cvs mailing list