diff options
author | Antonioya <blendergit@gmail.com> | 2019-07-18 19:07:56 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2019-07-19 16:22:42 +0300 |
commit | 65aac86d5a35b23eabf30379c7a44b04860c7b2f (patch) | |
tree | 06151af15047e7253cc1a39848bd0b28f3cf6a37 /source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c | |
parent | 23ea4b56adab66dbc0aa8c095c49c8f2e6a5d92b (diff) |
GPencil: Fix wrong material when apply Opacity, Hue or Tint modifier
When apply the modifier a new material is created, but it was assigned wrongly. The problem was the index was base 0 already, so subtract 1, got a wrong value.
Diffstat (limited to 'source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c')
-rw-r--r-- | source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c b/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c index bdab4c083e9..5b5290dc0ff 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c @@ -192,9 +192,8 @@ void gpencil_apply_modifier_material( BLI_ghash_insert(gh_color, mat->id.name, newmat); DEG_id_tag_update(&newmat->id, ID_RECALC_COPY_ON_WRITE); } - /* Reaasign color index. */ - int idx = BKE_gpencil_object_material_get_index(ob, newmat); - gps->mat_nr = idx - 1; + /* Reassign color index. */ + gps->mat_nr = BKE_gpencil_object_material_get_index(ob, newmat); } else { /* reuse existing color (but update only first time) */ |