Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-09-14 15:27:49 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-09-14 15:43:56 +0300
commitd15928c2344718e47d9025fe5b18ff033366dc5c (patch)
treeff2be00b06d5cea6fa41612c6e336ef9db3aec0a
parentd7fdd505dad68323c3d862e5e6713fab676cd231 (diff)
Depsgraph: Use default visibility of false
Avoids invisible objects from being considered visible when they are used as driver variables. If those cases are actually coming from a visible object, then deg_graph_build_flush_visibility() will ensure visibility is properly flushed there.
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_nodes.cc22
1 files changed, 18 insertions, 4 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index cf5cf5a789f..5a753d150d0 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -412,8 +412,18 @@ void DepsgraphNodeBuilder::build_id(ID *id)
build_collection((Collection *)id);
break;
case ID_OB:
- /* TODO(sergey): Get visibility from a "parent" somehow. */
- build_object(-1, (Object *)id, DEG_ID_LINKED_INDIRECTLY, true);
+ /* TODO(sergey): Get visibility from a "parent" somehow.
+ *
+ * NOTE: Using `false` visibility here should be fine, since if this
+ * driver affects on something invisible we don't really care if the
+ * driver gets evaluated (and even don't want this to force object
+ * to become visible).
+ *
+ * If this happened to be affecting visible object, then it is up to
+ * deg_graph_build_flush_visibility() to ensure visibility of the
+ * object is true.
+ */
+ build_object(-1, (Object *)id, DEG_ID_LINKED_INDIRECTLY, false);
break;
case ID_KE:
build_shapekeys((Key *)id);
@@ -449,8 +459,12 @@ void DepsgraphNodeBuilder::build_id(ID *id)
case ID_CU:
case ID_MB:
case ID_LT:
- /* TODO(sergey): Get visibility from a "parent" somehow. */
- build_object_data_geometry_datablock(id, true);
+ /* TODO(sergey): Get visibility from a "parent" somehow.
+ *
+ * NOTE: Similarly to above, we don't want false-positives on
+ * visibility.
+ */
+ build_object_data_geometry_datablock(id, false);
break;
case ID_SPK:
build_speaker((Speaker *)id);