[Bf-blender-cvs] [7195295] depsgraph_refactor: Depsgraph: Pole targets for IK constraints now work
Joshua Leung
noreply at git.blender.org
Fri Jan 2 09:06:03 CET 2015
Commit: 7195295be16d8a49e794ae304a5c37ed7d976453
Author: Joshua Leung
Date: Fri Jan 2 21:05:54 2015 +1300
Branches: depsgraph_refactor
https://developer.blender.org/rB7195295be16d8a49e794ae304a5c37ed7d976453
Depsgraph: Pole targets for IK constraints now work
===================================================================
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 d0da529..20bc5a1 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
@@ -898,7 +898,8 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob,
OperationKey solver_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE, rootchan->name, DEG_OPCODE_POSE_IK_SOLVER);
add_relation(transforms_key, solver_key, DEPSREL_TYPE_TRANSFORM, "IK Solver Owner");
- // TODO: pole target?
+ /* IK target */
+ // XXX: this should get handled as part of the constraint code
if (data->tar != NULL) {
/* TODO(sergey): For until we'll store partial matricies in the depsgraph,
* we create dependency bewteen target object and pose eval component.
@@ -926,6 +927,20 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob,
}
root_map_add_bone(pchan->name, rootchan->name, root_map);
+ /* Pole Target */
+ // XXX: this should get handled as part of the constraint code
+ if (data->poletar != NULL) {
+ if ((data->tar->type == OB_ARMATURE) && (data->subtarget[0])) {
+ ComponentKey target_key(&data->poletar->id, DEPSNODE_TYPE_BONE, data->subtarget);
+ add_relation(target_key, solver_key, DEPSREL_TYPE_TRANSFORM, con->name);
+ }
+ else {
+ ComponentKey target_key(&data->poletar->id, DEPSNODE_TYPE_TRANSFORM);
+ add_relation(target_key, solver_key, DEPSREL_TYPE_TRANSFORM, con->name);
+ }
+ }
+
+
bPoseChannel *parchan = pchan;
/* exclude tip from chain? */
if (!(data->flag & CONSTRAINT_IK_TIP))
More information about the Bf-blender-cvs
mailing list