[Bf-blender-cvs] [3c74968] master: Remove old multipaint related argument from wpaint_blend.

Alexander Gavrilov noreply at git.blender.org
Wed Jan 20 22:35:42 CET 2016


Commit: 3c74968aa461ec986190d3197cb3517851ac98be
Author: Alexander Gavrilov
Date:   Tue Jan 19 15:17:13 2016 +0300
Branches: master
https://developer.blender.org/rB3c74968aa461ec986190d3197cb3517851ac98be

Remove old multipaint related argument from wpaint_blend.

With multipaint based on collective weight there is no need for this.

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

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 78363ef..5296b8b 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -925,7 +925,7 @@ static float wpaint_blend_tool(const int tool,
 static float wpaint_blend(VPaint *wp, float weight, float weight_prev,
                           const float alpha, float paintval,
                           const float brush_alpha_value,
-                          const short do_flip, const short do_multipaint_totsel)
+                          const short do_flip)
 {
 	Brush *brush = BKE_paint_brush(&wp->paint);
 	int tool = brush->vertexpaint_tool;
@@ -947,25 +947,20 @@ static float wpaint_blend(VPaint *wp, float weight, float weight_prev,
 	
 	weight = wpaint_blend_tool(tool, weight, paintval, alpha);
 
-	/* delay clamping until the end so multi-paint can function when the active group is at the limits */
-	if (do_multipaint_totsel == false) {
-		CLAMP(weight, 0.0f, 1.0f);
-	}
+	CLAMP(weight, 0.0f, 1.0f);
 	
 	/* if no spray, clip result with orig weight & orig alpha */
 	if ((wp->flag & VP_SPRAY) == 0) {
-		if (do_multipaint_totsel == false) {
-			float testw = wpaint_blend_tool(tool, weight_prev, paintval, brush_alpha_value);
+		float testw = wpaint_blend_tool(tool, weight_prev, paintval, brush_alpha_value);
 
-			CLAMP(testw, 0.0f, 1.0f);
-			if (testw < weight_prev) {
-				if (weight < testw) weight = testw;
-				else if (weight > weight_prev) weight = weight_prev;
-			}
-			else {
-				if (weight > testw) weight = testw;
-				else if (weight < weight_prev) weight = weight_prev;
-			}
+		CLAMP(testw, 0.0f, 1.0f);
+		if (testw < weight_prev) {
+			if (weight < testw) weight = testw;
+			else if (weight > weight_prev) weight = weight_prev;
+		}
+		else {
+			if (weight > testw) weight = testw;
+			else if (weight < weight_prev) weight = weight_prev;
 		}
 	}
 
@@ -1556,7 +1551,7 @@ static void do_weight_paint_vertex_single(
 
 	{
 		dw->weight = wpaint_blend(wp, dw->weight, dw_prev->weight, alpha, paintweight,
-		                          wpi->brush_alpha_value, wpi->do_flip, false);
+		                          wpi->brush_alpha_value, wpi->do_flip);
 
 		/* WATCH IT: take care of the ordering of applying mirror -> normalize,
 		 * can give wrong results [#26193], least confusing if normalize is done last */
@@ -1651,7 +1646,7 @@ static void do_weight_paint_vertex_multi(
 		return;
 	}
 
-	neww = wpaint_blend(wp, curw, oldw, alpha, paintweight, wpi->brush_alpha_value, wpi->do_flip, false);
+	neww = wpaint_blend(wp, curw, oldw, alpha, paintweight, wpi->brush_alpha_value, wpi->do_flip);
 
 	change = neww / curw;




More information about the Bf-blender-cvs mailing list