[Bf-blender-cvs] [a4721c05040] master: Weight Paint: blend smear tool

Campbell Barton noreply at git.blender.org
Tue Oct 3 14:21:11 CEST 2017


Commit: a4721c05040fce606d6c6ccc4ea91bdf6c8846e8
Author: Campbell Barton
Date:   Tue Oct 3 23:35:30 2017 +1100
Branches: master
https://developer.blender.org/rBa4721c05040fce606d6c6ccc4ea91bdf6c8846e8

Weight Paint: blend smear tool

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

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 ce232030819..57fe8cab712 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -1697,7 +1697,7 @@ static void do_wpaint_brush_smear_task_cb_ex(
 						}
 						/* Apply weight to vertex */
 						if (do_color) {
-							const float brush_fade = BKE_brush_curve_strength(brush, 0.0f, cache->radius);
+							const float brush_fade = BKE_brush_curve_strength(brush, sqrtf(test.dist), cache->radius);
 							const float final_alpha =
 							        brush_fade * brush_strength *
 							        grid_alpha * brush_alpha_pressure;
@@ -2804,6 +2804,10 @@ static void do_vpaint_brush_smear_task_cb_ex(
 						}
 
 						if (do_color) {
+							const float final_alpha =
+							        255 * brush_fade * brush_strength *
+							        brush_alpha_pressure * grid_alpha;
+
 							/* For each poly owning this vert, paint each loop belonging to this vert. */
 							for (int j = 0; j < gmap->vert_to_poly[v_index].count; j++) {
 								const int p_index = gmap->vert_to_poly[v_index].indices[j];
@@ -2820,9 +2824,6 @@ static void do_vpaint_brush_smear_task_cb_ex(
 										}
 										color_orig = ss->mode.vpaint.previous_color[l_index];
 									}
-									const float final_alpha =
-									        255 * brush_fade * brush_strength *
-									        brush_alpha_pressure * grid_alpha;
 									/* Mix the new color with the original
 									 * based on the brush strength and the curve. */
 									lcol[l_index] = vpaint_blend(



More information about the Bf-blender-cvs mailing list