diff options
author | Antonioya <blendergit@gmail.com> | 2018-11-20 20:11:42 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-11-20 20:12:04 +0300 |
commit | ec908beab321853e7d018d1d0b1450f4aef89a51 (patch) | |
tree | 5e51d299dc85e084855fc789dfae0376d6babd91 /source/blender/editors/gpencil/gpencil_brush.c | |
parent | 53d9ddf772be064bcde132b1f79ed2239f74b741 (diff) |
GP: New option to paint a predefined weight
Enabling this option, the weight is set to the predefined value and not the result of the sum of the paint actions.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_brush.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_brush.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c index 75b632238af..1710bd6be88 100644 --- a/source/blender/editors/gpencil/gpencil_brush.c +++ b/source/blender/editors/gpencil/gpencil_brush.c @@ -903,11 +903,21 @@ static bool gp_brush_weight_apply( if (gp_brush_invert_check(gso)) { /* reduce weight */ - curweight -= inf; + if (gso->settings->flag & GP_SCULPT_SETT_FLAG_PAINT_WEIGHT) { + curweight = 0.0f; + } + else { + curweight -= inf; + } } else { /* increase weight */ - curweight += inf; + if (gso->settings->flag & GP_SCULPT_SETT_FLAG_PAINT_WEIGHT) { + curweight = gso->gp_brush->strength; + } + else { + curweight += inf; + } } CLAMP(curweight, 0.0f, 1.0f); |