Fix T42973: Render viewport not updating when switching materials in Outliner

For now, do as RNA material update functions - tag object for update too.
This commit is contained in:
Bastien Montagne 2014-12-21 12:40:02 +01:00
parent 071ec918f4
commit 1fe7b84c73
Notes: blender-bot 2023-02-14 09:42:32 +01:00
Referenced by issue #42973, BI Viewport Render Preview Update Issue
1 changed files with 4 additions and 0 deletions

View File

@ -290,6 +290,10 @@ static eOLDrawState tree_element_active_material(
}
}
if (set != OL_SETSEL_NONE) {
/* Tagging object for update seems a bit stupid here, but looks like we have to do it
* for render views to update. See T42973.
* Note that RNA material update does it too, see e.g. rna_MaterialSlot_update(). */
DAG_id_tag_update((ID *)ob, OB_RECALC_OB);
WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING_LINKS, NULL);
}
return OL_DRAWSEL_NONE;