Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2020-01-02 18:45:18 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2020-01-02 18:47:39 +0300
commit2e06a6bec3f5ed078a544dea9c4f842e403abbc0 (patch)
tree35b8a80219104cb4234c0d84c7f4752ad8a51a04 /source/blender/depsgraph
parent461261c18dbf7d1ab52427b362752d25362311d6 (diff)
Fix T72820: Linked objects jumping around during render
Was caused by 6183688c3560 (thanks ronsn for nailing it down!). The issue is that order of copy-on-write operations is not defined, so can not use flags set by that operation to make decision.
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder.cc6
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder.h2
-rw-r--r--source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc8
3 files changed, 12 insertions, 4 deletions
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;
}
}