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.
This commit is contained in:
parent
23ea4b56ad
commit
65aac86d5a
|
@ -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) */
|
||||
|
|
Loading…
Reference in New Issue