[Bf-blender-cvs] [56bae9ec3e9] greasepencil-object: GPencil: Use Fill Vertex Color mix in Fill

Antonio Vazquez noreply at git.blender.org
Mon Nov 4 11:03:56 CET 2019


Commit: 56bae9ec3e9247a4eb5eb5cb8a304c2c8b29bc63
Author: Antonio Vazquez
Date:   Mon Nov 4 11:03:47 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB56bae9ec3e9247a4eb5eb5cb8a304c2c8b29bc63

GPencil: Use Fill Vertex Color mix in Fill

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

M	source/blender/draw/engines/gpencil/gpencil_draw_utils.c
M	source/blender/makesdna/DNA_gpencil_types.h
M	source/blender/makesrna/intern/rna_gpencil.c

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index a74cdb8f09a..a71f5f5627c 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -996,6 +996,9 @@ static void gpencil_add_fill_vertexdata(GpencilBatchCache *cache,
       if (cache->is_dirty) {
         const float *color;
         if (!onion) {
+          /* Apply the mix color of the fill. */
+          interp_v3_v3v3(tfill, tfill, gps->mix_color_fill, gps->mix_color_fill[3]);
+
           color = tfill;
         }
         else {
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index 9e20dd7218a..86d86c813ce 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -225,6 +225,9 @@ typedef struct bGPDstroke {
   float gradient_s[2];
   char _pad_3[4];
 
+  /** Vertex mix color for Fill (one for all stroke). */
+  float mix_color_fill[4];
+
   /** UV rotation */
   float uv_rotation;
   /** UV translation (X and Y axis) */
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index d37b52bed75..d2e1781308a 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -1176,6 +1176,16 @@ static void rna_def_gpencil_stroke(BlenderRNA *brna)
   RNA_def_property_ui_text(prop, "UV Scale", "Scale of the UV");
   RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
   RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_uv_update");
+
+  /* Mix Vertex Color for Fill. */
+  prop = RNA_def_property(srna, "mix_color_fill", PROP_FLOAT, PROP_COLOR_GAMMA);
+  RNA_def_property_float_sdna(prop, NULL, "mix_color_fill");
+  RNA_def_property_array(prop, 4);
+  RNA_def_property_range(prop, 0.0f, 1.0f);
+  RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+  RNA_def_property_ui_text(
+      prop, "Mix Fill Color", "Color used to mix with fill color to get final color");
+  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
 }
 
 static void rna_def_gpencil_strokes_api(BlenderRNA *brna, PropertyRNA *cprop)



More information about the Bf-blender-cvs mailing list