[Bf-blender-cvs] [621e3d46c18] greasepencil-object: GPencil: Use Vertex Color in Tint modifier
Antonio Vazquez
noreply at git.blender.org
Tue Nov 5 15:38:57 CET 2019
Commit: 621e3d46c18f5dbfe75eac678b02eda1b0e94069
Author: Antonio Vazquez
Date: Tue Nov 5 15:34:58 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB621e3d46c18f5dbfe75eac678b02eda1b0e94069
GPencil: Use Vertex Color in Tint modifier
===================================================================
M source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c
===================================================================
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c b/source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c
index f03bc489521..dfc83c1fb3d 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c
@@ -113,6 +113,22 @@ static void deformStroke(GpencilModifierData *md,
CLAMP(pt->strength, 0.0f, 1.0f);
}
}
+
+ /* Apply to mix color. */
+ float mixfac = mmd->factor;
+ CLAMP(mixfac, 0.0, 1.0f);
+ /* Fill */
+ if (mmd->modify_color != GP_MODIFY_COLOR_STROKE) {
+ interp_v3_v3v3(gps->mix_color_fill, gps->mix_color_fill, mmd->rgb, mixfac);
+ }
+
+ /* Stroke */
+ if (mmd->modify_color != GP_MODIFY_COLOR_FILL) {
+ for (int i = 0; i < gps->totpoints; i++) {
+ bGPDspoint *pt = &gps->points[i];
+ interp_v3_v3v3(pt->mix_color, pt->mix_color, mmd->rgb, mixfac);
+ }
+ }
}
static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData *md, Object *ob)
More information about the Bf-blender-cvs
mailing list