[Bf-blender-cvs] [db3441c8c5c] soc-2017-vertex_paint: finalised 1 = white and 0 = black for weight to vertex converter

Darshan Kadu noreply at git.blender.org
Sat Jul 1 09:02:11 CEST 2017


Commit: db3441c8c5c6526162bc850d3514c86e3b27ebdd
Author: Darshan Kadu
Date:   Sat Jul 1 12:29:50 2017 +0530
Branches: soc-2017-vertex_paint
https://developer.blender.org/rBdb3441c8c5c6526162bc850d3514c86e3b27ebdd

finalised 1 = white and 0 = black for weight to vertex converter

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

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 24ef4fd6315..7be6a18e4d8 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -4612,9 +4612,10 @@ static bool weight_to_vert_convert(bContext *C)
 		do{
 			unsigned int vidx = me->mloop[mp->loopstart + j].v;
 			const float weight = defvert_find_weight(&me->dvert[vidx], vgroup_active);
-			lcol->r = (-1.0f * weight +1) * 255;
-			lcol->b = (-1.0f * weight + 1) * 255;
-			lcol->g = (-1.0f * weight + 1) * 255;
+			const char grayscale = weight * 255;
+			lcol->r = grayscale;
+			lcol->b = grayscale;
+			lcol->g = grayscale;
 			lcol++;
 			j++;
 		} while (j <= mp->totloop - 1);




More information about the Bf-blender-cvs mailing list