Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2019-09-16 23:53:37 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-09-17 00:02:38 +0300
commit7a0ca9f98f0ec5c6c859606815019308d34624ef (patch)
tree51413da267d52a6238ffd4340719144631892cfd /source
parent8b53445e8d4ca5a1e320b2af695f22188da583da (diff)
Cleanup/sanitize a bit Action copying within `BKE_animdata_copy()`.
Whole animdata copying code would need much more love, but we can as well sanitize some pieces of it when we hit them, for now.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index ab8ea37377d..4f6f299ecc5 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -305,8 +305,9 @@ AnimData *BKE_animdata_copy(Main *bmain, AnimData *adt, const int flag)
/* make a copy of action - at worst, user has to delete copies... */
if (do_action) {
BLI_assert(bmain != NULL);
- BKE_id_copy(bmain, (ID *)dadt->action, (ID **)&dadt->action);
- BKE_id_copy(bmain, (ID *)dadt->tmpact, (ID **)&dadt->tmpact);
+ BLI_assert(dadt->action == NULL || dadt->action != dadt->tmpact);
+ BKE_id_copy_ex(bmain, (ID *)dadt->action, (ID **)&dadt->action, flag);
+ BKE_id_copy_ex(bmain, (ID *)dadt->tmpact, (ID **)&dadt->tmpact, flag);
}
else if (do_id_user) {
id_us_plus((ID *)dadt->action);