From 3d8f1586973b1fbadf3cf45c66873d1a012764ee Mon Sep 17 00:00:00 2001 From: Matias Mendiola Date: Wed, 21 Aug 2019 08:30:45 +0200 Subject: GPencil: add new filter by material to modifiers This commit adds a new filter by material using the name and not only the index. Reviewers: antoniov, pepeland Differential Revision: https://developer.blender.org/D5544 --- source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to '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 d70d975c3a7..bfb2c62cef6 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c @@ -50,6 +50,7 @@ static void initData(GpencilModifierData *md) gpmd->pass_index = 0; gpmd->factor = 0.5f; gpmd->layername[0] = '\0'; + gpmd->materialname[0] = '\0'; ARRAY_SET_ITEMS(gpmd->rgb, 1.0f, 1.0f, 1.0f); gpmd->flag |= GP_TINT_CREATE_COLORS; gpmd->modify_color = GP_MODIFY_COLOR_BOTH; @@ -72,6 +73,7 @@ static void deformStroke(GpencilModifierData *md, if (!is_stroke_affected_by_modifier(ob, mmd->layername, + mmd->materialname, mmd->pass_index, mmd->layer_pass, 1, @@ -79,7 +81,8 @@ static void deformStroke(GpencilModifierData *md, gps, mmd->flag & GP_TINT_INVERT_LAYER, mmd->flag & GP_TINT_INVERT_PASS, - mmd->flag & GP_TINT_INVERT_LAYERPASS)) { + mmd->flag & GP_TINT_INVERT_LAYERPASS, + mmd->flag & GP_TINT_INVERT_MATERIAL)) { return; } -- cgit v1.2.3