[Bf-blender-cvs] [ccc7ebf7b1b] master: Fix T65408: GPencil Weight Paint, strength and falloff are ignored when painting a lesser vertexweight
Antonio Vazquez
noreply at git.blender.org
Mon Jun 3 10:00:44 CEST 2019
Commit: ccc7ebf7b1bb5ba422efc8112d2c586a0b80af92
Author: Antonio Vazquez
Date: Mon Jun 3 09:58:48 2019 +0200
Branches: master
https://developer.blender.org/rBccc7ebf7b1bb5ba422efc8112d2c586a0b80af92
Fix T65408: GPencil Weight Paint, strength and falloff are ignored when painting a lesser vertexweight
The value was clamped to minimum value before checking the influence.
===================================================================
M source/blender/editors/gpencil/gpencil_brush.c
===================================================================
diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c
index 915af337b86..7e871e03b99 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -922,17 +922,21 @@ static bool gp_brush_weight_apply(
float curweight = dw ? dw->weight : 0.0f;
if (gp_brush_invert_check(gso)) {
- /* reduce weight */
- curweight -= inf;
+ /* reduce weight (verify mainimum target) */
+ if (curweight - inf < gso->gp_brush->weight) {
+ curweight = gso->gp_brush->weight;
+ }
+ else {
+ curweight -= inf;
+ }
}
else {
/* increase weight */
curweight += inf;
+ /* verify maximum target weight */
+ CLAMP_MAX(curweight, gso->gp_brush->weight);
}
- /* verify target weight */
- CLAMP_MAX(curweight, gso->gp_brush->weight);
-
CLAMP(curweight, 0.0f, 1.0f);
if (dw) {
dw->weight = curweight;
More information about the Bf-blender-cvs
mailing list