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/io | |
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/io')
-rw-r--r-- | source/blender/io/collada/BCAnimationSampler.h | 3 | ||||
-rw-r--r-- | source/blender/io/collada/DocumentImporter.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/io/collada/BCAnimationSampler.h b/source/blender/io/collada/BCAnimationSampler.h index 34aec00374e..f7f2464a637 100644 --- a/source/blender/io/collada/BCAnimationSampler.h +++ b/source/blender/io/collada/BCAnimationSampler.h @@ -40,7 +40,8 @@ class BCAnimation { BCAnimation(bContext *C, Object *ob) : mContext(C) { Main *bmain = CTX_data_main(mContext); - reference = BKE_object_copy(bmain, ob); + reference = (Object *)BKE_id_copy(bmain, &ob->id); + id_us_min(&reference->id); } ~BCAnimation() diff --git a/source/blender/io/collada/DocumentImporter.cpp b/source/blender/io/collada/DocumentImporter.cpp index da95130a06c..083d7258d0a 100644 --- a/source/blender/io/collada/DocumentImporter.cpp +++ b/source/blender/io/collada/DocumentImporter.cpp @@ -415,7 +415,8 @@ Object *DocumentImporter::create_instance_node(Object *source_ob, // source_node->getOriginalId().c_str() : NULL); Main *bmain = CTX_data_main(mContext); - Object *obn = BKE_object_copy(bmain, source_ob); + Object *obn = (Object *)BKE_id_copy(bmain, &source_ob->id); + id_us_min(&obn->id); DEG_id_tag_update(&obn->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION); BKE_collection_object_add_from(bmain, sce, source_ob, obn); |