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.
This commit is contained in:
@@ -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) */
|
||||
|
Reference in New Issue
Block a user