[Bf-blender-cvs] [6799fb387db] master: Depsgraph: Cleanup, use DEG_NODE_TYPE prefix for depsgraph node types

Sergey Sharybin noreply at git.blender.org
Thu Jun 1 16:22:52 CEST 2017


Commit: 6799fb387db89ad1f4fc6a5137a12665d29df785
Author: Sergey Sharybin
Date:   Thu Jun 1 15:40:02 2017 +0200
Branches: master
https://developer.blender.org/rB6799fb387db89ad1f4fc6a5137a12665d29df785

Depsgraph: Cleanup, use DEG_NODE_TYPE prefix for depsgraph node types

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

M	source/blender/depsgraph/intern/builder/deg_builder.cc
M	source/blender/depsgraph/intern/builder/deg_builder_cycle.cc
M	source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M	source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc
M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M	source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc
M	source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc
M	source/blender/depsgraph/intern/builder/deg_builder_transitive.cc
M	source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc
M	source/blender/depsgraph/intern/depsgraph.cc
M	source/blender/depsgraph/intern/depsgraph_build.cc
M	source/blender/depsgraph/intern/depsgraph_debug.cc
M	source/blender/depsgraph/intern/depsgraph_tag.cc
M	source/blender/depsgraph/intern/depsgraph_types.h
M	source/blender/depsgraph/intern/eval/deg_eval.cc
M	source/blender/depsgraph/intern/eval/deg_eval_flush.cc
M	source/blender/depsgraph/intern/nodes/deg_node.cc
M	source/blender/depsgraph/intern/nodes/deg_node_component.cc
M	source/blender/depsgraph/intern/nodes/deg_node_operation.cc

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

