Fix T55059: EEVEE UV not available until you go in and out of edit mode

This is a dirty hack that should become irrelevant when depsgraph will
support CD masks.
This commit is contained in:
Clément Foucault 2018-09-19 19:33:08 +02:00
parent a53c81c60b
commit 9cd4788403
Notes: blender-bot 2023-05-29 09:17:12 +02:00
Referenced by issue #55059, EEVEE UV not available until you go in and out of edit mode
1 changed files with 11 additions and 0 deletions

View File

@ -689,6 +689,17 @@ static void rna_3DViewShading_type_update(Main *bmain, Scene *UNUSED(scene), Poi
return;
}
for (Material *ma = bmain->mat.first; ma; ma = ma->id.next) {
/* XXX Dependency graph does not support CD mask tracking,
* so we trigger materials shading for until it's properly supported.
* This is to ensure material batches are all recreated when switching
* shading type. In the future DEG should replace this and just tag
* the meshes itself.
* This hack just tag BKE_MESH_BATCH_DIRTY_SHADING for every mesh that
* have a material. (see T55059) */
DEG_id_tag_update(&ma->id, DEG_TAG_SHADING_UPDATE);
}
bScreen *screen = ptr->id.data;
for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {