From 7a0ca9f98f0ec5c6c859606815019308d34624ef Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 16 Sep 2019 22:53:37 +0200 Subject: 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. --- source/blender/blenkernel/intern/anim_sys.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/intern') 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); -- cgit v1.2.3