Fix T38161: Copy Material to Others causes incorrect viewport display if target object uses more materials

We need to update object data, like when removing a mat slot, since some mat indices might have become invalid!
This commit is contained in:
Bastien Montagne 2014-01-17 13:16:07 +01:00
parent 6489c1f94d
commit df88dbf955
Notes: blender-bot 2023-02-14 11:21:41 +01:00
Referenced by issue #38161, Copy Material to Others causes incorrect viewport display if target object uses more materials
1 changed files with 1 additions and 0 deletions

View File

@ -348,6 +348,7 @@ static int material_slot_copy_exec(bContext *C, wmOperator *UNUSED(op))
if (ob_iter->totcol == ob->totcol) {
ob_iter->actcol = ob->actcol;
DAG_id_tag_update(&ob_iter->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob_iter);
}
}