[Bf-blender-cvs] [d15928c2344] blender2.8: Depsgraph: Use default visibility of false

Sergey Sharybin noreply at git.blender.org
Fri Sep 14 14:45:04 CEST 2018


Commit: d15928c2344718e47d9025fe5b18ff033366dc5c
Author: Sergey Sharybin
Date:   Fri Sep 14 14:27:49 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBd15928c2344718e47d9025fe5b18ff033366dc5c

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.

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

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

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

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



More information about the Bf-blender-cvs mailing list