[Bf-blender-cvs] [7a0ca9f98f0] master: Cleanup/sanitize a bit Action copying within `BKE_animdata_copy()`.
Bastien Montagne
noreply at git.blender.org
Mon Sep 16 23:08:09 CEST 2019
Commit: 7a0ca9f98f0ec5c6c859606815019308d34624ef
Author: Bastien Montagne
Date: Mon Sep 16 22:53:37 2019 +0200
Branches: master
https://developer.blender.org/rB7a0ca9f98f0ec5c6c859606815019308d34624ef
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.
===================================================================
M source/blender/blenkernel/intern/anim_sys.c
===================================================================
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);
More information about the Bf-blender-cvs
mailing list