[Bf-blender-cvs] [7a23c3b] depsgraph_refactor: Code cleanup: Remove some of the old commented out versions of these calls

Joshua Leung noreply at git.blender.org
Wed Dec 17 04:41:27 CET 2014


Commit: 7a23c3b848e3d2a33407f8e64f0c94db3446d9ae
Author: Joshua Leung
Date:   Wed Dec 17 15:02:13 2014 +1300
Branches: depsgraph_refactor
https://developer.blender.org/rB7a23c3b848e3d2a33407f8e64f0c94db3446d9ae

Code cleanup: Remove some of the old commented out versions of these calls

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

M	source/blender/depsgraph/intern/depsgraph_build_relations.cpp

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

diff --git a/source/blender/depsgraph/intern/depsgraph_build_relations.cpp b/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
index 5cf31fa..c098497 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
@@ -273,15 +273,12 @@ void DepsgraphRelationBuilder::build_object(Scene *scene, Object *ob)
 		build_constraints(scene, &ob->id, DEPSNODE_TYPE_TRANSFORM, "", &ob->constraints);
 		
 		OperationKey constraint_key(&ob->id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_CONSTRAINTS);
-		add_operation_relation(find_node(local_transform_key), find_node(constraint_key), DEPSREL_TYPE_OPERATION, "Constraint Stack");
-		add_operation_relation(find_node(constraint_key), find_node(ob_ubereval_key), DEPSREL_TYPE_OPERATION, "Constraint Stack");
-		//add_relation(local_transform_key, constraint_key, DEPSREL_TYPE_OPERATION, "Constraint Stack");
-		//add_relation(constraint_key, ob_ubereval_key, DEPSREL_TYPE_OPERATION, "Constraint Stack");
+		add_operation_relation(find_node(local_transform_key), find_node(constraint_key), DEPSREL_TYPE_COMPONENT_ORDER, "[Ob Local -> Constraint Stack]");
+		add_operation_relation(find_node(constraint_key), find_node(ob_ubereval_key), DEPSREL_TYPE_COMPONENT_ORDER, "Temp Ubereval");
 	}
 	else {
 		printf("connecting local to uber\n");
-		//add_relation(local_transform_key, ob_ubereval_key, DEPSREL_TYPE_OPERATION, "Object Transform");
-		add_operation_relation(find_node(local_transform_key), find_node(ob_ubereval_key), DEPSREL_TYPE_OPERATION, "Object Transform");
+		add_operation_relation(find_node(local_transform_key), find_node(ob_ubereval_key), DEPSREL_TYPE_COMPONENT_ORDER, "Object Transform");
 	}
 	
 	
@@ -468,8 +465,6 @@ void DepsgraphRelationBuilder::build_constraints(Scene *scene, ID *id, eDepsNode
 				}
 				else if ((ct->tar->type == OB_ARMATURE) && (ct->subtarget[0])) {
 					/* bone */
-					//ComponentKey target_key(&ct->tar->id, DEPSNODE_TYPE_BONE, ct->subtarget);
-					//add_relation(target_key, constraint_op_key, DEPSREL_TYPE_TRANSFORM, cti->name);
 					OperationKey target_key(&ct->tar->id, DEPSNODE_TYPE_BONE, ct->subtarget, DEG_OPCODE_BONE_DONE);
 					add_operation_relation(find_node(target_key), find_node(constraint_op_key), DEPSREL_TYPE_TRANSFORM, cti->name);
 				}
