[Bf-blender-cvs] [2d3f526] object_nodes: More meaningful dependencies between node tree parameters and cache-invalidation operations, and textures that use them.

Lukas Tönne noreply at git.blender.org
Thu May 12 17:57:53 CEST 2016


Commit: 2d3f526403cd9166b706896bd423cb9ea2e539d9
Author: Lukas Tönne
Date:   Thu May 12 17:56:54 2016 +0200
Branches: object_nodes
https://developer.blender.org/rB2d3f526403cd9166b706896bd423cb9ea2e539d9

More meaningful dependencies between node tree parameters and cache-invalidation operations, and textures that use them.

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

M	source/blender/depsgraph/intern/depsgraph_build_nodes.cc
M	source/blender/depsgraph/intern/depsgraph_build_relations.cc

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

diff --git a/source/blender/depsgraph/intern/depsgraph_build_nodes.cc b/source/blender/depsgraph/intern/depsgraph_build_nodes.cc
index 95cb9b4..6ea94f1 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_nodes.cc
+++ b/source/blender/depsgraph/intern/depsgraph_build_nodes.cc
@@ -1175,7 +1175,7 @@ void DepsgraphNodeBuilder::build_nodetree(DepsNode *owner_node, bNodeTree *ntree
 	build_animdata(ntree_id);
 
 	/* Parameters for drivers. */
-	add_operation_node(ntree_id, DEPSNODE_TYPE_PARAMETERS, DEPSOP_TYPE_POST, NULL,
+	add_operation_node(ntree_id, DEPSNODE_TYPE_PARAMETERS, DEPSOP_TYPE_EXEC, NULL,
 	                   DEG_OPCODE_PLACEHOLDER, "Parameters Eval");
 
 	/* nodetree's nodes... */
@@ -1195,7 +1195,7 @@ void DepsgraphNodeBuilder::build_nodetree(DepsNode *owner_node, bNodeTree *ntree
 	}
 	// TODO: link from nodetree to owner_component?
 	
-	add_operation_node(ntree_id, DEPSNODE_TYPE_PARAMETERS, DEPSOP_TYPE_EXEC, function_bind(BVM_function_bvm_cache_remove, ntree),
+	add_operation_node(ntree_id, DEPSNODE_TYPE_PARAMETERS, DEPSOP_TYPE_POST, function_bind(BVM_function_bvm_cache_remove, ntree),
 	                   DEG_OPCODE_NTREE_BVM_FUNCTION_INVALIDATE, "BVM function invalidate");
 	DepsgraphNodeBuilderHandle handle(this);
 	deg_nodetree_bvm_compile_deps(ntree, &handle.handle);
diff --git a/source/blender/depsgraph/intern/depsgraph_build_relations.cc b/source/blender/depsgraph/intern/depsgraph_build_relations.cc
index f50c76b..b1a4cdd 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_relations.cc
+++ b/source/blender/depsgraph/intern/depsgraph_build_relations.cc
@@ -1940,6 +1940,10 @@ void DepsgraphRelationBuilder::build_nodetree(ID *owner, bNodeTree *ntree)
 	                                DEPSNODE_TYPE_PARAMETERS,
 	                                DEG_OPCODE_NTREE_BVM_FUNCTION_INVALIDATE,
 	                                "BVM function invalidate");
+	/* invalidate the node function when nodes are changed */
+	add_relation(parameters_key, bvm_invalidate_key,
+	             DEPSREL_TYPE_COMPONENT_ORDER, "NTree Invalidation");
+	/* custom invalidation through internal dependencies */
 	DepsgraphRelationBuilderHandle handle(this, find_node(bvm_invalidate_key));
 	deg_nodetree_bvm_compile_deps(ntree, &handle.handle);
 	
@@ -1993,7 +1997,7 @@ void DepsgraphRelationBuilder::build_texture(ID *owner, Tex *tex)
 	if (tex->nodetree) {
 		build_nodetree(owner, tex->nodetree);
 		ComponentKey nodetree_key(&tex->nodetree->id, DEPSNODE_TYPE_PARAMETERS);
-		add_relation(nodetree_key, parameters_key,
+		add_relation(nodetree_key, invalidate_key,
 		             DEPSREL_TYPE_COMPONENT_ORDER, "NTree->Texture Parameters");
 	}
 }




More information about the Bf-blender-cvs mailing list