From 8aaca8840295582387b480794ab94b2bdf28174e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 30 Jun 2020 14:26:06 +0200 Subject: Fix missing relation in compositor depsgraph This is a fix for c7694185c92. An object without base can still be in the depsgraph, and then the `VIEW_LAYER_EVAL` node does not exist. This popped up while @Sergey was looking into T78264. --- .../intern/builder/deg_builder_relations.cc | 25 +++++++++++----------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'source/blender/depsgraph/intern') diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 71e1a0d2171..50c52a519b4 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -762,22 +762,21 @@ void DepsgraphRelationBuilder::build_object_from_layer_relations(Object *object) OperationKey object_flags_key( &object->id, NodeType::OBJECT_FROM_LAYER, OperationCode::OBJECT_BASE_FLAGS); - /* Only connect Entry -> Exit if there is no OBJECT_BASE_FLAGS node. */ - if (has_node(object_flags_key)) { - /* Entry -> OBJECT_BASE_FLAGS -> Exit */ - add_relation(object_from_layer_entry_key, object_flags_key, "Base flags flush Entry"); - add_relation(object_flags_key, object_from_layer_exit_key, "Base flags flush Exit"); - - /* Synchronization back to original object. */ - OperationKey synchronize_key( - &object->id, NodeType::SYNCHRONIZATION, OperationCode::SYNCHRONIZE_TO_ORIGINAL); - add_relation(object_from_layer_exit_key, synchronize_key, "Synchronize to Original"); - } - else { - /* Directly connect Entry -> Exit. */ + if (!has_node(object_flags_key)) { + /* Just connect Entry -> Exit if there is no OBJECT_BASE_FLAGS node. */ add_relation(object_from_layer_entry_key, object_from_layer_exit_key, "Object from Layer"); + return; } + /* Entry -> OBJECT_BASE_FLAGS -> Exit */ + add_relation(object_from_layer_entry_key, object_flags_key, "Base flags flush Entry"); + add_relation(object_flags_key, object_from_layer_exit_key, "Base flags flush Exit"); + + /* Synchronization back to original object. */ + OperationKey synchronize_key( + &object->id, NodeType::SYNCHRONIZATION, OperationCode::SYNCHRONIZE_TO_ORIGINAL); + add_relation(object_from_layer_exit_key, synchronize_key, "Synchronize to Original"); + OperationKey view_layer_done_key( &scene_->id, NodeType::LAYER_COLLECTIONS, OperationCode::VIEW_LAYER_EVAL); add_relation(view_layer_done_key, object_from_layer_entry_key, "View Layer flags to Object"); -- cgit v1.2.3