diff options
Diffstat (limited to 'source/blender/depsgraph/intern/eval')
3 files changed, 20 insertions, 6 deletions
diff --git a/source/blender/depsgraph/intern/eval/deg_eval.cc b/source/blender/depsgraph/intern/eval/deg_eval.cc index df61a1416bd..1296c87bbb0 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval.cc @@ -37,6 +37,7 @@ #include "DNA_object_types.h" #include "DNA_scene_types.h" +#include "DNA_node_types.h" #include "DEG_depsgraph.h" #include "DEG_depsgraph_query.h" @@ -343,11 +344,13 @@ void depsgraph_ensure_view_layer(Depsgraph *graph) * - It was tagged for update of CoW component. * This allows us to have proper view layer pointer. */ Scene *scene_cow = graph->scene_cow; - if (!deg_copy_on_write_is_expanded(&scene_cow->id) || - scene_cow->id.recalc & ID_RECALC_COPY_ON_WRITE) { - const IDNode *id_node = graph->find_id_node(&graph->scene->id); - deg_update_copy_on_write_datablock(graph, id_node); + if (deg_copy_on_write_is_expanded(&scene_cow->id) && + (scene_cow->id.recalc & ID_RECALC_COPY_ON_WRITE) == 0) { + return; } + + const IDNode *scene_id_node = graph->find_id_node(&graph->scene->id); + deg_update_copy_on_write_datablock(graph, scene_id_node); } } // namespace diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc index 50870d1e4aa..d8ce590c611 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc @@ -914,8 +914,11 @@ ID *deg_expand_copy_on_write_datablock(const Depsgraph *depsgraph, user_data.depsgraph = depsgraph; user_data.node_builder = node_builder; user_data.create_placeholders = create_placeholders; - BKE_library_foreach_ID_link( - nullptr, id_cow, foreach_libblock_remap_callback, (void *)&user_data, IDWALK_NOP); + BKE_library_foreach_ID_link(nullptr, + id_cow, + foreach_libblock_remap_callback, + (void *)&user_data, + IDWALK_IGNORE_EMBEDDED_ID); /* Correct or tweak some pointers which are not taken care by foreach * from above. */ update_id_after_copy(depsgraph, id_node, id_orig, id_cow); @@ -1113,6 +1116,11 @@ bool deg_copy_on_write_is_expanded(const ID *id_cow) bool deg_copy_on_write_is_needed(const ID *id_orig) { const ID_Type id_type = GS(id_orig->name); + return deg_copy_on_write_is_needed(id_type); +} + +bool deg_copy_on_write_is_needed(const ID_Type id_type) +{ return ID_TYPE_IS_COW(id_type); } diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.h b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.h index 1992c80e036..05464d11f13 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.h +++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.h @@ -25,6 +25,8 @@ #include <stddef.h> +#include "DNA_ID.h" + struct ID; /* Uncomment this to have verbose log about original and CoW pointers @@ -94,5 +96,6 @@ bool deg_copy_on_write_is_expanded(const struct ID *id_cow); * This includes images. */ bool deg_copy_on_write_is_needed(const ID *id_orig); +bool deg_copy_on_write_is_needed(const ID_Type id_type); } // namespace DEG |