Cleanup: BKE_library: remove 'test' param of id_copy.
authorBastien Montagne <montagne29@wanadoo.fr>
Mon, 4 Feb 2019 14:34:31 +0000 (15:34 +0100)
committerBastien Montagne <montagne29@wanadoo.fr>
Tue, 5 Feb 2019 08:49:50 +0000 (09:49 +0100)
This was used in *one* place only... much better to have a dedicated
helper for that kind of things. ;)

52 files changed:
source/blender/blenkernel/BKE_library.h
source/blender/blenkernel/intern/action.c
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/brush.c
source/blender/blenkernel/intern/cachefile.c
source/blender/blenkernel/intern/camera.c
source/blender/blenkernel/intern/collection.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/gpencil.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/key.c
source/blender/blenkernel/intern/lamp.c
source/blender/blenkernel/intern/lattice.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/library_override.c
source/blender/blenkernel/intern/lightprobe.c
source/blender/blenkernel/intern/linestyle.c
source/blender/blenkernel/intern/mask.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/mball.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/mesh_convert.c
source/blender/blenkernel/intern/movieclip.c
source/blender/blenkernel/intern/nla.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/paint.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/particle_distribute.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/speaker.c
source/blender/blenkernel/intern/text.c
source/blender/blenkernel/intern/texture.c
source/blender/blenkernel/intern/world.c
source/blender/collada/collada_utils.cpp
source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
source/blender/editors/interface/interface_templates.c
source/blender/editors/physics/particle_object.c
source/blender/makesrna/intern/rna_ID.c
source/blender/modifiers/intern/MOD_boolean.c
source/blender/modifiers/intern/MOD_cloth.c
source/blender/modifiers/intern/MOD_collision.c
source/blender/modifiers/intern/MOD_datatransfer.c
source/blender/modifiers/intern/MOD_meshsequencecache.c
source/blender/modifiers/intern/MOD_normal_edit.c
source/blender/modifiers/intern/MOD_ocean.c
source/blender/modifiers/intern/MOD_surface.c
source/blender/modifiers/intern/MOD_util.c
source/blender/modifiers/intern/MOD_weighted_normal.c

index f90222ea7c263f9e7d35d5812411aafa9b12612b..dcbe570316027b0c3664e5c5f26cf33e6d756889 100644 (file)
@@ -162,8 +162,9 @@ void BKE_id_clear_newpoin(struct ID *id);
 void BKE_id_make_local_generic(struct Main *bmain, struct ID *id, const bool id_in_mainlist, const bool lib_local);
 bool id_make_local(struct Main *bmain, struct ID *id, const bool test, const bool force_local);
 bool id_single_user(struct bContext *C, struct ID *id, struct PointerRNA *ptr, struct PropertyRNA *prop);
-bool id_copy(struct Main *bmain, const struct ID *id, struct ID **newid, bool test);
-bool BKE_id_copy_ex(struct Main *bmain, const struct ID *id, struct ID **r_newid, const int flag, const bool test);
+bool BKE_id_copy_is_allowed(const struct ID *id);
+bool id_copy(struct Main *bmain, const struct ID *id, struct ID **newid);
+bool BKE_id_copy_ex(struct Main *bmain, const struct ID *id, struct ID **r_newid, const int flag);
 void BKE_id_swap(struct Main *bmain, struct ID *id_a, struct ID *id_b);
 void id_sort_by_name(struct ListBase *lb, struct ID *id);
 void BKE_id_expand_local(struct Main *bmain, struct ID *id);
