diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-06-30 15:26:06 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-06-30 15:26:12 +0300 |
commit | 8aaca8840295582387b480794ab94b2bdf28174e (patch) | |
tree | 0a70f42e0ccdc15ecdc6950967a20e2103e8f048 | |
parent | 2a1af5fa4836a5cec6c464d581b4861579136476 (diff) |
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.
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 25 |
1 files changed, 12 insertions, 13 deletions
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"); |