[Bf-blender-cvs] [46ccd9efacf] greasepencil-refactor: GPencil: Fix error in convert to Vertex Color

Antonio Vazquez noreply at git.blender.org
Sun Jan 19 17:20:29 CET 2020


Commit: 46ccd9efacf6391e2a19b983587210b1dc7263ba
Author: Antonio Vazquez
Date:   Sun Jan 19 17:19:35 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB46ccd9efacf6391e2a19b983587210b1dc7263ba

GPencil: Fix error in convert to Vertex Color

It was not checking if the alpha of tha material was > 0 to detect if Fill and/or Stroke material.

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

M	source/blender/editors/gpencil/gpencil_vertex_ops.c

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

diff --git a/source/blender/editors/gpencil/gpencil_vertex_ops.c b/source/blender/editors/gpencil/gpencil_vertex_ops.c
index 27ff463ee67..6c1a04abcbd 100644
--- a/source/blender/editors/gpencil/gpencil_vertex_ops.c
+++ b/source/blender/editors/gpencil/gpencil_vertex_ops.c
@@ -713,8 +713,10 @@ static int gp_material_to_vertex_exec(bContext *C, wmOperator *op)
           continue;
         }
 
-        bool use_stroke = (gp_style->flag & GP_MATERIAL_STROKE_SHOW);
-        bool use_fill = (gp_style->flag & GP_MATERIAL_FILL_SHOW);
+        bool use_stroke = ((gp_style->flag & GP_MATERIAL_STROKE_SHOW) &&
+                           (gp_style->stroke_rgba[3] > 0.0f));
+        bool use_fill = ((gp_style->flag & GP_MATERIAL_FILL_SHOW) &&
+                         (gp_style->fill_rgba[3] > 0.0f));
         bool is_stencil = ((gp_style->stroke_style == GP_MATERIAL_STROKE_STYLE_TEXTURE) &&
                            (gp_style->flag & GP_MATERIAL_STROKE_PATTERN));
         /* Material is disabled. */



More information about the Bf-blender-cvs mailing list