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/object.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/object.c')
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 676277dae8c..6ab47f1b1f8 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -360,9 +360,9 @@ static void object_make_local(Main *bmain, ID *id, const int flags) } } else { - Object *ob_new = BKE_object_copy(bmain, ob); + Object *ob_new = (Object *)BKE_id_copy(bmain, &ob->id); + id_us_min(&ob_new->id); - ob_new->id.us = 0; ob_new->proxy = ob_new->proxy_from = ob_new->proxy_group = NULL; /* setting newid is mandatory for complex make_lib_local logic... */ @@ -1786,19 +1786,6 @@ void BKE_object_transform_copy(Object *ob_tar, const Object *ob_src) } /** - * Copy objects, will re-initialize cached simulation data. - */ -Object *BKE_object_copy(Main *bmain, const Object *ob) -{ - Object *ob_copy = (Object *)BKE_id_copy(bmain, &ob->id); - - /* We increase object user count when linking to Collections. */ - id_us_min(&ob_copy->id); - - return ob_copy; -} - -/** * Perform deep-copy of object and its 'children' data-blocks (obdata, materials, actions, etc.). * * \param dupflag: Controls which sub-data are also duplicated |