Fix T81265: Animation is not evaluated when collection is included into view layer.

Just tag objects in un-excluded viewlayer for animation update.
This commit is contained in:
Bastien Montagne 2020-11-26 11:08:51 +01:00
parent 774d18804f
commit 8a2270efc5
Notes: blender-bot 2023-02-13 21:00:01 +01:00
Referenced by commit dd0e2da00e, Cleanup unintentional change in rB8a2270efc52a
Referenced by issue #81265, Animation is not evaluated when collection is included into view layer
1 changed files with 10 additions and 1 deletions

View File

@ -306,7 +306,16 @@ static void rna_LayerCollection_exclude_update(Main *bmain, Scene *UNUSED(scene)
BKE_layer_collection_sync(scene, view_layer);
DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS);
DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS | ID_RECALC_ANIMATION);
if (!exclude) {
/* We need to update animation of objects added back to the scene through enabling this view
* layer. */
FOREACH_OBJECT_BEGIN (view_layer, ob) {
DEG_id_tag_update(&ob->id, ID_RECALC_ANIMATION);
}
FOREACH_OBJECT_END;
}
DEG_relations_tag_update(bmain);
WM_main_add_notifier(NC_SCENE | ND_LAYER_CONTENT, NULL);
if (exclude) {