diff --git a/source/blender/depsgraph/intern/builder/deg_builder.cc b/source/blender/depsgraph/intern/builder/deg_builder.cc index 5e7d2652f9c..e8ec58b4c36 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder.cc @@ -184,6 +184,7 @@ void deg_graph_build_finalize(Main *bmain, Depsgraph *graph) /* Re-tag IDs for update if it was tagged before the relations * update tag. */ for (IDNode *id_node : graph->id_nodes) { + const ID_Type id_type = id_node->id_type; ID *id_orig = id_node->id_orig; id_node->finalize_build(graph); int flag = 0; @@ -200,21 +201,28 @@ void deg_graph_build_finalize(Main *bmain, Depsgraph *graph) flag |= ID_RECALC_COPY_ON_WRITE; /* This means ID is being added to the dependency graph first * time, which is similar to "ob-visible-change" */ - if (GS(id_orig->name) == ID_OB) { + if (id_type == ID_OB) { flag |= ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY; } - if (GS(id_orig->name) == ID_NT) { + if (id_type == ID_NT) { flag |= ID_RECALC_NTREE_OUTPUT; } } else { - /* Collection content might have changed (children collection might have been added or - * removed from the graph based on their inclusion and visibility flags). */ - const ID_Type id_type = GS(id_node->id_cow->name); if (id_type == ID_GR) { + /* Collection content might have changed (children collection might have been added or + * removed from the graph based on their inclusion and visibility flags). */ BKE_collection_object_cache_free( nullptr, reinterpret_cast(id_node->id_cow), LIB_ID_CREATE_NO_DEG_TAG); } + else if (id_type == ID_SCE) { + /* During undo the sequence strips might obtain a new session ID, which will disallow the + * audio handles to be re-used. Tag for the audio and sequence update to ensure the audio + * handles are open. + * MOTE: This is not something shat should be required, and perhaps indicates a weakness in + * design somewhere else. For the cause of the problem check #117760. */ + flag |= ID_RECALC_AUDIO | ID_RECALC_SEQUENCER_STRIPS; + } } /* Restore recalc flags from original ID, which could possibly contain recalc flags set by * an operator and then were carried on by the undo system.