Fix T52255: New Depsgraph - Constraint and Drivers not working together when the driver references itself

This commit is contained in:
Sergey Sharybin 2017-08-08 15:27:11 +02:00
parent 78c288d377
commit b1d998ec5d
1 changed files with 11 additions and 2 deletions

View File

@ -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[")) {