Fix missing relation in compositor depsgraph

This is a fix for c7694185c9. 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.
This commit is contained in:
Sybren A. Stüvel
2020-06-30 14:26:06 +02:00
parent 2a1af5fa48
commit 8aaca88402

View File

@@ -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");