[Bf-blender-cvs] [fb5c895] depsgraph_refactor: Depsgraph: Fix inconsistency with pending links calculation and layers visibility

Sergey Sharybin noreply at git.blender.org
Fri Jan 9 14:11:41 CET 2015


Commit: fb5c895139ff57386d53240ac130847dd1fd6188
Author: Sergey Sharybin
Date:   Fri Jan 9 18:09:34 2015 +0500
Branches: depsgraph_refactor
https://developer.blender.org/rBfb5c895139ff57386d53240ac130847dd1fd6188

Depsgraph: Fix inconsistency with pending links calculation and layers visibility

Quite straightforard change, just totally ignore invisible nodes on scene update.

This solves issues with victor and koro rigs here.

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

M	source/blender/depsgraph/intern/depsgraph_eval.cpp
M	source/blender/depsgraph/intern/depsgraph_tag.cpp

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

diff --git a/source/blender/depsgraph/intern/depsgraph_eval.cpp b/source/blender/depsgraph/intern/depsgraph_eval.cpp
index d5eae83..98bc69c 100644
--- a/source/blender/depsgraph/intern/depsgraph_eval.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_eval.cpp
@@ -154,19 +154,22 @@ static void deg_task_run_func(TaskPool *pool,
 	schedule_children(pool, state->eval_ctx, state->graph, node, state->layers);
 }
 
-static void calculate_pending_parents(Depsgraph *graph)
+static void calculate_pending_parents(Depsgraph *graph, int layers)
 {
 	for (Depsgraph::OperationNodes::const_iterator it_op = graph->operations.begin();
 	     it_op != graph->operations.end();
 	     ++it_op)
 	{
 		OperationDepsNode *node = *it_op;
+		IDDepsNode *id_node = node->owner->owner;
 
 		node->num_links_pending = 0;
 		node->scheduled = false;
 
 		/* count number of inputs that need updates */
-		if (node->flag & DEPSOP_FLAG_NEEDS_UPDATE) {
+		if ((id_node->layers & layers) != 0 &&
+		    (node->flag & DEPSOP_FLAG_NEEDS_UPDATE) != 0)
+		{
 			for (OperationDepsNode::Relations::const_iterator it_rel = node->inlinks.begin();
 			     it_rel != node->inlinks.end();
 			     ++it_rel)
@@ -254,15 +257,14 @@ static void schedule_children(TaskPool *pool,
 			continue;
 		}
 
-		if (child->flag & DEPSOP_FLAG_NEEDS_UPDATE) {
-			IDDepsNode *id_child = child->owner->owner;
-
+		IDDepsNode *id_child = child->owner->owner;
+		if ((id_child->layers & layers) != 0 &&
+		    (child->flag & DEPSOP_FLAG_NEEDS_UPDATE) != 0)
+		{
 			BLI_assert(child->num_links_pending > 0);
 			atomic_sub_uint32(&child->num_links_pending, 1);
 
-			if (child->num_links_pending == 0 &&
-			    (id_child->layers & layers) != 0)
-			{
+			if (child->num_links_pending == 0) {
 				BLI_spin_lock(&graph->lock);
 				bool need_schedule = !child->scheduled;
 				child->scheduled = true;
@@ -302,7 +304,7 @@ void DEG_evaluate_on_refresh_ex(EvaluationContext *eval_ctx,
 	 */
 	DEG_graph_flush_updates(bmain, eval_ctx, graph, layers);
 
-	calculate_pending_parents(graph);
+	calculate_pending_parents(graph, layers);
 
 	/* Clear tags. */
 	for (Depsgraph::OperationNodes::const_iterator it = graph->operations.begin();
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cpp b/source/blender/depsgraph/intern/depsgraph_tag.cpp
index a42e43d..b0e48e6 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cpp
@@ -214,6 +214,7 @@ void DEG_graph_flush_updates(Main *bmain,
 			queue.push(node);
 		}
 		else {
+			node->flag &= ~DEPSOP_FLAG_NEEDS_UPDATE;
 			graph->add_invisible_entry_tag(node);
 		}
 	}
@@ -234,8 +235,11 @@ void DEG_graph_flush_updates(Main *bmain,
 		{
 			DepsRelation *rel = *it;
 			OperationDepsNode *to_node = (OperationDepsNode *)rel->to;
+			IDDepsNode *id_node = to_node->owner->owner;
 
-			if (!(to_node->flag & DEPSOP_FLAG_NEEDS_UPDATE)) {
+			if ((id_node->layers & layers) != 0 &&
+			    (to_node->flag & DEPSOP_FLAG_NEEDS_UPDATE) == 0)
+			{
 				to_node->flag |= DEPSOP_FLAG_NEEDS_UPDATE;
 				queue.push(to_node);
 			}




More information about the Bf-blender-cvs mailing list