diff --git a/source/blender/depsgraph/intern/builder/deg_builder.cc b/source/blender/depsgraph/intern/builder/deg_builder.cc
index 143f9908db8..55caad91b4e 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder.cc
@@ -79,7 +79,7 @@ void deg_graph_build_flush_layers(Depsgraph *graph)
 		node->done = 0;
 		node->num_links_pending = 0;
 		foreach (DepsRelation *rel, node->outlinks) {
-			if ((rel->from->type == DEPSNODE_TYPE_OPERATION) &&
+			if ((rel->from->type == DEG_NODE_TYPE_OPERATION) &&
 			    (rel->flag & DEPSREL_FLAG_CYCLIC) == 0)
 			{
 				++node->num_links_pending;
@@ -97,14 +97,14 @@ void deg_graph_build_flush_layers(Depsgraph *graph)
 		BLI_stack_pop(stack, &node);
 		/* Flush layers to parents. */
 		foreach (DepsRelation *rel, node->inlinks) {
-			if (rel->from->type == DEPSNODE_TYPE_OPERATION) {
+			if (rel->from->type == DEG_NODE_TYPE_OPERATION) {
 				OperationDepsNode *from = (OperationDepsNode *)rel->from;
 				from->owner->layers |= node->owner->layers;
 			}
 		}
 		/* Schedule parent nodes. */
 		foreach (DepsRelation *rel, node->inlinks) {
-			if (rel->from->type == DEPSNODE_TYPE_OPERATION) {
+			if (rel->from->type == DEG_NODE_TYPE_OPERATION) {
 				OperationDepsNode *from = (OperationDepsNode *)rel->from;
 				if ((rel->flag & DEPSREL_FLAG_CYCLIC) == 0) {
 					BLI_assert(from->num_links_pending > 0);
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_cycle.cc b/source/blender/depsgraph/intern/builder/deg_builder_cycle.cc
index 1420b5fc8a5..0922f359abe 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_cycle.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_cycle.cc
@@ -71,7 +71,7 @@ void deg_graph_detect_cycles(Depsgraph *graph)
 	foreach (OperationDepsNode *node, graph->operations) {
 		bool has_inlinks = false;
 		foreach (DepsRelation *rel, node->inlinks) {
-			if (rel->from->type == DEPSNODE_TYPE_OPERATION) {
+			if (rel->from->type == DEG_NODE_TYPE_OPERATION) {
 				has_inlinks = true;
 			}
 		}
@@ -95,7 +95,7 @@ void deg_graph_detect_cycles(Depsgraph *graph)
 		bool all_child_traversed = true;
 		for (int i = node->done; i < node->outlinks.size(); ++i) {
 			DepsRelation *rel = node->outlinks[i];
-			if (rel->to->type == DEPSNODE_TYPE_OPERATION) {
+			if (rel->to->type == DEG_NODE_TYPE_OPERATION) {
 				OperationDepsNode *to = (OperationDepsNode *)rel->to;
 				if (to->tag == NODE_IN_STACK) {
 					printf("Dependency cycle detected:\n");
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index ef94dec4b61..3330795d053 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -447,13 +447,13 @@ void DepsgraphNodeBuilder::build_object(Scene *scene, Base *base, Object *ob)
 void DepsgraphNodeBuilder::build_object_transform(Scene *scene, Object *ob)
 {
 	/* local transforms (from transform channels - loc/rot/scale + deltas) */
-	add_operation_node(&ob->id, DEPSNODE_TYPE_TRANSFORM,
+	add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM,
 	                   DEPSOP_TYPE_INIT, function_bind(BKE_object_eval_local_transform, _1, scene, ob),
 	                   DEG_OPCODE_TRANSFORM_LOCAL);
 
 	/* object parent */
 	if (ob->parent) {
-		add_operation_node(&ob->id, DEPSNODE_TYPE_TRANSFORM,
+		add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM,
 		                   DEPSOP_TYPE_EXEC, function_bind(BKE_object_eval_parent, _1, scene, ob),
 		                   DEG_OPCODE_TRANSFORM_PARENT);
 	}
@@ -470,12 +470,12 @@ void DepsgraphNodeBuilder::build_object_transform(Scene *scene, Object *ob)
 	 *
 	 * TODO(sergey): Get rid of this node.
 	 */
-	add_operation_node(&ob->id, DEPSNODE_TYPE_TRANSFORM,
+	add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM,
 	                   DEPSOP_TYPE_EXEC, function_bind(BKE_object_eval_uber_transform, _1, scene, ob),
 	                   DEG_OPCODE_OBJECT_UBEREVAL);
 
 	/* object transform is done */
-	add_operation_node(&ob->id, DEPSNODE_TYPE_TRANSFORM,
+	add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM,
 	                   DEPSOP_TYPE_POST, function_bind(BKE_object_eval_done, _1, ob),
 	                   DEG_OPCODE_TRANSFORM_FINAL);
 }
@@ -500,7 +500,7 @@ void DepsgraphNodeBuilder::build_object_transform(Scene *scene, Object *ob)
 void DepsgraphNodeBuilder::build_object_constraints(Scene *scene, Object *ob)
 {
 	/* create node for constraint stack */
-	add_operation_node(&ob->id, DEPSNODE_TYPE_TRANSFORM,
+	add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM,
 	                   DEPSOP_TYPE_EXEC, function_bind(BKE_object_eval_constraints, _1, scene, ob),
 	                   DEG_OPCODE_TRANSFORM_CONSTRAINTS);
 }
@@ -523,7 +523,7 @@ void DepsgraphNodeBuilder::build_animdata(ID *id)
 		/* actions and NLA - as a single unit for now, as it gets complicated to schedule otherwise */
 		if ((adt->action) || (adt->nla_tracks.first)) {
 			/* create the node */
-			add_operation_node(id, DEPSNODE_TYPE_ANIMATION,
+			add_operation_node(id, DEG_NODE_TYPE_ANIMATION,
 			                   DEPSOP_TYPE_EXEC, function_bind(BKE_animsys_eval_animdata, _1, id),
 			                   DEG_OPCODE_ANIMATION, id->name);
 
@@ -554,14 +554,14 @@ OperationDepsNode *DepsgraphNodeBuilder::build_driver(ID *id, FCurve *fcu)
 	 * and use some tagging magic instead.
 	 */
 	OperationDepsNode *driver_op = find_operation_node(id,
-	                                                   DEPSNODE_TYPE_PARAMETERS,
+	                                                   DEG_NODE_TYPE_PARAMETERS,
 	                                                   DEG_OPCODE_DRIVER,
 	                                                   fcu->rna_path ? fcu->rna_path : "",
 	                                                   fcu->array_index);
 
 	if (driver_op == NULL) {
 		driver_op = add_operation_node(id,
-		                               DEPSNODE_TYPE_PARAMETERS,
+		                               DEG_NODE_TYPE_PARAMETERS,
 		                               DEPSOP_TYPE_EXEC,
 		                               function_bind(BKE_animsys_eval_driver, _1, id, fcu),
 		                               DEG_OPCODE_DRIVER,
@@ -589,9 +589,9 @@ void DepsgraphNodeBuilder::build_world(World *world)
 	build_animdata(world_id);
 
 	/* world itself */
-	add_component_node(world_id, DEPSNODE_TYPE_PARAMETERS);
+	add_component_node(world_id, DEG_NODE_TYPE_PARAMETERS);
 
-	add_operation_node(world_id, DEPSNODE_TYPE_PARAMETERS, DEPSOP_TYPE_EXEC, NULL,
+	add_operation_node(world_id, DEG_NODE_TYPE_PARAMETERS, DEPSOP_TYPE_EXEC, NULL,
 	                   DEG_OPCODE_PLACEHOLDER, "Parameters Eval");
 
 	/* textures */
@@ -627,13 +627,13 @@ void DepsgraphNodeBuilder::build_rigidbody(Scene *scene)
 	/* XXX: is this the right component, or do we want to use another one instead? */
 
 	/* init/rebuild operation */
-	/*OperationDepsNode *init_node =*/ add_operation_node(&scene->id, DEPSNODE_TYPE_TRANSFORM,
+	/*OperationDepsNode *init_node =*/ add_operation_node(&scene->id, DEG_NODE_TYPE_TRANSFORM,
 	                                                      DEPSOP_TYPE_REBUILD, function_bind(BKE_rigidbody_rebuild_sim, _1, scene),
 	                                                      DEG_OPCODE_RIGIDBODY_REBUILD);
 
 	/* do-sim operation */
 	// XXX: what happens if we need to split into several groups?
-	OperationDepsNode *sim_node     = add_operation_node(&scene->id, DEPSNODE_TYPE_TRANSFORM,
+	OperationDepsNode *sim_node     = add_operation_node(&scene->id, DEG_NODE_TYPE_TRANSFORM,
 	                                                     DEPSOP_TYPE_SIM, function_bind(BKE_rigidbody_eval_simulation, _1, scene),
 	                                                     DEG_OPCODE_RIGIDBODY_SIM);
 
@@ -654,7 +654,7 @@ void DepsgraphNodeBuilder::build_rigidbody(Scene *scene)
 
 			/* 2) create operation for flushing results */
 			/* object's transform component - where the rigidbody operation lives */
-			add_operation_node(&ob->id, DEPSNODE_TYPE_TRANSFORM,
+			add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM,
 			                   DEPSOP_TYPE_EXEC, function_bind(BKE_rigidbody_object_sync_transforms, _1, scene, ob),
 			                   DEG_OPCODE_TRANSFORM_RIGIDBODY);
 		}
@@ -680,7 +680,7 @@ void DepsgraphNodeBuilder::build_particles(Scene *scene, Object *ob)
 
 	/* component for all particle systems */
 	ComponentDepsNode *psys_comp =
-	        add_component_node(&ob->id, DEPSNODE_TYPE_EVAL_PARTICLES);
+	        add_component_node(&ob->id, DEG_NODE_TYPE_EVAL_PARTICLES);
 
 	/* particle systems */
 	LINKLIST_FOREACH (ParticleSystem *, psys, &ob->particlesystem) {
@@ -710,7 +710,7 @@ void DepsgraphNodeBuilder::build_particles(Scene *scene, Object *ob)
 void DepsgraphNodeBuilder::build_cloth(Scene *scene, Object *object)
 {
 	ComponentDepsNode *cache_comp = add_component_node(&object->id,
-	                                                   DEPSNODE_TYPE_CACHE);
+	                                                   DEG_NODE_TYPE_CACHE);
 	add_operation_node(cache_comp,
 	                   DEPSOP_TYPE_EXEC,
 	                   function_bind(BKE_object_eval_cloth,
@@ -726,7 +726,7 @@ void DepsgraphNodeBuilder::build_shapekeys(Key *key)
 {
 	build_animdata(&key->id);
 
-	add_operation_node(&key->id, DEPSNODE_TYPE_GEOMETRY, DEPSOP_TYPE_EXEC, NULL,
+	add_operation_node(&key->id, DEG_NODE_TYPE_GEOMETRY, DEPSOP_TYPE_EXEC, NULL,
 	                   DEG_OPCODE_PLACEHOLDER, "Shapekey Eval");
 }
 
@@ -742,7 +742,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob)
 	 * Does this depend on other nodes?
 	 */
 	add_operation_node(&ob->id,
-	                   DEPSNODE_TYPE_PARAMETERS,
+	                   DEG_NODE_TYPE_PARAMETERS,
 	                   DEPSOP_TYPE_POST,
 	                   NULL,
 	                   DEG_OPCODE_PLACEHOLDER,
@@ -756,13 +756,13 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob)
 	 * TODO(sergey): Get rid of this node.
 	 */
 	add_operation_node(&ob->id,
-	                   DEPSNODE_TYPE_GEOMETRY,
+	                   DEG_NODE_TYPE_GEOMETRY,
 

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list