@@ -494,8 +489,6 @@ void DepsgraphRelationBuilder::build_constraints(Scene *scene, ID *id, eDepsNode
 					// TODO: loc vs rot vs scale?
 					/* TODO(sergey): What to do if target is self? */
 					if (&ct->tar->id != id) {
-						//ComponentKey target_key(&ct->tar->id, DEPSNODE_TYPE_TRANSFORM);
-						//add_relation(target_key, constraint_op_key, DEPSREL_TYPE_TRANSFORM, cti->name);
 						OperationKey target_key(&ct->tar->id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_FINAL);
 						add_operation_relation(find_node(target_key), find_node(constraint_op_key), DEPSREL_TYPE_TRANSFORM, cti->name);
 					}
@@ -573,10 +566,9 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu)
 		}
 		
 		if (pchan) {
-			ComponentKey bone_key(id, DEPSNODE_TYPE_BONE, pchan->name);
-			//add_relation(driver_key, bone_key, DEPSREL_TYPE_DRIVER, "[Driver -> SubData]");
+			OperationKey bone_key(id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_LOCAL);
 			add_operation_relation(find_node(driver_key),
-			                       find_node(OperationKey(id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_LOCAL)),
+			                       find_node(bone_key),
 			                       DEPSREL_TYPE_DRIVER, "[Driver -> SubData]");
 		}
 		else {
@@ -586,11 +578,8 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu)
 	else {
 		if (GS(id->name) == ID_OB) {
 			/* assume that driver affects a transform... */
-			ComponentKey params_key(id, DEPSNODE_TYPE_PARAMETERS);
 			OperationKey local_transform_key(id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_LOCAL);
-			
-			//add_relation(params_key, local_transform_key, DEPSREL_TYPE_OPERATION, "Parameters");
-			add_operation_relation(find_node(driver_key), find_node(local_transform_key), DEPSREL_TYPE_OPERATION, "Parameters");
+			add_operation_relation(find_node(driver_key), find_node(local_transform_key), DEPSREL_TYPE_OPERATION, "[Driver -> Transform]");
 		}
 	}
 	
@@ -613,24 +602,20 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu)
 				
 				if (pchan != NULL) {
 					/* get node associated with bone */
-					ComponentKey target_key(dtar->id, DEPSNODE_TYPE_BONE, pchan->name);
-					//add_relation(target_key, driver_key, DEPSREL_TYPE_DRIVER_TARGET,
-					//             "[Bone Target -> Driver]");
-					add_operation_relation(find_node(OperationKey(dtar->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_DONE)),
-										   find_node(driver_key),
-										   DEPSREL_TYPE_DRIVER_TARGET,
-										   "[Bone Target -> Driver]");
+					OperationKey target_key(dtar->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_DONE);
+					add_operation_relation(find_node(target_key),
+					                       find_node(driver_key),
+					                       DEPSREL_TYPE_DRIVER_TARGET,
+					                       "[Bone Target -> Driver]");
 				}
 			}
 			else if (dtar->flag & DTAR_FLAG_STRUCT_REF) {
 				/* get node associated with the object's transforms */
-				ComponentKey target_key(dtar->id, DEPSNODE_TYPE_TRANSFORM);
-				//add_relation(target_key, driver_key, DEPSREL_TYPE_DRIVER_TARGET,
-				//             "[Ob Target -> Driver]");
-				add_operation_relation(find_node(OperationKey(dtar->id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_FINAL)),
-										   find_node(driver_key),
-										   DEPSREL_TYPE_DRIVER_TARGET,
-										   "[Bone Target -> Driver]");
+				OperationKey target_key(dtar->id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_FINAL);
+				add_operation_relation(find_node(target_key),
+				                       find_node(driver_key),
+				                       DEPSREL_TYPE_DRIVER_TARGET,
+				                       "[Bone Target -> Driver]");
 			}
 			else {
 				/* resolve path to get node */
@@ -978,6 +963,7 @@ void DepsgraphRelationBuilder::build_rig(Scene *scene, Object *ob)
 	
 	/* Armature-Data */
 	// TODO: selection status?
+	
 	/* animation and/or drivers linking posebones to base-armature used to define them */
 	// TODO: we need a bit of an exception here to redirect drivers to posebones?
 	build_animdata(&arm->id);
@@ -986,8 +972,7 @@ void DepsgraphRelationBuilder::build_rig(Scene *scene, Object *ob)
 	OperationKey init_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_INIT);
 	OperationKey flush_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_DONE);
 	
