diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-12-04 15:49:13 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-12-06 12:21:32 +0300 |
commit | 7586266343fbedbf30b5f0099558db8c102d323c (patch) | |
tree | d296f067b42dd2e49a5ab6f8e89a8240ddeb5007 /source/blender | |
parent | 3795e37c62689c19b2df1d61ac932156e62196d2 (diff) |
Depsgraph: Use existing utility function to get driver target node
Only done for pose bone for now, but the idea is to go case bu case in
build_driver and move all custom logic from there to find_node_from_pointer().
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 9a106129a7c..5e821ce49ab 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -961,7 +961,6 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu) DEG_OPCODE_DRIVER, fcu->rna_path ? fcu->rna_path : "", fcu->array_index); - bPoseChannel *pchan = NULL; const char *rna_path = fcu->rna_path ? fcu->rna_path : ""; const RNAPathKey self_key(id, rna_path); @@ -975,33 +974,8 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu) */ // XXX: this probably should probably be moved out into a separate function. if (strstr(rna_path, "pose.bones[") != NULL) { - /* interleaved drivers during bone eval */ - /* TODO: ideally, if this is for a constraint, it goes to said - * constraint. - */ - Object *object = (Object *)id; - char *bone_name; - - bone_name = BLI_str_quoted_substrN(rna_path, "pose.bones["); - pchan = BKE_pose_channel_find_name(object->pose, bone_name); - - if (bone_name) { - MEM_freeN(bone_name); - bone_name = NULL; - } - - if (pchan) { - OperationKey bone_key(id, - DEG_NODE_TYPE_BONE, - pchan->name, - DEG_OPCODE_BONE_LOCAL); - add_relation(driver_key, bone_key, "Driver -> Bone"); - } - else { - fprintf(stderr, - "Couldn't find bone name for driver path - '%s'\n", - rna_path); - } + RNAPathKey target_key(id, rna_path); + add_relation(driver_key, target_key, "Driver -> Target"); } else if (GS(id->name) == ID_AR && strstr(rna_path, "bones[")) { /* Drivers on armature-level bone settings (i.e. bbone stuff), |