From 1e7858f5a0daf8cc91f33fd16f5d9868945e4881 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 20 Jan 2010 12:20:34 +0000 Subject: Proxy Fix: drivers are now copied on proxy synchronization. Also for bones on non-proxy protected layers, not sure if these should be done or not, it depends a bit on preference. --- source/blender/blenkernel/intern/armature.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source') diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 3a7d79b8e00..498fb12aa9d 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -61,6 +61,7 @@ #include "BKE_depsgraph.h" #include "BKE_DerivedMesh.h" #include "BKE_displist.h" +#include "BKE_fcurve.h" #include "BKE_global.h" #include "BKE_idprop.h" #include "BKE_library.h" @@ -1480,6 +1481,7 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected bPose *pose= ob->pose, *frompose= from->pose; bPoseChannel *pchan, *pchanp, pchanw; bConstraint *con; + AnimData *adt, *fromadt; int error = 0; if (frompose==NULL) return; @@ -1571,6 +1573,15 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected pchan->custom= pchanp->custom; } } + + /* copy drivers */ + adt= BKE_animdata_from_id(&ob->id); + fromadt= BKE_animdata_from_id(&from->id); + if(!adt) + adt= BKE_id_add_animdata(&ob->id); + + free_fcurves(&adt->drivers); + copy_fcurves(&adt->drivers, &fromadt->drivers); } static int rebuild_pose_bone(bPose *pose, Bone *bone, bPoseChannel *parchan, int counter) -- cgit v1.2.3