-	//add_relation(init_key, flush_key, DEPSREL_TYPE_OPERATION, "[Pose Init -> Pose Cleanup]");
-	add_operation_relation(find_node(init_key), find_node(flush_key), DEPSREL_TYPE_OPERATION, "[Pose Init -> Pose Cleanup]");
+	add_operation_relation(find_node(init_key), find_node(flush_key), DEPSREL_TYPE_COMPONENT_ORDER, "[Pose Init -> Pose Cleanup]");
 
 	if (ob->adt != NULL) {
 		ComponentKey animation_key(&ob->id, DEPSNODE_TYPE_ANIMATION);
@@ -1003,7 +988,6 @@ void DepsgraphRelationBuilder::build_rig(Scene *scene, Object *ob)
 		/* bone parent */
 		if (pchan->parent == NULL) {
 			/* link bone/component to pose "sources" if it doesn't have any obvious dependencies */
-			//add_relation(init_key, bone_key, DEPSREL_TYPE_OPERATION, "PoseEval Source-Bone Link");
 			add_operation_relation(find_node(init_key), 
 						 find_node(bone_local_key),
 						 DEPSREL_TYPE_OPERATION, "PoseEval Source-Bone Link");
@@ -1023,12 +1007,11 @@ void DepsgraphRelationBuilder::build_rig(Scene *scene, Object *ob)
 			
 			OperationKey transforms_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_POSE_PARENT);
 			OperationKey constraints_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_CONSTRAINTS);
-			//add_relation(transforms_key, constraints_key, DEPSREL_TYPE_OPERATION, "Constraints Stack");
+			
 			add_operation_relation(find_node(transforms_key), find_node(constraints_key), DEPSREL_TYPE_OPERATION, "Constraints Stack");
 		}
 
 		/* TODO(sergey): Assume for now that pose flush depends on all the pose channels. */
-		//add_relation(bone_key, flush_key, DEPSREL_TYPE_OPERATION, "PoseEval Result-Bone Link");
 		add_operation_relation(find_node(OperationKey(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_DONE)),
 							   find_node(flush_key),
 							   DEPSREL_TYPE_OPERATION, "PoseEval Result-Bone Link");
@@ -1068,7 +1051,6 @@ void DepsgraphRelationBuilder::build_rig(Scene *scene, Object *ob)
 		/* bone parent */
 		// FIXME: this code is broken
 		if (pchan->parent != NULL) {
-			//ComponentKey bone_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name);
 			OperationKey bone_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_POSE_PARENT);
 			bool has_common_root = false;
 			if (pchan->flag & POSE_DONE) {
@@ -1078,23 +1060,21 @@ void DepsgraphRelationBuilder::build_rig(Scene *scene, Object *ob)
 			}
 			if (has_common_root) {
 				fprintf(stderr, "common root: %s (par = %s)\n", pchan->name, pchan->parent->name);
+				
 				OperationKey parent_transforms_key = bone_transforms_key(ob, pchan->parent); // XXX: does this settle for pre-IK?
-				//add_relation(parent_transforms_key, bone_key, DEPSREL_TYPE_TRANSFORM, "[Parent Bone -> Child Bone]");
 				add_operation_relation(find_node(parent_transforms_key), find_node(bone_key), DEPSREL_TYPE_TRANSFORM, "[Parent Bone -> Child Bone]");
 			}
 			else {
 				fprintf(stderr, "not common root: %s (par = %s)\n", pchan->name, pchan->parent->name);
-				//ComponentKey parent_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->parent->name);
-				//add_relation(parent_key, bone_key, DEPSREL_TYPE_TRANSFORM, "[Parent Bone -> Child Bone]");
+				
 				OperationKey parent_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->parent->name, DEG_OPCODE_BONE_DONE);
 				add_operation_relation(find_node(parent_key), find_node(bone_key), DEPSREL_TYPE_TRANSFORM, "[Parent Bone -> Child Bone]");
 			}
 		}
-
+		
 		OperationKey final_transforms_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_DONE);
 		if ((pchan->flag & POSE_DONE) == 0) {
 			Ope

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list