index 94343204718fab4a49f91e1c589064ca8c23e08f..b05089c3aa9d71d7164dd4a5eeb4f1f0662019dd 100644 (file)
@@ -163,7 +163,7 @@ void BKE_action_copy_data(Main *UNUSED(bmain), bAction *act_dst, const bAction *
 bAction *BKE_action_copy(Main *bmain, const bAction *act_src)
 {
        bAction *act_copy;
-       BKE_id_copy_ex(bmain, &act_src->id, (ID **)&act_copy, 0, false);
+       BKE_id_copy_ex(bmain, &act_src->id, (ID **)&act_copy, 0);
        return act_copy;
 }
 
index ff84838bfa376f4a20e3b518692676b30cb92c4b..81bf11e2cd7ef126555257c17fc46dc68b145f0a 100644 (file)
@@ -284,8 +284,8 @@ 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_ex(bmain, (ID *)dadt->action, (ID **)&dadt->action, 0, false);
-               BKE_id_copy_ex(bmain, (ID *)dadt->tmpact, (ID **)&dadt->tmpact, 0, false);
+               BKE_id_copy_ex(bmain, (ID *)dadt->action, (ID **)&dadt->action, 0);
+               BKE_id_copy_ex(bmain, (ID *)dadt->tmpact, (ID **)&dadt->tmpact, 0);
        }
        else if (do_id_user) {
                id_us_plus((ID *)dadt->action);
index 7607f1749c5ae33aa75e5b62846cf8dbf87fb3d1..00b0bcd391abf4c057c1898a10e1090bd29e6ae6 100644 (file)
@@ -201,7 +201,7 @@ void BKE_armature_copy_data(Main *UNUSED(bmain), bArmature *arm_dst, const bArma
 bArmature *BKE_armature_copy(Main *bmain, const bArmature *arm)
 {
        bArmature *arm_copy;
-       BKE_id_copy_ex(bmain, &arm->id, (ID **)&arm_copy, 0, false);
+       BKE_id_copy_ex(bmain, &arm->id, (ID **)&arm_copy, 0);
        return arm_copy;
 }
 
index 1732a134f1afce64fc5f3234532aa0236ed3fbe2..50ff972b774161aa407e54d3cc0a07f5b45de380 100644 (file)
@@ -590,7 +590,7 @@ void BKE_brush_copy_data(Main *UNUSED(bmain), Brush *brush_dst, const Brush *bru
 Brush *BKE_brush_copy(Main *bmain, const Brush *brush)
 {
        Brush *brush_copy;
-       BKE_id_copy_ex(bmain, &brush->id, (ID **)&brush_copy, 0, false);
+       BKE_id_copy_ex(bmain, &brush->id, (ID **)&brush_copy, 0);
        return brush_copy;
 }
 
index b5d47bd901c4dec4d55b738774d3ac15487253a8..9a317ac9624c60739105c2016d4c44bef3def094 100644 (file)
@@ -126,7 +126,7 @@ void BKE_cachefile_copy_data(
 CacheFile *BKE_cachefile_copy(Main *bmain, const CacheFile *cache_file)
 {
        CacheFile *cache_file_copy;
-       BKE_id_copy_ex(bmain, &cache_file->id, (ID **)&cache_file_copy, 0, false);
+       BKE_id_copy_ex(bmain, &cache_file->id, (ID **)&cache_file_copy, 0);
        return cache_file_copy;
 }
 
index 2a8cf8cd4f2a3fbc83300955bdb8200ea6be1376..4a52707456b36fd94d813430d03ef776b578f61f 100644 (file)
@@ -103,7 +103,7 @@ void BKE_camera_copy_data(Main *UNUSED(bmain), Camera *cam_dst, const Camera *ca
 Camera *BKE_camera_copy(Main *bmain, const Camera *cam)
 {
        Camera *cam_copy;
-       BKE_id_copy_ex(bmain, &cam->id, (ID **)&cam_copy, 0, false);
+       BKE_id_copy_ex(bmain, &cam->id, (ID **)&cam_copy, 0);
        return cam_copy;
 }
 
index 8dc3ef5d639a5918537a196c2bb24a06fabb0a5b..ffd5844de0084402d3f0a466c6be6825e44245e9 100644 (file)
@@ -224,7 +224,7 @@ Collection *BKE_collection_copy(Main *bmain, Collection *parent, Collection *col
        }
 
        Collection *collection_new;
-       BKE_id_copy_ex(bmain, &collection->id, (ID **)&collection_new, 0, false);
+       BKE_id_copy_ex(bmain, &collection->id, (ID **)&collection_new, 0);
        id_us_min(&collection_new->id);  /* Copying add one user by default, need to get rid of that one. */
 
        /* Optionally add to parent. */
index d3e1a48dfd6d9fc5dd5588174a0a098867c39f4f..d49ba5b45675e9d446cb87cf3086a74df8c1e62f 100644 (file)
@@ -206,7 +206,7 @@ void BKE_curve_copy_data(Main *bmain, Curve *cu_dst, const Curve *cu_src, const
        cu_dst->batch_cache = NULL;
 
        if (cu_src->key && (flag & LIB_ID_COPY_SHAPEKEY)) {
-               BKE_id_copy_ex(bmain, &cu_src->key->id, (ID **)&cu_dst->key, flag, false);
+               BKE_id_copy_ex(bmain, &cu_src->key->id, (ID **)&cu_dst->key, flag);
        }
 
        cu_dst->editnurb = NULL;
@@ -216,7 +216,7 @@ void BKE_curve_copy_data(Main *bmain, Curve *cu_dst, const Curve *cu_src, const
 Curve *BKE_curve_copy(Main *bmain, const Curve *cu)
 {
        Curve *cu_copy;
-       BKE_id_copy_ex(bmain, &cu->id, (ID **)&cu_copy, LIB_ID_COPY_SHAPEKEY, false);
+       BKE_id_copy_ex(bmain, &cu->id, (ID **)&cu_copy, LIB_ID_COPY_SHAPEKEY);
        return cu_copy;
 }
 
index 877df8899ffe400e1fe22ddb76c428bf5b6b12c4..28cdf3b3b3627d451e1a743a33ce303168c8b8d3 100644 (file)
@@ -1001,8 +1001,7 @@ static void curve_calc_modifiers_post(
                                        Mesh *temp_mesh;
                                        BKE_id_copy_ex(NULL, &modified->id, (ID **)&temp_mesh,
                                                       LIB_ID_CREATE_NO_MAIN | LIB_ID_CREATE_NO_USER_REFCOUNT |
-                                                      LIB_ID_CREATE_NO_DEG_TAG | LIB_ID_COPY_NO_PREVIEW,
-                                                      false);
+                                                      LIB_ID_CREATE_NO_DEG_TAG | LIB_ID_COPY_NO_PREVIEW);
                                        BKE_id_free(NULL, modified);
                                        modified = temp_mesh;
 
@@ -1047,8 +1046,7 @@ static void curve_calc_modifiers_post(
                        Mesh *temp_mesh;
                        BKE_id_copy_ex(NULL, &modified->id, (ID **)&temp_mesh,
                                       LIB_ID_CREATE_NO_MAIN | LIB_ID_CREATE_NO_USER_REFCOUNT |
-                                      LIB_ID_CREATE_NO_DEG_TAG | LIB_ID_COPY_NO_PREVIEW,
-                                      false);
+                                      LIB_ID_CREATE_NO_DEG_TAG | LIB_ID_COPY_NO_PREVIEW);
                        BKE_id_free(NULL, modified);
                        modified = temp_mesh;
 
index e1d906e09dcf48ea80402b4b612a3574c09d2e79..c85616613aeb3df5cd0c9568a0b7d3eb54a3de9f 100644 (file)
@@ -637,7 +637,7 @@ void BKE_gpencil_copy_data(bGPdata *gpd_dst, const bGPdata *gpd_src, const int U
 bGPdata *BKE_gpencil_copy(Main *bmain, const bGPdata *gpd)
 {
        bGPdata *gpd_copy;
-       BKE_id_copy_ex(bmain, &gpd->id, (ID **)&gpd_copy, 0, false);
+       BKE_id_copy_ex(bmain, &gpd->id, (ID **)&gpd_copy, 0);
        return gpd_copy;
 }
 
@@ -662,7 +662,7 @@ bGPdata *BKE_gpencil_data_duplicate(Main *bmain, const bGPdata *gpd_src, bool in
        }
        else {
                BLI_assert(bmain != NULL);
-               BKE_id_copy_ex(bmain, &gpd_src->id, (ID **)&gpd_dst, 0, false);
+               BKE_id_copy_ex(bmain, &gpd_src->id, (ID **)&gpd_dst, 0);
        }
 
        /* Copy internal data (layers, etc.) */
index 321d02e7dc312aecc8bec2a3ab5d46764c10de1e..54a0b4f81181f2fbd74b3e6fd3eb0860fe86bfee 100644 (file)
@@ -420,7 +420,7 @@ void BKE_image_copy_data(Main *UNUSED(bmain), Image *ima_dst, const Image *ima_s
 Image *BKE_image_copy(Main *bmain, const Image *ima)
 {
        Image *ima_copy;
-       BKE_id_copy_ex(bmain, &ima->id, (ID **)&ima_copy, 0, false);
+       BKE_id_copy_ex(bmain, &ima->id, (ID **)&ima_copy, 0);
        return ima_copy;
 }
 
index 84176824478a2cc86adf5455c33a0c7f8fcb2599..f4af951a9abb4856003970f98712c80dfc278859 100644 (file)
@@ -179,7 +179,7 @@ void BKE_key_copy_data(Main *UNUSED(bmain), Key *key_dst, const Key *key_src, co
 Key *BKE_key_copy(Main *bmain, const Key *key)
 {
        Key *key_copy;
-       BKE_id_copy_ex(bmain, &key->id, (ID **)&key_copy, 0, false);
+       BKE_id_copy_ex(bmain, &key->id, (ID **)&key_copy, 0);
        return key_copy;
 }
 
index c0fda14cc26c1b19fae137332f4b86c5e38ed955..0ce48413af62802c1ff748348591e39e73d0c912 100644 (file)
@@ -110,7 +110,7 @@ void BKE_lamp_copy_data(Main *bmain, Lamp *la_dst, const Lamp *la_src, const int
        if (la_src->nodetree) {
                /* Note: nodetree is *not* in bmain, however this specific case is handled at lower level
                 *       (see BKE_libblock_copy_ex()). */
-               BKE_id_copy_ex(bmain, (ID *)la_src->nodetree, (ID **)&la_dst->nodetree, flag, false);
+               BKE_id_copy_ex(bmain, (ID *)la_src->nodetree, (ID **)&la_dst->nodetree, flag);
        }
 
        if ((flag & LIB_ID_COPY_NO_PREVIEW) == 0) {
@@ -124,7 +124,7 @@ void BKE_lamp_copy_data(Main *bmain, Lamp *la_dst, const Lamp *la_src, const int
 Lamp *BKE_lamp_copy(Main *bmain, const Lamp *la)
 {
        Lamp *la_copy;
-       BKE_id_copy_ex(bmain, &la->id, (ID **)&la_copy, 0, false);
+       BKE_id_copy_ex(bmain, &la->id, (ID **)&la_copy, 0);
        return la_copy;
 }
 
index 20bd579c9adc02981a18371cfe981b1465df55dc..8aff74805689af92d2c9d4d3dfde02e4093a75ed 100644 (file)
@@ -277,7 +277,7 @@ void BKE_lattice_copy_data(Main *bmain, Lattice *lt_dst, const Lattice *lt_src,
        lt_dst->def = MEM_dupallocN(lt_src->def);
 
        if (lt_src->key && (flag & LIB_ID_COPY_SHAPEKEY)) {
-               BKE_id_copy_ex(bmain, &lt_src->key->id, (ID **)&lt_dst->key, flag, false);
+               BKE_id_copy_ex(bmain, &lt_src->key->id, (ID **)&lt_dst->key, flag);
        }
 
        if (lt_src->dvert) {
@@ -292,7 +292,7 @@ void BKE_lattice_copy_data(Main *bmain, Lattice *lt_dst, const Lattice *lt_src,
 Lattice *BKE_lattice_copy(Main *bmain, const Lattice *lt)
 {
        Lattice *lt_copy;
-       BKE_id_copy_ex(bmain, &lt->id, (ID **)&lt_copy, LIB_ID_COPY_SHAPEKEY, false);
+       BKE_id_copy_ex(bmain, &lt->id, (ID **)&lt_copy, LIB_ID_COPY_SHAPEKEY);
        return lt_copy;
 }
 
index cda2030a9eeb008fd4ef06f840fa3d60a6dc41e0..61fea4ba2b5d157bd5bb9a8f9e3ce4a942f768e0 100644 (file)
@@ -341,7 +341,7 @@ void BKE_id_make_local_generic(Main *bmain, ID *id, const bool id_in_mainlist, c
                        ID *id_new;
 
                        /* Should not fail in expected usecases, but id_copy does not copy Scene e.g. */
-                       if (id_copy(bmain, id, &id_new, false)) {
+                       if (id_copy(bmain, id, &id_new)) {
                                id_new->us = 0;
 
                                /* setting newid is mandatory for complex make_lib_local logic... */
@@ -538,6 +538,16 @@ static void id_copy_clear_runtime_pointers(ID *id, int UNUSED(flag))
        }
 }
 
+bool BKE_id_copy_is_allowed(const ID *id)
+{
+#define LIB_ID_TYPES_NOCOPY ID_LI, ID_SCR, ID_WM,  /* Not supported */ \
+                            ID_IP  /* Deprecated */
+
+       return !ELEM(GS(id->name), LIB_ID_TYPES_NOCOPY);
+
+#undef LIB_ID_TYPES_NOCOPY
+}
+
 /**
  * Generic entry point for copying a datablock (new API).
  *
@@ -550,24 +560,17 @@ static void id_copy_clear_runtime_pointers(ID *id, int UNUSED(flag))
  * \param id: Source datablock.
  * \param r_newid: Pointer to new (copied) ID pointer.
  * \param flag: Set of copy options, see DNA_ID.h enum for details (leave to zero for default, full copy).
- * \param test: If set, do not do any copy, just test whether copy is supported.
  * \return False when copying that ID type is not supported, true otherwise.
  */
-/* XXX TODO remove test thing, *all* IDs should be copyable that way! */
-bool BKE_id_copy_ex(Main *bmain, const ID *id, ID **r_newid, const int flag, const bool test)
+bool BKE_id_copy_ex(Main *bmain, const ID *id, ID **r_newid, const int flag)
 {
-#define LIB_ID_TYPES_NOCOPY ID_LI, ID_SCR, ID_WM,  /* Not supported */ \
-                            ID_IP  /* Deprecated */
-
-       BLI_assert(test || (r_newid != NULL));
+       BLI_assert(r_newid != NULL);
        /* Make sure destination pointer is all good. */
        if ((flag & LIB_ID_CREATE_NO_ALLOCATE) == 0) {
-               if (r_newid != NULL) {
-                       *r_newid = NULL;
-               }
+               *r_newid = NULL;
        }
        else {
-               if (r_newid != NULL && *r_newid != NULL) {
+               if (*r_newid != NULL) {
                        /* Allow some garbage non-initialized memory to go in, and clean it up here. */
                        const size_t size = BKE_libblock_get_alloc_info(GS(id->name), NULL);
                        memset(*r_newid, 0, size);
@@ -578,12 +581,9 @@ bool BKE_id_copy_ex(Main *bmain, const ID *id, ID **r_newid, const int flag, con
        if (id == NULL) {
                return false;
        }
-       if (ELEM(GS(id->name), LIB_ID_TYPES_NOCOPY)) {
+       if (!BKE_id_copy_is_allowed(id)) {
                return false;
        }
-       else if (test) {
-               return true;
-       }
 
        BKE_libblock_copy_ex(bmain, id, r_newid, flag);
 
@@ -713,9 +713,9 @@ bool BKE_id_copy_ex(Main *bmain, const ID *id, ID **r_newid, const int flag, con
  * Invokes the appropriate copy method for the block and returns the result in
  * newid, unless test. Returns true if the block can be copied.
  */
-bool id_copy(Main *bmain, const ID *id, ID **newid, bool test)
+bool id_copy(Main *bmain, const ID *id, ID **newid)
 {
-       return BKE_id_copy_ex(bmain, id, newid, LIB_ID_COPY_SHAPEKEY, test);
+       return BKE_id_copy_ex(bmain, id, newid, LIB_ID_COPY_SHAPEKEY);
 }
 
 /** Does a mere memory swap over the whole IDs data (including type-specific memory).
@@ -797,7 +797,7 @@ bool id_single_user(bContext *C, ID *id, PointerRNA *ptr, PropertyRNA *prop)
                /* if property isn't editable, we're going to have an extra block hanging around until we save */
                if (RNA_property_editable(ptr, prop)) {
                        Main *bmain = CTX_data_main(C);
-                       if (id_copy(bmain, id, &newid, false) && newid) {
+                       if (id_copy(bmain, id, &newid) && newid) {
                                /* copy animation actions too */
                                BKE_animdata_copy_id_action(bmain, id, false);
                                /* us is 1 by convention with new IDs, but RNA_property_pointer_set
index 9bb9c2f9ae9b0265ae88fe531f9ac9929146aabf..13e5748cfdaef6ea89cfe3b18e20df502dabe0a8 100644 (file)
@@ -164,7 +164,7 @@ static ID *override_static_create_from(Main *bmain, ID *reference_id)
 {
        ID *local_id;
 
-       if (!id_copy(bmain, reference_id, (ID **)&local_id, false)) {
+       if (!id_copy(bmain, reference_id, (ID **)&local_id)) {
                return NULL;
        }
        id_us_min(local_id);
@@ -621,7 +621,7 @@ void BKE_override_static_update(Main *bmain, ID *local)
         * a (performances) issue here. */
 
        ID *tmp_id;
-       id_copy(bmain, local->override_static->reference, &tmp_id, false);
+       id_copy(bmain, local->override_static->reference, &tmp_id);
 
        if (tmp_id == NULL) {
                return;
@@ -727,7 +727,7 @@ ID *BKE_override_static_operations_store_start(Main *bmain, OverrideStaticStorag
        /* This would imply change in handling of usercout all over RNA (and possibly all over Blender code).
         * Not impossible to do, but would rather see first is extra useless usual user handling is actually
         * a (performances) issue here, before doing it. */
-       id_copy((Main *)override_storage, local, &storage_id, false);
+       id_copy((Main *)override_storage, local, &storage_id);
 
        if (storage_id != NULL) {
                PointerRNA rnaptr_reference, rnaptr_final, rnaptr_storage;
index cb7f546a4b4b865a5ed79ac65c0a5ed7a301e9de..ca537ed3742614cc11c024b8995218ff0f85af95 100644 (file)
@@ -76,7 +76,7 @@ void BKE_lightprobe_copy_data(
 LightProbe *BKE_lightprobe_copy(Main *bmain, const LightProbe *probe)
 {
        LightProbe *probe_copy;
-       BKE_id_copy_ex(bmain, &probe->id, (ID **)&probe_copy, 0, false);
+       BKE_id_copy_ex(bmain, &probe->id, (ID **)&probe_copy, 0);
        return probe_copy;
 }
 
index cf9a0dc0ef273285e0bcf2e36588114258dc3518..8f8a0759db4535350035eefd188e2302eb0e2a17 100644 (file)
@@ -170,7 +170,7 @@ void BKE_linestyle_copy_data(
        if (linestyle_src->nodetree) {
                /* Note: nodetree is *not* in bmain, however this specific case is handled at lower level
                 *       (see BKE_libblock_copy_ex()). */
-               BKE_id_copy_ex(bmain, (ID *)linestyle_src->nodetree, (ID **)&linestyle_dst->nodetree, flag, false);
+               BKE_id_copy_ex(bmain, (ID *)linestyle_src->nodetree, (ID **)&linestyle_dst->nodetree, flag);
        }
 
        LineStyleModifier *m;
@@ -195,7 +195,7 @@ void BKE_linestyle_copy_data(
 FreestyleLineStyle *BKE_linestyle_copy(struct Main *bmain, const FreestyleLineStyle *linestyle)
 {
        FreestyleLineStyle *linestyle_copy;
-       BKE_id_copy_ex(bmain, &linestyle->id, (ID **)&linestyle_copy, 0, false);
+       BKE_id_copy_ex(bmain, &linestyle->id, (ID **)&linestyle_copy, 0);
        return linestyle_copy;
 }
 
index 7840ccc9a8c35627158eb49eb3bb72ce146432e1..d97f0bf2ce4e4d5a14d22a601d23b40cae6edbf3 100644 (file)
@@ -863,7 +863,7 @@ void BKE_mask_copy_data(Main *UNUSED(bmain), Mask *mask_dst, const Mask *mask_sr
 Mask *BKE_mask_copy(Main *bmain, const Mask *mask)
 {
        Mask *mask_copy;
-       BKE_id_copy_ex(bmain, &mask->id, (ID **)&mask_copy, 0, false);
+       BKE_id_copy_ex(bmain, &mask->id, (ID **)&mask_copy, 0);
        return mask_copy;
 }
 
index 17a26f1a4ba271d712003863ecb5688f51b4d3ca..a14e82d296238e2bfec0b48976b5174a6a9b177f 100644 (file)
@@ -184,7 +184,7 @@ void BKE_material_copy_data(Main *bmain, Material *ma_dst, const Material *ma_sr
        if (ma_src->nodetree) {
                /* Note: nodetree is *not* in bmain, however this specific case is handled at lower level
                 *       (see BKE_libblock_copy_ex()). */
-               BKE_id_copy_ex(bmain, (ID *)ma_src->nodetree, (ID **)&ma_dst->nodetree, flag, false);
+               BKE_id_copy_ex(bmain, (ID *)ma_src->nodetree, (ID **)&ma_dst->nodetree, flag);
        }
 
        if ((flag & LIB_ID_COPY_NO_PREVIEW) == 0) {
@@ -210,7 +210,7 @@ void BKE_material_copy_data(Main *bmain, Material *ma_dst, const Material *ma_sr
 Material *BKE_material_copy(Main *bmain, const Material *ma)
 {
        Material *ma_copy;
-       BKE_id_copy_ex(bmain, &ma->id, (ID **)&ma_copy, 0, false);
+       BKE_id_copy_ex(bmain, &ma->id, (ID **)&ma_copy, 0);
        return ma_copy;
 }
 
index bef52bd1418df26e8bdf6e98c2ba6d5dbacd43f3..e2b37050c63c9b942acc094bc6a21158cd241441 100644 (file)
@@ -116,7 +116,7 @@ void BKE_mball_copy_data(Main *UNUSED(bmain), MetaBall *mb_dst, const MetaBall *
 MetaBall *BKE_mball_copy(Main *bmain, const MetaBall *mb)
 {
        MetaBall *mb_copy;
-       BKE_id_copy_ex(bmain, &mb->id, (ID **)&mb_copy, 0, false);
+       BKE_id_copy_ex(bmain, &mb->id, (ID **)&mb_copy, 0);
        return mb_copy;
 }
 
index 2adc2a5e609309e10da5060c6b38369baeb0cf11..2ecf4d7c4842408b256bb64215ad75ec73e51234 100644 (file)
@@ -572,7 +572,7 @@ void BKE_mesh_copy_data(Main *bmain, Mesh *me_dst, const Mesh *me_src, const int
 
        /* TODO Do we want to add flag to prevent this? */
        if (me_src->key && (flag & LIB_ID_COPY_SHAPEKEY)) {
-               BKE_id_copy_ex(bmain, &me_src->key->id, (ID **)&me_dst->key, flag, false);
+               BKE_id_copy_ex(bmain, &me_src->key->id, (ID **)&me_dst->key, flag);
        }
 }
 
@@ -701,14 +701,14 @@ Mesh *BKE_mesh_copy_for_eval(struct Mesh *source, bool reference)
        }
 
        Mesh *result;
-       BKE_id_copy_ex(NULL, &source->id, (ID **)&result, flags, false);
+       BKE_id_copy_ex(NULL, &source->id, (ID **)&result, flags);
        return result;
 }
 
 Mesh *BKE_mesh_copy(Main *bmain, const Mesh *me)
 {
        Mesh *me_copy;
-       BKE_id_copy_ex(bmain, &me->id, (ID **)&me_copy, LIB_ID_COPY_SHAPEKEY, false);
+       BKE_id_copy_ex(bmain, &me->id, (ID **)&me_copy, LIB_ID_COPY_SHAPEKEY);
        return me_copy;
 }
 
index a61d9da2c70025e948c1eafc9e11d596336b4685..b48ede55e522725920101e304e2d025f7e18dc46 100644 (file)
@@ -863,7 +863,7 @@ Mesh *BKE_mesh_new_from_object(
                        /* copies object and modifiers (but not the data) */
                        Object *tmpobj;
                        /* TODO: make it temp copy outside bmain! */
-                       BKE_id_copy_ex(bmain, &ob->id, (ID **)&tmpobj, LIB_ID_COPY_CACHES | LIB_ID_CREATE_NO_DEG_TAG, false);
+                       BKE_id_copy_ex(bmain, &ob->id, (ID **)&tmpobj, LIB_ID_COPY_CACHES | LIB_ID_CREATE_NO_DEG_TAG);
                        tmpcu = (Curve *)tmpobj->data;
 
                        /* Copy cached display list, it might be needed by the stack evaluation.
@@ -884,7 +884,7 @@ Mesh *BKE_mesh_new_from_object(
                                BKE_object_free_modifiers(tmpobj, 0);
 
                        /* copies the data */
-                       BKE_id_copy_ex(bmain, ob->data, (ID **)&copycu, LIB_ID_CREATE_NO_DEG_TAG, false);
+                       BKE_id_copy_ex(bmain, ob->data, (ID **)&copycu, LIB_ID_CREATE_NO_DEG_TAG);
                        id_us_min(tmpobj->data);
                        tmpobj->data = copycu;
 
@@ -971,7 +971,7 @@ Mesh *BKE_mesh_new_from_object(
                        if (cage) {
                                /* copies the data */
                                Mesh *mesh = ob->data;
-                               BKE_id_copy_ex(bmain, &mesh->id, (ID **)&tmpmesh, 0, false);
+                               BKE_id_copy_ex(bmain, &mesh->id, (ID **)&tmpmesh, 0);
                                /* XXX BKE_mesh_copy() already handles materials usercount. */
                                do_mat_id_data_us = false;
                        }
@@ -1146,8 +1146,7 @@ Mesh *BKE_mesh_create_derived_for_modifier(
                        LIB_ID_CREATE_NO_MAIN |
                        LIB_ID_CREATE_NO_USER_REFCOUNT |
                        LIB_ID_CREATE_NO_DEG_TAG |
-                       LIB_ID_COPY_NO_PREVIEW,
-                       false);
+                       LIB_ID_COPY_NO_PREVIEW);
                BKE_mesh_apply_vert_coords(result, deformedVerts);
 
                if (build_shapekey_layers)
@@ -1162,8 +1161,7 @@ Mesh *BKE_mesh_create_derived_for_modifier(
                        LIB_ID_CREATE_NO_MAIN |
                        LIB_ID_CREATE_NO_USER_REFCOUNT |
                        LIB_ID_CREATE_NO_DEG_TAG |
-                       LIB_ID_COPY_NO_PREVIEW,
-                       false);
+                       LIB_ID_COPY_NO_PREVIEW);
 
                if (build_shapekey_layers)
                        add_shapekey_layers(mesh_temp, me);
index c825d3b956100f502965aa9980dbe3580d274b02..1e86d82ad9b43a851b4283355782dc843fc09fc6 100644 (file)
@@ -1525,7 +1525,7 @@ void BKE_movieclip_copy_data(Main *UNUSED(bmain), MovieClip *clip_dst, const Mov
 MovieClip *BKE_movieclip_copy(Main *bmain, const MovieClip *clip)
 {
        MovieClip *clip_copy;
-       BKE_id_copy_ex(bmain, &clip->id, (ID **)&clip_copy, 0, false);
+       BKE_id_copy_ex(bmain, &clip->id, (ID **)&clip_copy, 0);
        return clip_copy;
 }
 
index 16eb1d2caa8f553a87cddbd0adf5f9e2fafa2a9b..c6b82cf390ea193db373e90559a52a7222de575b 100644 (file)
@@ -184,7 +184,7 @@ NlaStrip *BKE_nlastrip_copy(Main *bmain, NlaStrip *strip, const bool use_same_ac
                }
                else {
                        /* use a copy of the action instead (user count shouldn't have changed yet) */
-                       BKE_id_copy_ex(bmain, &strip_d->act->id, (ID **)&strip_d->act, flag, false);
+                       BKE_id_copy_ex(bmain, &strip_d->act->id, (ID **)&strip_d->act, flag);
                }
        }
 
index 295d63bb1071d2cd42fb594c51ee6fbabd9f5c09..ffcd3ab591c01caca575be02f739e56f348b92d9 100644 (file)
@@ -1378,7 +1378,7 @@ bNodeTree *ntreeCopyTree_ex(const bNodeTree *ntree, Main *bmain, const bool do_i
 {
        bNodeTree *ntree_copy;
        const int flag = do_id_user ? LIB_ID_CREATE_NO_USER_REFCOUNT | LIB_ID_CREATE_NO_MAIN : 0;
-       BKE_id_copy_ex(bmain, (ID *)ntree, (ID **)&ntree_copy, flag, false);
+       BKE_id_copy_ex(bmain, (ID *)ntree, (ID **)&ntree_copy, flag);
        return ntree_copy;
 }
 bNodeTree *ntreeCopyTree(Main *bmain, const bNodeTree *ntree)
@@ -2038,8 +2038,7 @@ bNodeTree *ntreeLocalize(bNodeTree *ntree)
                        (LIB_ID_CREATE_NO_MAIN |
                         LIB_ID_CREATE_NO_USER_REFCOUNT |
                         LIB_ID_COPY_NO_PREVIEW |
-                        LIB_ID_COPY_NO_ANIMDATA),
-                       false);
+                        LIB_ID_COPY_NO_ANIMDATA));
 
                for (node = ltree->nodes.first; node; node = node->next) {
                        if (node->type == NODE_GROUP && node->id) {
index 5cb68a7e5bb8e747e9f322dd5dcb7762887fa753..93d71a35240f2a14ae079f8fe36bad3f2fc2dd34 100644 (file)
@@ -1425,7 +1425,7 @@ void BKE_object_copy_data(Main *bmain, Object *ob_dst, const Object *ob_src, con
 Object *BKE_object_copy(Main *bmain, const Object *ob)
 {
        Object *ob_copy;
-       BKE_id_copy_ex(bmain, &ob->id, (ID **)&ob_copy, 0, false);
+       BKE_id_copy_ex(bmain, &ob->id, (ID **)&ob_copy, 0);
 
        /* We increase object user count when linking to Collections. */
        id_us_min(&ob_copy->id);
index 235f38119d7b572a56b30d74d97b0d3dd3602897..a9c25ac073758dfb122443c1f1bafbc32e267ba9 100644 (file)
@@ -445,7 +445,7 @@ void BKE_paint_curve_copy_data(Main *UNUSED(bmain), PaintCurve *pc_dst, const Pa
 PaintCurve *BKE_paint_curve_copy(Main *bmain, const PaintCurve *pc)
 {
        PaintCurve *pc_copy;
-       BKE_id_copy_ex(bmain, &pc->id, (ID **)&pc_copy, 0, false);
+       BKE_id_copy_ex(bmain, &pc->id, (ID **)&pc_copy, 0);
        return pc_copy;
 }
 
@@ -526,7 +526,7 @@ void BKE_palette_copy_data(Main *UNUSED(bmain), Palette *palette_dst, const Pale
 Palette *BKE_palette_copy(Main *bmain, const Palette *palette)
 {
        Palette *palette_copy;
-       BKE_id_copy_ex(bmain, &palette->id, (ID **)&palette_copy, 0, false);
+       BKE_id_copy_ex(bmain, &palette->id, (ID **)&palette_copy, 0);
        return palette_copy;
 }
 
index 4ccf898001e39492da8f74d40986ff21014ccf61..06735f0f60c9b116ea651272a4cd629092c6a141 100644 (file)
@@ -3326,7 +3326,7 @@ void BKE_particlesettings_copy_data(
 ParticleSettings *BKE_particlesettings_copy(Main *bmain, const ParticleSettings *part)
 {
        ParticleSettings *part_copy;
-       BKE_id_copy_ex(bmain, &part->id, (ID **)&part_copy, 0, false);
+       BKE_id_copy_ex(bmain, &part->id, (ID **)&part_copy, 0);
        return part_copy;
 }
 
index 0386e21b8a0d2d0f3a740e74350218a9cd8a8108..b2372c40b46f7272688a35dbc87717b17732b195 100644 (file)
@@ -863,8 +863,7 @@ static int psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti
                                        LIB_ID_CREATE_NO_MAIN |
                                        LIB_ID_CREATE_NO_USER_REFCOUNT |
                                        LIB_ID_CREATE_NO_DEG_TAG |
-                                       LIB_ID_COPY_NO_PREVIEW,
-                                       false);
+                                       LIB_ID_COPY_NO_PREVIEW);
                        }
                        BKE_mesh_tessface_ensure(mesh);
 
@@ -915,8 +914,7 @@ static int psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti
                                    LIB_ID_CREATE_NO_MAIN |
                                    LIB_ID_CREATE_NO_USER_REFCOUNT |
                                    LIB_ID_CREATE_NO_DEG_TAG |
-                                   LIB_ID_COPY_NO_PREVIEW,
-                                   false);
+                                   LIB_ID_COPY_NO_PREVIEW);
 
                BKE_mesh_tessface_ensure(mesh);
 
index 2b2b57b50790609a18235fa0c2597e16acfc51a5..008ef0b02bffca2d119920e268f9572e73e19489 100644 (file)
@@ -3200,8 +3200,7 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
                    LIB_ID_CREATE_NO_MAIN |
                    LIB_ID_CREATE_NO_USER_REFCOUNT |
                    LIB_ID_CREATE_NO_DEG_TAG |
-                   LIB_ID_COPY_NO_PREVIEW,
-                   false);
+                   LIB_ID_COPY_NO_PREVIEW);
        deformedVerts = BKE_mesh_vertexCos_get(psys->hair_out_mesh, NULL);
        clothModifier_do(psys->clmd, sim->depsgraph, sim->scene, sim->ob, psys->hair_in_mesh, deformedVerts);
        BKE_mesh_apply_vert_coords(psys->hair_out_mesh, deformedVerts);
@@ -4199,8 +4198,7 @@ static ParticleSettings *particle_settings_localize(ParticleSettings *particle_s
                       (LIB_ID_CREATE_NO_MAIN |
                        LIB_ID_CREATE_NO_USER_REFCOUNT |
                        LIB_ID_CREATE_NO_DEG_TAG |
-                       LIB_ID_COPY_CACHES),
-                      false);
+                       LIB_ID_COPY_CACHES));
        return particle_settings_local;
 }
 
index 9c7a911e4786802601da055543b661fd2ce3e31d..0298bc418ef74db20cb8d1ff8453105ecb47665d 100644 (file)
@@ -264,7 +264,7 @@ void BKE_scene_copy_data(Main *bmain, Scene *sce_dst, const Scene *sce_src, cons
        if (sce_src->nodetree) {
                /* Note: nodetree is *not* in bmain, however this specific case is handled at lower level
                 *       (see BKE_libblock_copy_ex()). */
-               BKE_id_copy_ex(bmain, (ID *)sce_src->nodetree, (ID **)&sce_dst->nodetree, flag, false);
+               BKE_id_copy_ex(bmain, (ID *)sce_src->nodetree, (ID **)&sce_dst->nodetree, flag);
                BKE_libblock_relink_ex(bmain, sce_dst->nodetree, (void *)(&sce_src->id), &sce_dst->id, false);
        }
 
@@ -387,7 +387,7 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type)
                return sce_copy;
        }
        else {
-               BKE_id_copy_ex(bmain, (ID *)sce, (ID **)&sce_copy, LIB_ID_COPY_ACTIONS, false);
+               BKE_id_copy_ex(bmain, (ID *)sce, (ID **)&sce_copy, LIB_ID_COPY_ACTIONS);
                id_us_min(&sce_copy->id);
                id_us_ensure_real(&sce_copy->id);
 
@@ -400,7 +400,7 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type)
                                        if (lineset->linestyle) {
                                                id_us_min(&lineset->linestyle->id);
                                                /* XXX Not copying anim/actions here? */
-                                               BKE_id_copy_ex(bmain, (ID *)lineset->linestyle, (ID **)&lineset->linestyle, 0, false);
+                                               BKE_id_copy_ex(bmain, (ID *)lineset->linestyle, (ID **)&lineset->linestyle, 0);
                                        }
                                }
                        }
@@ -408,7 +408,7 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type)
                        /* Full copy of world (included animations) */
                        if (sce_copy->world) {
                                id_us_min(&sce_copy->world->id);
-                               BKE_id_copy_ex(bmain, (ID *)sce_copy->world, (ID **)&sce_copy->world, LIB_ID_COPY_ACTIONS, false);
+                               BKE_id_copy_ex(bmain, (ID *)sce_copy->world, (ID **)&sce_copy->world, LIB_ID_COPY_ACTIONS);
                        }
 
                        /* Collections */
@@ -418,7 +418,7 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type)
                        /* XXX Not copying anim/actions here? */
                        if (sce_copy->gpd) {
                                id_us_min(&sce_copy->gpd->id);
-                               BKE_id_copy_ex(bmain, (ID *)sce_copy->gpd, (ID **)&sce_copy->gpd, 0, false);
+                               BKE_id_copy_ex(bmain, (ID *)sce_copy->gpd, (ID **)&sce_copy->gpd, 0);
                        }
                }
                else {
index c0368cfa4ba9fa90c323b5ef1f09bc81d6f491c6..1a421aedba96aa92d8de820f485264e486813f27 100644 (file)
@@ -75,7 +75,7 @@ void BKE_speaker_copy_data(Main *UNUSED(bmain), Speaker *UNUSED(spk_dst), const
 Speaker *BKE_speaker_copy(Main *bmain, const Speaker *spk)
 {
        Speaker *spk_copy;
-       BKE_id_copy_ex(bmain, &spk->id, (ID **)&spk_copy, 0, false);
+       BKE_id_copy_ex(bmain, &spk->id, (ID **)&spk_copy, 0);
        return spk_copy;
 }
 
index dc1b3b5fdb0f8d75d2fa58a8c4cf4df5282aec77..24f4a86d1bfc87e40f0707a59a2745febce9b186 100644 (file)
@@ -496,7 +496,7 @@ void BKE_text_copy_data(Main *UNUSED(bmain), Text *ta_dst, const Text *ta_src, c
 Text *BKE_text_copy(Main *bmain, const Text *ta)
 {
        Text *ta_copy;
-       BKE_id_copy_ex(bmain, &ta->id, (ID **)&ta_copy, 0, false);
+       BKE_id_copy_ex(bmain, &ta->id, (ID **)&ta_copy, 0);
        return ta_copy;
 }
 
index ec6faec142c03838fa6be65d515cee6c5df78da4..498a84a681cfeee894378c668c13293d7dd1e608 100644 (file)
@@ -432,7 +432,7 @@ void BKE_texture_copy_data(Main *bmain, Tex *tex_dst, const Tex *tex_src, const
                }
                /* Note: nodetree is *not* in bmain, however this specific case is handled at lower level
                 *       (see BKE_libblock_copy_ex()). */
-               BKE_id_copy_ex(bmain, (ID *)tex_src->nodetree, (ID **)&tex_dst->nodetree, flag, false);
+               BKE_id_copy_ex(bmain, (ID *)tex_src->nodetree, (ID **)&tex_dst->nodetree, flag);
        }
 
        if ((flag & LIB_ID_COPY_NO_PREVIEW) == 0) {
@@ -446,7 +446,7 @@ void BKE_texture_copy_data(Main *bmain, Tex *tex_dst, const Tex *tex_src, const
 Tex *BKE_texture_copy(Main *bmain, const Tex *tex)
 {
        Tex *tex_copy;
-       BKE_id_copy_ex(bmain, &tex->id, (ID **)&tex_copy, 0, false);
+       BKE_id_copy_ex(bmain, &tex->id, (ID **)&tex_copy, 0);
        return tex_copy;
 }
 
index a0aaefec07c270406a2930e545cd2290c4a6f531..1c00e09d60844a38a82e5ee9974531eb8b070a13 100644 (file)
@@ -108,7 +108,7 @@ void BKE_world_copy_data(Main *bmain, World *wrld_dst, const World *wrld_src, co
        if (wrld_src->nodetree) {
                /* Note: nodetree is *not* in bmain, however this specific case is handled at lower level
                 *       (see BKE_libblock_copy_ex()). */
-               BKE_id_copy_ex(bmain, (ID *)wrld_src->nodetree, (ID **)&wrld_dst->nodetree, flag, false);
+               BKE_id_copy_ex(bmain, (ID *)wrld_src->nodetree, (ID **)&wrld_dst->nodetree, flag);
        }
 
        BLI_listbase_clear(&wrld_dst->gpumaterial);
@@ -125,7 +125,7 @@ void BKE_world_copy_data(Main *bmain, World *wrld_dst, const World *wrld_src, co
 World *BKE_world_copy(Main *bmain, const World *wrld)
 {
        World *wrld_copy;
-       BKE_id_copy_ex(bmain, &wrld->id, (ID **)&wrld_copy, 0, false);
+       BKE_id_copy_ex(bmain, &wrld->id, (ID **)&wrld_copy, 0);
        return wrld_copy;
 }
 
index 12ca7a24657b9a89ac29270a1b280f27b87a0759..63290f38ac8df732ee766fedf0dc32a1e943c4e7 100644 (file)
@@ -287,8 +287,7 @@ Mesh *bc_get_mesh_copy(
                       LIB_ID_CREATE_NO_MAIN |
                       LIB_ID_CREATE_NO_USER_REFCOUNT |
                       LIB_ID_CREATE_NO_DEG_TAG |
-                      LIB_ID_COPY_NO_PREVIEW,
-                      false);
+                      LIB_ID_COPY_NO_PREVIEW);
 
        if (triangulate) {
                bc_triangulate_mesh(tmpmesh);
index 6bc4d2c7b74a1bf2f45e7ba4a8de6ac405b3ad1e..ede0333ea48ec6d29b5533f06ac6d8f2fc405f42 100644 (file)
@@ -294,8 +294,7 @@ bool id_copy_inplace_no_main(const ID *id, ID *newid)
                                      LIB_ID_CREATE_NO_USER_REFCOUNT |
                                      LIB_ID_CREATE_NO_ALLOCATE |
                                      LIB_ID_CREATE_NO_DEG_TAG |
-                                     LIB_ID_COPY_CACHES),
-                                    false);
+                                     LIB_ID_COPY_CACHES));
 
 #ifdef NESTED_ID_NASTY_WORKAROUND
        if (result) {
@@ -325,8 +324,7 @@ bool scene_copy_inplace_no_main(const Scene *scene, Scene *new_scene)
                                     LIB_ID_CREATE_NO_MAIN |
                                     LIB_ID_CREATE_NO_USER_REFCOUNT |
                                     LIB_ID_CREATE_NO_ALLOCATE |
-                                    LIB_ID_CREATE_NO_DEG_TAG,
-                                    false);
+                                    LIB_ID_CREATE_NO_DEG_TAG);
 
 #ifdef NESTED_ID_NASTY_WORKAROUND
        if (result) {
index ae522a335fe92cd825a7c8502d38b7eff88cecd9..662c1b7df50a2d5dfd2da6ca2141f4517a45f616 100644 (file)
@@ -733,8 +733,7 @@ static void template_ID(
                        but->flag |= UI_BUT_UNDO;
 
                        UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), POINTER_FROM_INT(UI_ID_ALONE));
-                       if (/* test only */
-                           (id_copy(CTX_data_main(C), id, NULL, true) == false) ||
+                       if ((!BKE_id_copy_is_allowed(id)) ||
                            (idfrom && idfrom->lib) ||
                            (!editable) ||
                            /* object in editmode - don't change data */
index 8d2ea9864ee996c12680f3dc650f7fca02cc5e14..4894828f80823c499dad96c75c074a8412a50b7a 100644 (file)
@@ -722,8 +722,7 @@ static bool remap_hair_emitter(
                    LIB_ID_CREATE_NO_MAIN |
                    LIB_ID_CREATE_NO_USER_REFCOUNT |
                    LIB_ID_CREATE_NO_DEG_TAG |
-                   LIB_ID_COPY_NO_PREVIEW,
-                   false);
+                   LIB_ID_COPY_NO_PREVIEW);
 
        /* BMESH_ONLY, deform dm may not have tessface */
        BKE_mesh_tessface_ensure(mesh);
@@ -1104,8 +1103,7 @@ static bool copy_particle_systems_to_object(const bContext *C,
                            LIB_ID_CREATE_NO_MAIN |
                            LIB_ID_CREATE_NO_USER_REFCOUNT |
                            LIB_ID_CREATE_NO_DEG_TAG |
-                           LIB_ID_COPY_NO_PREVIEW,
-                           false);
+                           LIB_ID_COPY_NO_PREVIEW);
 
                BKE_mesh_calc_normals(psmd->mesh_final);
                BKE_mesh_tessface_ensure(psmd->mesh_final);
index d287a9ba9b4cc48360f1c793b80d9f2cc219df7e..9560be60585125a942e6bc16f181e6015bcc76f3 100644 (file)
@@ -363,8 +363,10 @@ static ID *rna_ID_copy(ID *id, Main *bmain)
 {
        ID *newid;
 
-       if (id_copy(bmain, id, &newid, false)) {
-               if (newid) id_us_min(newid);
+       if (id_copy(bmain, id, &newid)) {
+               if (newid != NULL) {
+                       id_us_min(newid);
+               }
                return newid;
        }
 
index d5f123f2d6a42d04e44e200b19e37ad0d34f186e..2aab1b7844db2446b85f8b2d3424fd3e98635801 100644 (file)
@@ -115,8 +115,7 @@ static Mesh *get_quick_mesh(
                                                       LIB_ID_CREATE_NO_MAIN |
                                                       LIB_ID_CREATE_NO_USER_REFCOUNT |
                                                       LIB_ID_CREATE_NO_DEG_TAG |
-                                                      LIB_ID_COPY_NO_PREVIEW,
-                                                      false);
+                                                      LIB_ID_COPY_NO_PREVIEW);
 
                                        float imat[4][4];
                                        float omat[4][4];
index c425abe142e7aaa142add04f8e24d27b04b7cd71..27ec0595b542af5bb8f14373ca2b91860d4b2275 100644 (file)
@@ -92,8 +92,7 @@ static void deformVerts(
                        LIB_ID_CREATE_NO_MAIN |
                        LIB_ID_CREATE_NO_USER_REFCOUNT |
                        LIB_ID_CREATE_NO_DEG_TAG |
-                       LIB_ID_COPY_NO_PREVIEW,
-                       false);
+                       LIB_ID_COPY_NO_PREVIEW);
        }
 
        /* TODO(sergey): For now it actually duplicates logic from DerivedMesh.c
index a2f70fe69132e061063facb3b31f774d8fedd162..541bbf32af8ad0a46c4b93e3874ec2278776835d 100644 (file)
@@ -112,8 +112,7 @@ static void deformVerts(
                        LIB_ID_CREATE_NO_MAIN |
                        LIB_ID_CREATE_NO_USER_REFCOUNT |
                        LIB_ID_CREATE_NO_DEG_TAG |
-                       LIB_ID_COPY_NO_PREVIEW,
-                       false);
+                       LIB_ID_COPY_NO_PREVIEW);
        }
 
        if (!ob->pd) {
index 3841ca50bcbdaed97dc0e37e2cb94d6a6dbb844d..1e90642cf62d23361bff8036f42f817df538faf5 100644 (file)
@@ -182,8 +182,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes
                        LIB_ID_CREATE_NO_MAIN |
                        LIB_ID_CREATE_NO_USER_REFCOUNT |
                        LIB_ID_CREATE_NO_DEG_TAG |
-                       LIB_ID_COPY_NO_PREVIEW,
-                       false);
+                       LIB_ID_COPY_NO_PREVIEW);
        }
 
        BKE_reports_init(&reports, RPT_STORE);
index 16fcbadb0f3dad710ba9fc1978295e9a4d974538..1c547f23978d11fb114b98ee048a1b7da01f84bb 100644 (file)
@@ -122,8 +122,7 @@ static Mesh *applyModifier(
                                       LIB_ID_CREATE_NO_MAIN |
                                       LIB_ID_CREATE_NO_USER_REFCOUNT |
                                       LIB_ID_CREATE_NO_DEG_TAG |
-                                      LIB_ID_COPY_NO_PREVIEW,
-                                      false);
+                                      LIB_ID_COPY_NO_PREVIEW);
                }
        }
 
index a92e86ec9f05f9aad5a159d5897a9c5676f21362..37e3acdee1f862423102bd5b57effb49edf21116 100644 (file)
@@ -416,8 +416,7 @@ static Mesh *normalEditModifier_do(
                        LIB_ID_CREATE_NO_MAIN |
                        LIB_ID_CREATE_NO_USER_REFCOUNT |
                        LIB_ID_CREATE_NO_DEG_TAG |
-                       LIB_ID_COPY_NO_PREVIEW,
-                       false);
+                       LIB_ID_COPY_NO_PREVIEW);
        }
        else {
                result = mesh;
index 6570f222877410f459bb9e641cc08af3736ae138..e0f6eff56d46f6e7b9e5270b319c84e34466d31b 100644 (file)
@@ -388,8 +388,7 @@ static Mesh *doOcean(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mes
                               LIB_ID_CREATE_NO_MAIN |
                               LIB_ID_CREATE_NO_USER_REFCOUNT |
                               LIB_ID_CREATE_NO_DEG_TAG |
-                              LIB_ID_COPY_NO_PREVIEW,
-                              false);
+                              LIB_ID_COPY_NO_PREVIEW);
        }
 
        cfra_for_cache = cfra_scene;
index e467c6fcd17b0de19a60fc4594999b66fafb1d78..beaf471778b5760a059f8519e67bb21506193237 100644 (file)
@@ -119,8 +119,7 @@ static void deformVerts(
                        LIB_ID_CREATE_NO_MAIN |
                        LIB_ID_CREATE_NO_USER_REFCOUNT |
                        LIB_ID_CREATE_NO_DEG_TAG |
-                       LIB_ID_COPY_NO_PREVIEW,
-                       false);
+                       LIB_ID_COPY_NO_PREVIEW);
        }
        else {
                surmd->mesh = MOD_deform_mesh_eval_get(ctx->object, NULL, NULL, NULL, numVerts, false, false);
index 52b5fbf53b8f34812caaa86e8f50bad84e5ebad4..d40dd6545b75184109c8cc983f449c779f9dd2e6 100644 (file)
@@ -190,8 +190,7 @@ Mesh *MOD_deform_mesh_eval_get(
                                 LIB_ID_CREATE_NO_USER_REFCOUNT |
                                 LIB_ID_CREATE_NO_DEG_TAG |
                                 LIB_ID_COPY_NO_PREVIEW |
-                                LIB_ID_COPY_CD_REFERENCE),
-                               false);
+                                LIB_ID_COPY_CD_REFERENCE));
                        mesh->runtime.deformed_only = 1;
                }
 
index e3c09fa944b471058efa83963e75ff132561699c..d61fcb01d5e1a695b7ad62d2210715359051acf1 100644 (file)
@@ -495,8 +495,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes
                LIB_ID_CREATE_NO_MAIN |
                LIB_ID_CREATE_NO_USER_REFCOUNT |
                LIB_ID_CREATE_NO_DEG_TAG |
-               LIB_ID_COPY_NO_PREVIEW,
-               false);
+               LIB_ID_COPY_NO_PREVIEW);
 
        const int numVerts = result->totvert;
        const int numEdges = result->totedge;