Commit: 44ac03785c520e2ecf4fe1cb607693958f6d26a9 Author: Antonio Vazquez Date: Tue Jan 11 22:45:21 2022 +0100 Branches: blender-v3.0-release https://developer.blender.org/rB44ac03785c520e2ecf4fe1cb607693958f6d26a9
Fix T94799: GPencil Strokes drawn at 0.0 Strength still visible There was a clamp with a value greater than 0. =================================================================== M source/blender/editors/gpencil/gpencil_paint.c =================================================================== diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 333ae60e84b..4da1a8c34da 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -830,7 +830,7 @@ static short gpencil_stroke_addpoint(tGPsdata *p, /* color strength */ if (brush_settings->flag & GP_BRUSH_USE_STRENGTH_PRESSURE) { pt->strength *= BKE_curvemapping_evaluateF(brush_settings->curve_strength, 0, pressure); - CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f); + CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, brush_settings->draw_strength), 1.0f); } /* Set vertex colors for buffer. */ @@ -924,6 +924,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p) tGPspoint *ptc; MDeformVert *dvert = NULL; Brush *brush = p->brush; + BrushGpencilSettings *brush_settings = brush->gpencil_settings; ToolSettings *ts = p->scene->toolsettings; Depsgraph *depsgraph = p->depsgraph; Object *obact = (Object *)p->ownerPtr.data; @@ -1012,7 +1013,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p) /* copy pressure and time */ pt->pressure = ptc->pressure; pt->strength = ptc->strength; - CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f); + CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, brush_settings->draw_strength), 1.0f); copy_v4_v4(pt->vert_color, ptc->vert_color); pt->time = ptc->time; /* Apply the vertex color to point. */ @@ -1046,7 +1047,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p) /* copy pressure and time */ pt->pressure = ptc->pressure; pt->strength = ptc->strength; - CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f); + CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, brush_settings->draw_strength), 1.0f); pt->time = ptc->time; /* Apply the vertex color to point. */ ED_gpencil_point_vertex_color_set(ts, brush, pt, ptc); @@ -1169,7 +1170,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p) /* copy pressure and time */ pt->pressure = ptc->pressure; pt->strength = ptc->strength; - CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f); + CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, brush_settings->draw_strength), 1.0f); copy_v4_v4(pt->vert_color, ptc->vert_color); pt->time = ptc->time; pt->uv_fac = ptc->uv_fac; _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs