diff --git a/source/blender/depsgraph/intern/builder/deg_builder.cc b/source/blender/depsgraph/intern/builder/deg_builder.cc index 4ca7240abd1..fb7104e7556 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder.cc @@ -55,6 +55,12 @@ extern "C" { namespace DEG { +bool deg_check_id_in_depsgraph(const Depsgraph *graph, ID *id_orig) +{ + IDNode *id_node = graph->find_id_node(id_orig); + return id_node != NULL; +} + bool deg_check_base_in_depsgraph(const Depsgraph *graph, Base *base) { Object *object_orig = base->base_orig->object; diff --git a/source/blender/depsgraph/intern/builder/deg_builder.h b/source/blender/depsgraph/intern/builder/deg_builder.h index 97e12e9ceb2..2db861b6fca 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder.h +++ b/source/blender/depsgraph/intern/builder/deg_builder.h @@ -24,6 +24,7 @@ #pragma once struct Base; +struct ID; struct Main; struct Object; struct bPoseChannel; @@ -53,6 +54,7 @@ class DepsgraphBuilder { DepsgraphBuilderCache *cache_; }; +bool deg_check_id_in_depsgraph(const Depsgraph *graph, ID *id_orig); bool deg_check_base_in_depsgraph(const Depsgraph *graph, Base *base); void deg_graph_build_finalize(Main *bmain, Depsgraph *graph); 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 3a2cf35f4d5..afb73a84afe 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 @@ -759,17 +759,17 @@ void update_animation_data_after_copy(const ID *id_orig, ID *id_cow) /* Some builders (like motion path one) will ignore proxies from being built. This code makes it so * proxy and proxy_group pointers never point to an original objects, preventing evaluation code * from assign evaluated pointer to an original proxy->proxy_from. */ -void update_proxy_pointers_after_copy(const Depsgraph * /*depsgraph*/, - const Object * /*object_orig*/, +void update_proxy_pointers_after_copy(const Depsgraph *depsgraph, + const Object *object_orig, Object *object_cow) { if (object_cow->proxy != NULL) { - if ((object_cow->proxy->id.tag & LIB_TAG_COPIED_ON_WRITE) == 0) { + if (!deg_check_id_in_depsgraph(depsgraph, &object_orig->proxy->id)) { object_cow->proxy = NULL; } } if (object_cow->proxy_group != NULL) { - if ((object_cow->proxy_group->id.tag & LIB_TAG_COPIED_ON_WRITE) == 0) { + if (!deg_check_id_in_depsgraph(depsgraph, &object_orig->proxy_group->id)) { object_cow->proxy_group = NULL; } }