From db3c3d133817cd16ce3022ddce01559ed28cb532 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 4 Apr 2018 17:28:23 +0200 Subject: [PATCH] Depsgraph: Fix/workaround crash with animation and drivers and CoW The issue was caused by component tag forcing CoW component to be run, without actually flushing changes down the road from the CoW operation. In a way, this is what we want: we do want CoW to run on changes, but we don't want tiny change forcing full datablock update. This commit makes it so order of updates is all correct, but the bigger issue is still open: what parts of datablock CoW should be updating? Now it's possible to open spring file and play around. --- .../depsgraph/intern/builder/deg_builder_relations.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 96a99eea624..88c62182466 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -2073,18 +2073,18 @@ void DepsgraphRelationBuilder::build_copy_on_write_relations(IDDepsNode *id_node graph_->add_new_relation(op_cow, op_node, "CoW Dependency"); } else { - bool has_same_id_dependency = false; + bool has_same_comp_dependency = false; foreach (DepsRelation *rel, op_node->inlinks) { if (rel->from->type != DEG_NODE_TYPE_OPERATION) { continue; } OperationDepsNode *op_node_from = (OperationDepsNode *)rel->from; - if (op_node_from->owner->owner == op_node->owner->owner) { - has_same_id_dependency = true; + if (op_node_from->owner == op_node->owner) { + has_same_comp_dependency = true; break; } } - if (!has_same_id_dependency) { + if (!has_same_comp_dependency) { graph_->add_new_relation(op_cow, op_node, "CoW Dependency"); } }