[Bf-blender-cvs] [d0693c160ae] master: Revert "Fix T78071: Drivers reading object visibility not updating automatically"

Sybren A. Stüvel noreply at git.blender.org
Thu Jun 25 15:20:09 CEST 2020


Commit: d0693c160ae49417d0afd63c66caa4c58e2cec9b
Author: Sybren A. Stüvel
Date:   Thu Jun 25 15:18:59 2020 +0200
Branches: master
https://developer.blender.org/rBd0693c160ae49417d0afd63c66caa4c58e2cec9b

Revert "Fix T78071: Drivers reading object visibility not updating automatically"

This reverts commit baa0da3e69a1225cd18c075be5563c7d811b5347.

The commit causes some issues I didn't foresee, I'd rather take the time
to do it properly than hastily try and commit a fix for it.

===================================================================

M	source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc

===================================================================

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 46dbe97ce23..d84ec9b1363 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -667,15 +667,8 @@ void DepsgraphNodeBuilder::build_object_flags(int base_index,
                                               eDepsNode_LinkedState_Type linked_state)
 {
   if (base_index == -1) {
-    /* An object can be targeted by a driver that reads its `hide_viewport` or `hide_render`
-     * property. For visible objects, these properties are synced from the base flags, so that
-     * driver variable creates a relation from the OBJECT_FROM_LAYER component. However, when the
-     * object is hidden, it has base_index=-1. To support the aforementioned driver, the component
-     * should still exist, even if it's a no-op. See T78071. */
-    add_operation_node(&object->id, NodeType::OBJECT_FROM_LAYER, OperationCode::OBJECT_BASE_FLAGS);
     return;
   }
-
   Scene *scene_cow = get_cow_datablock(scene_);
   Object *object_cow = get_cow_datablock(object);
   const bool is_from_set = (linked_state == DEG_ID_LINKED_VIA_SET);
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 7b2b048d405..e21a83485ad 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -757,20 +757,14 @@ void DepsgraphRelationBuilder::build_object_proxy_group(Object *object)
 
 void DepsgraphRelationBuilder::build_object_flags(Base *base, Object *object)
 {
-  /* An object can be targeted by a driver that reads its `hide_viewport` or `hide_render`
-   * property. When the object is hidden, it has no base. To support such a driver, the component
-   * should still have a relation from the view layer, as it should be updated when the object
-   * toggles visiblity. See T78071. */
+  if (base == nullptr) {
+    return;
+  }
   OperationKey view_layer_done_key(
       &scene_->id, NodeType::LAYER_COLLECTIONS, OperationCode::VIEW_LAYER_EVAL);
   OperationKey object_flags_key(
       &object->id, NodeType::OBJECT_FROM_LAYER, OperationCode::OBJECT_BASE_FLAGS);
   add_relation(view_layer_done_key, object_flags_key, "Base flags flush");
-
-  if (base == nullptr) {
-    return;
-  }
-
   /* Synchronization back to original object. */
   OperationKey synchronize_key(
       &object->id, NodeType::SYNCHRONIZATION, OperationCode::SYNCHRONIZE_TO_ORIGINAL);



More information about the Bf-blender-cvs mailing list