diff options
author | Joshua Leung <aligorith@gmail.com> | 2011-08-16 05:02:26 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2011-08-16 05:02:26 +0400 |
commit | a67562e73cbc2f4a9641fbc4d1147b4b2cc935c4 (patch) | |
tree | 0e8feafbfcaff9c52eb8538bcc62a605092d5b24 /source/blender/editors/object/object_add.c | |
parent | a458de88b65c5fcb0f11c005c040163d3cf76cec (diff) |
Bugfix [#28267] keyframed values for shapekeys of copied objects are
linked
Shapekey actions weren't getting copied when their owner data was.
This was due to the IMO totally convoluted way in which the duplicate
action flags have been set up:
- the function to copy animdata takes a param to specify whether
actions are copied or not, but this is never touched (i.e. this always
just gets FALSE passed in)
- instead, we jump around in hoops later figuring out whether the
userpref wants copying to occur, then fixing up the links
IIRC, part of this may be due to a desire/need to not duplicate
actions when dealing with NodeTree copies for multi-threaded
rendering, but at the expense of complicating everything else.
Diffstat (limited to 'source/blender/editors/object/object_add.c')
-rw-r--r-- | source/blender/editors/object/object_add.c | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 09ce2562e3b..6bc4c30a898 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -39,6 +39,7 @@ #include "DNA_curve_types.h" #include "DNA_group_types.h" #include "DNA_lamp_types.h" +#include "DNA_key_types.h" #include "DNA_material_types.h" #include "DNA_mesh_types.h" #include "DNA_meta_types.h" @@ -65,6 +66,7 @@ #include "BKE_group.h" #include "BKE_lattice.h" #include "BKE_library.h" +#include "BKE_key.h" #include "BKE_main.h" #include "BKE_material.h" #include "BKE_mball.h" @@ -1496,28 +1498,6 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base } /* duplicates using userflags */ -#if 0 // XXX old animation system - if(dupflag & USER_DUP_IPO) { - bConstraintChannel *chan; - id= (ID *)obn->ipo; - - if(id) { - ID_NEW_US( obn->ipo) - else obn->ipo= copy_ipo(obn->ipo); - id->us--; - } - /* Handle constraint ipos */ - for (chan=obn->constraintChannels.first; chan; chan=chan->next){ - id= (ID *)chan->ipo; - if(id) { - ID_NEW_US( chan->ipo) - else chan->ipo= copy_ipo(chan->ipo); - id->us--; - } - } - } -#endif // XXX old animation system - if(dupflag & USER_DUP_ACT) { BKE_copy_animdata_id_action(&obn->id); } @@ -1674,8 +1654,11 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base /* check if obdata is copied */ if(didit) { + Key *key = ob_get_key(obn); + if(dupflag & USER_DUP_ACT) { BKE_copy_animdata_id_action((ID *)obn->data); + if(key) BKE_copy_animdata_id_action((ID*)key); } if(dupflag & USER_DUP_MAT) { |