diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2012-01-22 03:57:28 +0400 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2012-01-22 03:57:28 +0400 |
commit | 2139c7080eb6bc05111b09f93ad1836930434dad (patch) | |
tree | 7a797239f3b59116c8ce5b676603cbaac4a5e84c /source/blender/editors/object/object_add.c | |
parent | 83b1f21cf9454cbbe49411b8973d57b5c9f76642 (diff) |
patch: 'set the right Action Actuator when duplicating an object' by Daniel Macedo
bug and patch not in tracker. little fix by me (replace while loop by for(...;act;...). Thanks Daniel ;)
Diffstat (limited to 'source/blender/editors/object/object_add.c')
-rw-r--r-- | source/blender/editors/object/object_add.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 64bbf604f67..6ac2ee820db 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -46,6 +46,7 @@ #include "DNA_scene_types.h" #include "DNA_speaker_types.h" #include "DNA_vfont_types.h" +#include "DNA_actuator_types.h" #include "BLI_ghash.h" #include "BLI_listbase.h" @@ -1789,10 +1790,22 @@ 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); + bActuator *act; if(dupflag & USER_DUP_ACT) { BKE_copy_animdata_id_action((ID *)obn->data); if(key) BKE_copy_animdata_id_action((ID*)key); + + /* Update the duplicated action in the action actuators */ + for (act= obn->actuators.first; act; act= act->next) { + if(act->type == ACT_ACTION) { + bActionActuator* actact = (bActionActuator*) act->data; + if(actact->act == ob->adt->action) { + actact->act = obn->adt->action; + } + } + act= act->next; + } } if(dupflag & USER_DUP_MAT) { |