Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-12-04 18:51:29 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-12-06 12:21:32 +0300
commit97e92d6f3ecb5a5b40f97701b72a91392052cbf2 (patch)
tree458631070de95156c27b075dad0e0fd0ee2135f4
parent284f106c91679a0c750f5c701e382f265412d58e (diff)
Depsgraph: SImplify chjecks in directly address bone
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations.cc33
1 files changed, 12 insertions, 21 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index f2d1dd43438..0d78192a2ef 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -1104,28 +1104,19 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu)
if ((dtar->flag & DTAR_FLAG_STRUCT_REF) && (dtar->pchan_name[0])) {
Object *object = (Object *)dtar->id;
bPoseChannel *target_pchan =
- BKE_pose_channel_find_name(object->pose, dtar->pchan_name);
- if (target_pchan != NULL) {
- /* Get node associated with bone. */
- // XXX: watch the space!
- /* Some cases can't use final bone transform, for example:
- * - Driving the bone with itself (addressed here)
- * - Relations inside an IK chain (TODO?)
- */
- if (dtar->id == id &&
- pchan != NULL &&
- STREQ(pchan->name, target_pchan->name))
- {
- continue;
- }
- OperationKey target_key(dtar->id,
- DEG_NODE_TYPE_BONE,
- target_pchan->name,
- DEG_OPCODE_BONE_DONE);
- add_relation(target_key,
- driver_key,
- "Bone Target -> Driver");
+ BKE_pose_channel_find_name(object->pose,
+ dtar->pchan_name);
+ if (target_pchan == NULL) {
+ continue;
+ }
+ OperationKey variable_key(dtar->id,
+ DEG_NODE_TYPE_BONE,
+ target_pchan->name,
+ DEG_OPCODE_BONE_DONE);
+ if (is_same_bone_dependency(variable_key, self_key)) {
+ continue;
}
+ add_relation(variable_key, driver_key, "Bone Target -> Driver");
}
else if (dtar->flag & DTAR_FLAG_STRUCT_REF) {
/* Get node associated with the object's transforms. */