[Bf-blender-cvs] [1c8d76772a8] blender-v2.81-release: GPencil: Fix unreported visual problem for short strokes

Antonio Vazquez noreply at git.blender.org
Sat Nov 2 11:13:57 CET 2019


Commit: 1c8d76772a84cb616c498ffbaf0a262086b0f8fa
Author: Antonio Vazquez
Date:   Sat Nov 2 11:13:44 2019 +0100
Branches: blender-v2.81-release
https://developer.blender.org/rB1c8d76772a84cb616c498ffbaf0a262086b0f8fa

GPencil: Fix unreported visual problem for short strokes

When the stroke has less than 3 points, but only the fill material is enabled, the stroke is invisible and makes the shaders to remove any fill because the shader start and end pointers are not correct.

Now, if the stroke has only fill, but it is not fillable, it is drawn with the stroke color to avoid the errors and these ghost strokes.

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

M	source/blender/draw/engines/gpencil/gpencil_draw_utils.c

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index bbbf85c0ace..f86881a2a94 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -1265,9 +1265,11 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache,
           gpencil_add_fill_vertexdata(
               cache, ob, gpl, gpf, gps, opacity, tintcolor, false, custonion);
         }
-        /* stroke */
-        /* No fill strokes, must show stroke always */
-        if (((gp_style->flag & GP_STYLE_STROKE_SHOW) || (gps->flag & GP_STROKE_NOFILL)) &&
+        /* stroke
+         * No fill strokes, must show stroke always or if the total points is lower than 3,
+         * because the stroke cannot be filled and it would be invisible. */
+        if (((gp_style->flag & GP_STYLE_STROKE_SHOW) || (gps->flag & GP_STROKE_NOFILL) ||
+             (gps->totpoints < 3)) &&
             ((gp_style->stroke_rgba[3] > GPENCIL_ALPHA_OPACITY_THRESH) ||
              (gpl->blend_mode == eGplBlendMode_Regular))) {
           /* recalc strokes uv (geometry can be changed by modifiers) */



More information about the Bf-blender-cvs mailing list