diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-05-11 17:18:08 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-05-11 17:28:15 +0300 |
commit | d63956d0e51c1b5a65941b918d0e055b1c14fa4b (patch) | |
tree | 1824ff8bb76f0fe2b50a33927f01a4f4ae6178ad /source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c | |
parent | 870e081bcda7f8fd99f73366d22bdf372c09f054 (diff) |
GPencil: Replace material name with material pointer for Modifiers filter
Before, the material name was used to filter the effect of the stroke, but after the last changes in the ID code, now it's not working.
After talking with @severin, we agreed to replace the material name with a pointer. Also, this fix a design issue when the materials were linked.
Related to T76594
Differential Revision: https://developer.blender.org/D7681 with some minor changes
Diffstat (limited to 'source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c')
-rw-r--r-- | source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c b/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c index f7b51b08c44..f7929b58650 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c @@ -79,7 +79,7 @@ void gpencil_modifier_type_init(GpencilModifierTypeInfo *types[]) /* verify if valid layer, material and pass index */ bool is_stroke_affected_by_modifier(Object *ob, char *mlayername, - char *mmaterialname, + Material *material, const int mpassindex, const int gpl_passindex, const int minpoints, @@ -106,15 +106,15 @@ bool is_stroke_affected_by_modifier(Object *ob, } } } - /* omit if filter by material */ - if (mmaterialname[0] != '\0') { + /* Omit if filter by material. */ + if (material != NULL) { if (inv4 == false) { - if (!STREQ(mmaterialname, ma->id.name + 2)) { + if (material != ma) { return false; } } else { - if (STREQ(mmaterialname, ma->id.name + 2)) { + if (material == ma) { return false; } } |