[Bf-blender-cvs] [c6ac861c066] greasepencil-refactor: GPencil: Refactor: Fix gradient behavior in texture color mode

Clément Foucault noreply at git.blender.org
Sat Jan 11 20:28:18 CET 2020


Commit: c6ac861c066b1291045c288fa1a740979a179eaa
Author: Clément Foucault
Date:   Sat Jan 11 20:28:03 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rBc6ac861c066b1291045c288fa1a740979a179eaa

GPencil: Refactor: Fix gradient behavior in texture color mode

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

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

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_data.c b/source/blender/draw/engines/gpencil/gpencil_draw_data.c
index 11dedd1d038..70404bcbf6d 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_data.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_data.c
@@ -174,11 +174,15 @@ static MaterialGPencilStyle *gpencil_viewport_material_overrides(GPENCIL_Private
         copy_v4_fl(gp_style->stroke_rgba, 1.0f);
         gp_style->mix_stroke_factor = 0.0f;
       }
-      if (((gp_style->fill_style == GP_MATERIAL_FILL_STYLE_TEXTURE) && (gp_style->ima)) ||
-          (gp_style->fill_style == GP_MATERIAL_FILL_STYLE_GRADIENT)) {
+
+      if ((gp_style->fill_style == GP_MATERIAL_FILL_STYLE_TEXTURE) && (gp_style->ima)) {
         copy_v4_fl(gp_style->fill_rgba, 1.0f);
         gp_style->mix_factor = 0.0f;
       }
+      else if (gp_style->fill_style == GP_MATERIAL_FILL_STYLE_GRADIENT) {
+        /* gp_style->fill_rgba is needed for correct gradient. */
+        gp_style->mix_factor = 0.0f;
+      }
       break;
     case V3D_SHADING_RANDOM_COLOR:
       gp_style = &gp_style_tmp;



More information about the Bf-blender-cvs mailing list