diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-01-20 15:20:34 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-01-20 15:20:34 +0300 |
commit | 1e7858f5a0daf8cc91f33fd16f5d9868945e4881 (patch) | |
tree | bfb4fe02c7060c972aee20b1ddee1e6ea5f94b22 /source | |
parent | d99d68684b990a833c6fe222e5e718ac245338b0 (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/armature.c | 11 |
1 files changed, 11 insertions, 0 deletions
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) |