[Bf-blender-cvs] [8239b07a536] greasepencil-object: GPencil: Use decay color in modifier

Antonio Vazquez noreply at git.blender.org
Tue Nov 5 19:52:04 CET 2019


Commit: 8239b07a5360f29b88b1fd8335699c27116ff986
Author: Antonio Vazquez
Date:   Tue Nov 5 19:51:21 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB8239b07a5360f29b88b1fd8335699c27116ff986

GPencil: Use decay color in modifier

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

M	release/scripts/startup/bl_ui/properties_data_modifier.py
M	source/blender/gpencil_modifiers/intern/MOD_gpencilvertexcolor.c

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

diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index d9b6830e2f1..8774bb0a9c7 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -2363,7 +2363,7 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel):
         col.separator()
         col.prop(md, "radius")
         col.prop(md, "factor", slider=True)
-        col.prop(md, "use_decay_color")
+        col.prop(md, "use_decay_color", text="Decay color with distance")
 
         col.separator()
         col.label(text="Colors:")
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilvertexcolor.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilvertexcolor.c
index 17a0a2046fc..46748b72468 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilvertexcolor.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilvertexcolor.c
@@ -175,7 +175,11 @@ static void deformStroke(GpencilModifierData *md,
       BKE_colorband_evaluate(mmd->colorband, mix_factor, coba_res);
 
       interp_v3_v3v3(pt->mix_color, pt->mix_color, coba_res, mmd->factor * weight);
-      pt->mix_color[3] = mmd->factor * (1.0f - mix_factor);
+      pt->mix_color[3] = mmd->factor;
+      /* Apply Decay. */
+      if (mmd->flag & GP_VERTEXCOL_DECAY_COLOR) {
+        pt->mix_color[3] *= (1.0f - mix_factor);
+      }
     }
   }
 }



More information about the Bf-blender-cvs mailing list