From 3df93d063e2d52a2c2e73cfe31801c15682bf0b4 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 22 Jan 2015 02:08:29 +1300 Subject: Fix: Joining armatures loses drivers Currently, when joining two armatures, the drivers of the armatures being merged in are lost. This commit introduces a new AnimData API function for merging animation data into another AnimData block. NOTE: * For now, this only copies the drivers over. As a result, manual effort will still be needed to go through and fix the drivers. I am working on automating that process, but it's more important that the drivers don't have to be created from scratch for now (since this is needed for the Goosberry rigging work). --- source/blender/blenkernel/BKE_animsys.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source/blender/blenkernel/BKE_animsys.h') diff --git a/source/blender/blenkernel/BKE_animsys.h b/source/blender/blenkernel/BKE_animsys.h index a5109acfa56..24abd114a90 100644 --- a/source/blender/blenkernel/BKE_animsys.h +++ b/source/blender/blenkernel/BKE_animsys.h @@ -73,6 +73,20 @@ bool BKE_copy_animdata_id(struct ID *id_to, struct ID *id_from, const bool do_ac /* Copy AnimData Actions */ void BKE_copy_animdata_id_action(struct ID *id); +/* Merge copies of data from source AnimData block */ +typedef enum eAnimData_MergeCopy_Modes { + /* Keep destination action */ + ADT_MERGECOPY_KEEP_DST = 0, + + /* Use src action (make a new copy) */ + ADT_MERGECOPY_SRC_COPY = 1, + + /* Use src action (but just reference the existing version) */ + ADT_MERGECOPY_SRC_REF = 2 +} eAnimData_MergeCopy_Modes; + +void BKE_animdata_merge_copy(struct ID *dst_id, struct ID *src_id, eAnimData_MergeCopy_Modes action_mode, bool fix_drivers); + /* Make Local */ void BKE_animdata_make_local(struct AnimData *adt); -- cgit v1.2.3