Depsgraph: Fix wrong relations built for drivers

When target was changed from bone to regular object, new dependency graph was
still trying to build relations as if driver was using bone.
This commit is contained in:
Sergey Sharybin
2017-12-04 17:37:21 +01:00
parent f8fd8b0744
commit 070c735b13

View File

@@ -1088,7 +1088,10 @@ void DepsgraphRelationBuilder::build_driver_variables(ID *id, FCurve *fcu)
continue;
}
/* Special handling for directly-named bones. */
if ((dtar->flag & DTAR_FLAG_STRUCT_REF) && (dtar->pchan_name[0])) {
if ((dtar->flag & DTAR_FLAG_STRUCT_REF) &&
(((Object *)dtar->id)->type == OB_ARMATURE) &&
(dtar->pchan_name[0]))
{
Object *object = (Object *)dtar->id;
bPoseChannel *target_pchan =
BKE_pose_channel_find_name(object->pose,