Fix #108778: Crash when rendering multiple view layers #108816

Merged
Sergey Sharybin merged 1 commits from Sergey/blender:fix_108778 into main 2023-06-09 18:42:08 +02:00
1 changed files with 9 additions and 0 deletions

View File

@ -21,6 +21,7 @@
#include "BLI_utildefines.h"
#include "BKE_action.h"
#include "BKE_collection.h"
#include "RNA_prototypes.h"
@ -183,6 +184,14 @@ void deg_graph_build_finalize(Main *bmain, Depsgraph *graph)
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) {
BKE_collection_object_cache_free(reinterpret_cast<Collection *>(id_node->id_cow));
}
}
/* 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. */
flag |= id_orig->recalc;