[Bf-blender-cvs] [04f92a3] depsgraph_refactor: Depsgraph: Corrections to IK solver without tip included

Sergey Sharybin noreply at git.blender.org
Fri Feb 13 09:27:11 CET 2015


Commit: 04f92a3db65aed67d5e02fb4c71eaedd683af5c0
Author: Sergey Sharybin
Date:   Fri Feb 13 13:24:49 2015 +0500
Branches: depsgraph_refactor
https://developer.blender.org/rB04f92a3db65aed67d5e02fb4c71eaedd683af5c0

Depsgraph: Corrections to IK solver without tip included

Tip itself should be handled separately after the IK solver is done.

This fixes rig setup of typewriter from ED.

Well, not fully, there's another fix for modifiers name to be applied
in master branch.

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

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 93cb2b8..c08eaeb 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
@@ -992,9 +992,6 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob,
 	bPoseChannel *rootchan = BKE_armature_ik_solver_find_root(pchan, data);
 	OperationKey solver_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE, rootchan->name, DEG_OPCODE_POSE_IK_SOLVER);
 
-	OperationKey transforms_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_READY);
-	add_relation(transforms_key, solver_key, DEPSREL_TYPE_TRANSFORM, "IK Solver Owner");
-
 	/* IK target */
 	// XXX: this should get handled as part of the constraint code
 	if (data->tar != NULL) {
@@ -1035,12 +1032,13 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob,
 			ComponentKey target_key(&data->tar->id, DEPSNODE_TYPE_TRANSFORM);
 			add_relation(target_key, pose_key, DEPSREL_TYPE_TRANSFORM, con->name);
 		}
-	}
-	root_map->add_bone(pchan->name, rootchan->name);
 
-	if ((data->tar) && (data->tar == ob) && (data->subtarget[0])) {
-		/* Prevent target's constraints from linking to anything from same chain that it controls */
-		root_map->add_bone(data->subtarget, rootchan->name);
+		if ((data->tar == ob) && (data->subtarget[0])) {
+			/* Prevent target's constraints from linking to anything from same
+			 * chain that it controls.
+			 */
+			root_map->add_bone(data->subtarget, rootchan->name);
+		}
 	}
 
 	/* Pole Target */
@@ -1072,8 +1070,20 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob,
 
 	bPoseChannel *parchan = pchan;
 	/* exclude tip from chain? */
-	if (!(data->flag & CONSTRAINT_IK_TIP))
+	if (!(data->flag & CONSTRAINT_IK_TIP)) {
+		OperationKey tip_transforms_key(&ob->id, DEPSNODE_TYPE_BONE,
+		                                parchan->name, DEG_OPCODE_BONE_LOCAL);
+		add_relation(solver_key, tip_transforms_key,
+		             DEPSREL_TYPE_TRANSFORM, "IK Solver Result");
 		parchan = pchan->parent;
+	}
+
+	root_map->add_bone(parchan->name, rootchan->name);
+
+	OperationKey parchan_transforms_key(&ob->id, DEPSNODE_TYPE_BONE,
+	                                    parchan->name, DEG_OPCODE_BONE_READY);
+	add_relation(parchan_transforms_key, solver_key,
+	             DEPSREL_TYPE_TRANSFORM, "IK Solver Owner");
 
 	/* Walk to the chain's root */
 	//size_t segcount = 0;




More information about the Bf-blender-cvs mailing list