diff options
author | Bastien Montagne <bastien@blender.org> | 2020-10-07 19:01:25 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-10-07 19:05:06 +0300 |
commit | 253dbe71dcefabc7abfb992d800caa1d963324d1 (patch) | |
tree | 6bbfb565734a9fa57bd0d808ac6295dbec9cac24 /source/blender/blenkernel/intern/anim_data.c | |
parent | 03ef0cfe3c3327647be5289d8ecddea820401221 (diff) |
Refactor: remove `BKE_<id_type>_copy` functions.
Those were only shallow wrappers around `BKE_id_copy`, barely used (even
fully unused in some cases), and we want to get rid of those ID-specific
helpers for the common ID management tasks. Also prevents weird custom
behaviors (like `BKE_object_copy`, who was the only basic ID copy
function to reset user count of the new copy to zero).
Part of 71219.
Diffstat (limited to 'source/blender/blenkernel/intern/anim_data.c')
-rw-r--r-- | source/blender/blenkernel/intern/anim_data.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/anim_data.c b/source/blender/blenkernel/intern/anim_data.c index c677d976783..6ff705a0379 100644 --- a/source/blender/blenkernel/intern/anim_data.c +++ b/source/blender/blenkernel/intern/anim_data.c @@ -397,13 +397,13 @@ static void animdata_copy_id_action(Main *bmain, if (adt) { if (adt->action && (do_linked_id || !ID_IS_LINKED(adt->action))) { id_us_min((ID *)adt->action); - adt->action = set_newid ? ID_NEW_SET(adt->action, BKE_action_copy(bmain, adt->action)) : - BKE_action_copy(bmain, adt->action); + adt->action = set_newid ? ID_NEW_SET(adt->action, BKE_id_copy(bmain, &adt->action->id)) : + BKE_id_copy(bmain, &adt->action->id); } if (adt->tmpact && (do_linked_id || !ID_IS_LINKED(adt->tmpact))) { id_us_min((ID *)adt->tmpact); - adt->tmpact = set_newid ? ID_NEW_SET(adt->tmpact, BKE_action_copy(bmain, adt->tmpact)) : - BKE_action_copy(bmain, adt->tmpact); + adt->tmpact = set_newid ? ID_NEW_SET(adt->tmpact, BKE_id_copy(bmain, &adt->tmpact->id)) : + BKE_id_copy(bmain, &adt->tmpact->id); } } bNodeTree *ntree = ntreeFromID(id); @@ -452,8 +452,8 @@ void BKE_animdata_merge_copy( /* handle actions... */ if (action_mode == ADT_MERGECOPY_SRC_COPY) { /* make a copy of the actions */ - dst->action = BKE_action_copy(bmain, src->action); - dst->tmpact = BKE_action_copy(bmain, src->tmpact); + dst->action = (bAction *)BKE_id_copy(bmain, &src->action->id); + dst->tmpact = (bAction *)BKE_id_copy(bmain, &src->tmpact->id); } else if (action_mode == ADT_MERGECOPY_SRC_REF) { /* make a reference to it */ |