diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-08-08 16:27:11 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-08-17 15:13:01 +0300 |
commit | b1d998ec5d8fc5eb4bc28a917ba48de4e03cd56d (patch) | |
tree | 3cb065413b25185ee357bc0554d4019a62b44fb4 | |
parent | 78c288d377b5f1fc7b96e40ac218a1ec12d31eee (diff) |
Fix T52255: New Depsgraph - Constraint and Drivers not working together when the driver references itself
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index a1abcb96411..873102fda18 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -1059,8 +1059,17 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu) } } else if (dtar->flag & DTAR_FLAG_STRUCT_REF) { - /* get node associated with the object's transforms */ - OperationKey target_key(dtar->id, DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_FINAL); + /* Get node associated with the object's transforms. */ + if (dtar->id == id) { + /* Ignore input dependency if we're driving properties of + * the same ID, otherwise we'll be ending up in a cyclic + * dependency here. + */ + continue; + } + OperationKey target_key(dtar->id, + DEG_NODE_TYPE_TRANSFORM, + DEG_OPCODE_TRANSFORM_FINAL); add_relation(target_key, driver_key, "[Target -> Driver]"); } else if (dtar->rna_path && strstr(dtar->rna_path, "pose.bones[")) { |