[Bf-blender-cvs] [25c534f] master: Fix T49981: New Depsgraph - When camera is on inactive layer, it does not evaluate constraints

Sergey Sharybin noreply at git.blender.org
Mon Nov 21 14:37:28 CET 2016


Commit: 25c534f20a0a15a4b07d61fb447740dc22049eed
Author: Sergey Sharybin
Date:   Mon Nov 21 14:36:36 2016 +0100
Branches: master
https://developer.blender.org/rB25c534f20a0a15a4b07d61fb447740dc22049eed

Fix T49981: New Depsgraph - When camera is on inactive layer, it does not evaluate constraints

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

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 4de82dd..e312c4e 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -372,19 +372,26 @@ SubgraphDepsNode *DepsgraphNodeBuilder::build_subgraph(Group *group)
 
 void DepsgraphNodeBuilder::build_object(Scene *scene, Base *base, Object *ob)
 {
-	if (ob->id.tag & LIB_TAG_DOIT) {
-		IDDepsNode *id_node = m_graph->find_id_node(&ob->id);
-		if (base != NULL) {
-			id_node->layers |= base->lay;
-		}
-		return;
-	}
-	ob->id.tag |= LIB_TAG_DOIT;
-
-	IDDepsNode *id_node = add_id_node(&ob->id);
+	const bool has_object = (ob->id.tag & LIB_TAG_DOIT);
+	IDDepsNode *id_node = (has_object)
+	        ? m_graph->find_id_node(&ob->id)
+	        : add_id_node(&ob->id);
+	/* Update node layers.
+	 * Do it for both new and existing ID nodes. This is so because several
+	 * bases might be sharing same object.
+	 */
 	if (base != NULL) {
 		id_node->layers |= base->lay;
 	}
+	if (ob == scene->camera) {
+		/* Camera should always be updated, it used directly by viewport. */
+		id_node->layers |= (unsigned int)(-1);
+	}
+	/* Skip rest of components if the ID node was already there. */
+	if (has_object) {
+		return;
+	}
+	ob->id.tag |= LIB_TAG_DOIT;
 	ob->customdata_mask = 0;
 
 	/* Standard components. */




More information about the Bf-blender-cvs mailing list