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:
@@ -192,9 +192,8 @@ void gpencil_apply_modifier_material(
|
|||||||
BLI_ghash_insert(gh_color, mat->id.name, newmat);
|
BLI_ghash_insert(gh_color, mat->id.name, newmat);
|
||||||
DEG_id_tag_update(&newmat->id, ID_RECALC_COPY_ON_WRITE);
|
DEG_id_tag_update(&newmat->id, ID_RECALC_COPY_ON_WRITE);
|
||||||
}
|
}
|
||||||
/* Reaasign color index. */
|
/* Reassign color index. */
|
||||||
int idx = BKE_gpencil_object_material_get_index(ob, newmat);
|
gps->mat_nr = BKE_gpencil_object_material_get_index(ob, newmat);
|
||||||
gps->mat_nr = idx - 1;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* reuse existing color (but update only first time) */
|
/* reuse existing color (but update only first time) */
|
||||||
|
Reference in New Issue
Block a user