Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <b.mont29@gmail.com>2020-03-04 13:42:15 +0300
committerBastien Montagne <b.mont29@gmail.com>2020-03-04 13:43:31 +0300
commit4bfa256ea48e51643f848e8dfdaeab615f7b1a88 (patch)
tree996d59300eeff16f1063a6be8887aaa3cfcb4299 /source/blender/blenkernel/intern
parent4e597a5cff6bb4195b8fc9c8102bfbdc4958b31f (diff)
Refactor ID make local to use a single flag parameter.
Instead of using anonymous booleans flags, also allows to keep the same behavior in all cases, without needing special handling from calling code for our beloved oddballs object proxies...
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/action.c4
-rw-r--r--source/blender/blenkernel/intern/armature.c4
-rw-r--r--source/blender/blenkernel/intern/brush.c5
-rw-r--r--source/blender/blenkernel/intern/cachefile.c4
-rw-r--r--source/blender/blenkernel/intern/camera.c4
-rw-r--r--source/blender/blenkernel/intern/collection.c4
-rw-r--r--source/blender/blenkernel/intern/curve.c4
-rw-r--r--source/blender/blenkernel/intern/font.c4
-rw-r--r--source/blender/blenkernel/intern/gpencil.c4
-rw-r--r--source/blender/blenkernel/intern/image.c4
-rw-r--r--source/blender/blenkernel/intern/lattice.c4
-rw-r--r--source/blender/blenkernel/intern/lib_id.c85
-rw-r--r--source/blender/blenkernel/intern/light.c4
-rw-r--r--source/blender/blenkernel/intern/lightprobe.c4
-rw-r--r--source/blender/blenkernel/intern/linestyle.c6
-rw-r--r--source/blender/blenkernel/intern/mask.c4
-rw-r--r--source/blender/blenkernel/intern/material.c4
-rw-r--r--source/blender/blenkernel/intern/mball.c4
-rw-r--r--source/blender/blenkernel/intern/mesh.c4
-rw-r--r--source/blender/blenkernel/intern/movieclip.c4
-rw-r--r--source/blender/blenkernel/intern/node.c4
-rw-r--r--source/blender/blenkernel/intern/object.c12
-rw-r--r--source/blender/blenkernel/intern/paint.c8
-rw-r--r--source/blender/blenkernel/intern/particle.c4
-rw-r--r--source/blender/blenkernel/intern/scene.c4
-rw-r--r--source/blender/blenkernel/intern/sound.c4
-rw-r--r--source/blender/blenkernel/intern/speaker.c4
-rw-r--r--source/blender/blenkernel/intern/text.c4
-rw-r--r--source/blender/blenkernel/intern/texture.c4
-rw-r--r--source/blender/blenkernel/intern/world.c4
30 files changed, 105 insertions, 111 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index d9a3ec65a3e..bcacbccfb28 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -91,9 +91,9 @@ bAction *BKE_action_add(Main *bmain, const char name[])
/* .................................. */
// does copy_fcurve...
-void BKE_action_make_local(Main *bmain, bAction *act, const bool lib_local)
+void BKE_action_make_local(Main *bmain, bAction *act, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &act->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &act->id, flags);
}
/* .................................. */
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 1d4778e6720..476756d0580 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -136,9 +136,9 @@ void BKE_armature_free(bArmature *arm)
}
}
-void BKE_armature_make_local(Main *bmain, bArmature *arm, const bool lib_local)
+void BKE_armature_make_local(Main *bmain, bArmature *arm, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &arm->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &arm->id, flags);
}
static void copy_bonechildren(Bone *bone_dst,
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index aba7df0a936..8abad2d541d 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -766,8 +766,9 @@ void BKE_brush_free(Brush *brush)
BKE_previewimg_free(&(brush->preview));
}
-void BKE_brush_make_local(Main *bmain, Brush *brush, const bool lib_local)
+void BKE_brush_make_local(Main *bmain, Brush *brush, const int flags)
{
+ const bool lib_local = (flags & LIB_ID_MAKELOCAL_FULL_LIBRARY) != 0;
bool is_local = false, is_lib = false;
/* - only lib users: do nothing (unless force_local is set)
@@ -781,7 +782,7 @@ void BKE_brush_make_local(Main *bmain, Brush *brush, const bool lib_local)
if (brush->clone.image) {
/* Special case: ima always local immediately. Clone image should only have one user anyway. */
- BKE_lib_id_make_local(bmain, &brush->clone.image->id, false, false);
+ BKE_lib_id_make_local(bmain, &brush->clone.image->id, false, 0);
}
BKE_library_ID_test_usages(bmain, brush, &is_local, &is_lib);
diff --git a/source/blender/blenkernel/intern/cachefile.c b/source/blender/blenkernel/intern/cachefile.c
index db3202a6bf3..df15031b7bc 100644
--- a/source/blender/blenkernel/intern/cachefile.c
+++ b/source/blender/blenkernel/intern/cachefile.c
@@ -211,9 +211,9 @@ CacheFile *BKE_cachefile_copy(Main *bmain, const CacheFile *cache_file)
return cache_file_copy;
}
-void BKE_cachefile_make_local(Main *bmain, CacheFile *cache_file, const bool lib_local)
+void BKE_cachefile_make_local(Main *bmain, CacheFile *cache_file, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &cache_file->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &cache_file->id, flags);
}
void BKE_cachefile_reload(Depsgraph *depsgraph, CacheFile *cache_file)
diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c
index b27133ab93f..e21e093517e 100644
--- a/source/blender/blenkernel/intern/camera.c
+++ b/source/blender/blenkernel/intern/camera.c
@@ -96,9 +96,9 @@ Camera *BKE_camera_copy(Main *bmain, const Camera *cam)
return cam_copy;
}
-void BKE_camera_make_local(Main *bmain, Camera *cam, const bool lib_local)
+void BKE_camera_make_local(Main *bmain, Camera *cam, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &cam->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &cam->id, flags);
}
/** Free (or release) any data used by this camera (does not free the camera itself). */
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c
index 89e1d431cfb..2699121b63e 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -369,9 +369,9 @@ Collection *BKE_collection_duplicate(Main *bmain,
return collection_new;
}
-void BKE_collection_make_local(Main *bmain, Collection *collection, const bool lib_local)
+void BKE_collection_make_local(Main *bmain, Collection *collection, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &collection->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &collection->id, flags);
}
/********************************* Naming *******************************/
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index e8688cedd9f..81939dbaafc 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -220,9 +220,9 @@ Curve *BKE_curve_copy(Main *bmain, const Curve *cu)
return cu_copy;
}
-void BKE_curve_make_local(Main *bmain, Curve *cu, const bool lib_local)
+void BKE_curve_make_local(Main *bmain, Curve *cu, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &cu->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &cu->id, flags);
}
/* Get list of nurbs from editnurbs structure */
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index 8d3606525d6..44c59bcb00c 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -325,9 +325,9 @@ VFont *BKE_vfont_load_exists(struct Main *bmain, const char *filepath)
return BKE_vfont_load_exists_ex(bmain, filepath, NULL);
}
-void BKE_vfont_make_local(Main *bmain, VFont *vfont, const bool lib_local)
+void BKE_vfont_make_local(Main *bmain, VFont *vfont, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &vfont->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &vfont->id, flags);
}
static VFont *which_vfont(Curve *cu, CharInfo *info)
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index 5cd5724f07d..5713a93d740 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -707,9 +707,9 @@ bGPdata *BKE_gpencil_data_duplicate(Main *bmain, const bGPdata *gpd_src, bool in
return gpd_dst;
}
-void BKE_gpencil_make_local(Main *bmain, bGPdata *gpd, const bool lib_local)
+void BKE_gpencil_make_local(Main *bmain, bGPdata *gpd, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &gpd->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &gpd->id, flags);
}
/* ************************************************** */
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index bf59cfb4216..d54d9a03524 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -462,9 +462,9 @@ Image *BKE_image_copy(Main *bmain, const Image *ima)
return ima_copy;
}
-void BKE_image_make_local(Main *bmain, Image *ima, const bool lib_local)
+void BKE_image_make_local(Main *bmain, Image *ima, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &ima->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &ima->id, flags);
}
void BKE_image_merge(Main *bmain, Image *dest, Image *source)
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index 20d16df8e63..a7033946b2e 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -329,9 +329,9 @@ void BKE_lattice_free(Lattice *lt)
}
}
-void BKE_lattice_make_local(Main *bmain, Lattice *lt, const bool lib_local)
+void BKE_lattice_make_local(Main *bmain, Lattice *lt, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &lt->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &lt->id, flags);
}
typedef struct LatticeDeformData {
diff --git a/source/blender/blenkernel/intern/lib_id.c b/source/blender/blenkernel/intern/lib_id.c
index fd1b70c18e3..73a03294c51 100644
--- a/source/blender/blenkernel/intern/lib_id.c
+++ b/source/blender/blenkernel/intern/lib_id.c
@@ -377,8 +377,9 @@ static void lib_id_copy_ensure_local(Main *bmain, const ID *old_id, ID *new_id)
/**
* Generic 'make local' function, works for most of data-block types...
*/
-void BKE_lib_id_make_local_generic(Main *bmain, ID *id, const bool lib_local)
+void BKE_lib_id_make_local_generic(Main *bmain, ID *id, const int flags)
{
+ const bool lib_local = (flags & LIB_ID_MAKELOCAL_FULL_LIBRARY) != 0;
bool is_local = false, is_lib = false;
/* - only lib users: do nothing (unless force_local is set)
@@ -436,8 +437,10 @@ void BKE_lib_id_make_local_generic(Main *bmain, ID *id, const bool lib_local)
*
* \return true if the block can be made local.
*/
-bool BKE_lib_id_make_local(Main *bmain, ID *id, const bool test, const bool lib_local)
+bool BKE_lib_id_make_local(Main *bmain, ID *id, const bool test, const int flags)
{
+ const bool lib_local = (flags & LIB_ID_MAKELOCAL_FULL_LIBRARY) != 0;
+
/* We don't care whether ID is directly or indirectly linked
* in case we are making a whole lib local... */
if (!lib_local && (id->tag & LIB_TAG_INDIRECT)) {
@@ -447,152 +450,152 @@ bool BKE_lib_id_make_local(Main *bmain, ID *id, const bool test, const bool lib_
switch ((ID_Type)GS(id->name)) {
case ID_SCE:
if (!test) {
- BKE_scene_make_local(bmain, (Scene *)id, lib_local);
+ BKE_scene_make_local(bmain, (Scene *)id, flags);
}
return true;
case ID_OB:
if (!test) {
- BKE_object_make_local(bmain, (Object *)id, lib_local);
+ BKE_object_make_local(bmain, (Object *)id, flags);
}
return true;
case ID_ME:
if (!test) {
- BKE_mesh_make_local(bmain, (Mesh *)id, lib_local);
+ BKE_mesh_make_local(bmain, (Mesh *)id, flags);
}
return true;
case ID_CU:
if (!test) {
- BKE_curve_make_local(bmain, (Curve *)id, lib_local);
+ BKE_curve_make_local(bmain, (Curve *)id, flags);
}
return true;
case ID_MB:
if (!test) {
- BKE_mball_make_local(bmain, (MetaBall *)id, lib_local);
+ BKE_mball_make_local(bmain, (MetaBall *)id, flags);
}
return true;
case ID_MA:
if (!test) {
- BKE_material_make_local(bmain, (Material *)id, lib_local);
+ BKE_material_make_local(bmain, (Material *)id, flags);
}
return true;
case ID_TE:
if (!test) {
- BKE_texture_make_local(bmain, (Tex *)id, lib_local);
+ BKE_texture_make_local(bmain, (Tex *)id, flags);
}
return true;
case ID_IM:
if (!test) {
- BKE_image_make_local(bmain, (Image *)id, lib_local);
+ BKE_image_make_local(bmain, (Image *)id, flags);
}
return true;
case ID_LT:
if (!test) {
- BKE_lattice_make_local(bmain, (Lattice *)id, lib_local);
+ BKE_lattice_make_local(bmain, (Lattice *)id, flags);
}
return true;
case ID_LA:
if (!test) {
- BKE_light_make_local(bmain, (Light *)id, lib_local);
+ BKE_light_make_local(bmain, (Light *)id, flags);
}
return true;
case ID_CA:
if (!test) {
- BKE_camera_make_local(bmain, (Camera *)id, lib_local);
+ BKE_camera_make_local(bmain, (Camera *)id, flags);
}
return true;
case ID_SPK:
if (!test) {
- BKE_speaker_make_local(bmain, (Speaker *)id, lib_local);
+ BKE_speaker_make_local(bmain, (Speaker *)id, flags);
}
return true;
case ID_LP:
if (!test) {
- BKE_lightprobe_make_local(bmain, (LightProbe *)id, lib_local);
+ BKE_lightprobe_make_local(bmain, (LightProbe *)id, flags);
}
return true;
case ID_WO:
if (!test) {
- BKE_world_make_local(bmain, (World *)id, lib_local);
+ BKE_world_make_local(bmain, (World *)id, flags);
}
return true;
case ID_VF:
if (!test) {
- BKE_vfont_make_local(bmain, (VFont *)id, lib_local);
+ BKE_vfont_make_local(bmain, (VFont *)id, flags);
}
return true;
case ID_TXT:
if (!test) {
- BKE_text_make_local(bmain, (Text *)id, lib_local);
+ BKE_text_make_local(bmain, (Text *)id, flags);
}
return true;
case ID_SO:
if (!test) {
- BKE_sound_make_local(bmain, (bSound *)id, lib_local);
+ BKE_sound_make_local(bmain, (bSound *)id, flags);
}
return true;
case ID_GR:
if (!test) {
- BKE_collection_make_local(bmain, (Collection *)id, lib_local);
+ BKE_collection_make_local(bmain, (Collection *)id, flags);
}
return true;
case ID_AR:
if (!test) {
- BKE_armature_make_local(bmain, (bArmature *)id, lib_local);
+ BKE_armature_make_local(bmain, (bArmature *)id, flags);
}
return true;
case ID_AC:
if (!test) {
- BKE_action_make_local(bmain, (bAction *)id, lib_local);
+ BKE_action_make_local(bmain, (bAction *)id, flags);
}
return true;
case ID_NT:
if (!test) {
- ntreeMakeLocal(bmain, (bNodeTree *)id, lib_local);
+ ntreeMakeLocal(bmain, (bNodeTree *)id, flags);
}
return true;
case ID_BR:
if (!test) {
- BKE_brush_make_local(bmain, (Brush *)id, lib_local);
+ BKE_brush_make_local(bmain, (Brush *)id, flags);
}
return true;
case ID_PA:
if (!test) {
- BKE_particlesettings_make_local(bmain, (ParticleSettings *)id, lib_local);
+ BKE_particlesettings_make_local(bmain, (ParticleSettings *)id, flags);
}
return true;
case ID_GD:
if (!test) {
- BKE_gpencil_make_local(bmain, (bGPdata *)id, lib_local);
+ BKE_gpencil_make_local(bmain, (bGPdata *)id, flags);
}
return true;
case ID_MC:
if (!test) {
- BKE_movieclip_make_local(bmain, (MovieClip *)id, lib_local);
+ BKE_movieclip_make_local(bmain, (MovieClip *)id, flags);
}
return true;
case ID_MSK:
if (!test) {
- BKE_mask_make_local(bmain, (Mask *)id, lib_local);
+ BKE_mask_make_local(bmain, (Mask *)id, flags);
}
return true;
case ID_LS:
if (!test) {
- BKE_linestyle_make_local(bmain, (FreestyleLineStyle *)id, lib_local);
+ BKE_linestyle_make_local(bmain, (FreestyleLineStyle *)id, flags);
}
return true;
case ID_PAL:
if (!test) {
- BKE_palette_make_local(bmain, (Palette *)id, lib_local);
+ BKE_palette_make_local(bmain, (Palette *)id, flags);
}
return true;
case ID_PC:
if (!test) {
- BKE_paint_curve_make_local(bmain, (PaintCurve *)id, lib_local);
+ BKE_paint_curve_make_local(bmain, (PaintCurve *)id, flags);
}
return true;
case ID_CF:
if (!test) {
- BKE_cachefile_make_local(bmain, (CacheFile *)id, lib_local);
+ BKE_cachefile_make_local(bmain, (CacheFile *)id, flags);
}
return true;
case ID_WS:
@@ -2232,16 +2235,14 @@ void BKE_library_make_local(Main *bmain,
}
else {
/* In this specific case, we do want to make ID local even if it has no local usage yet...
+ * Note that for objects, we don't want proxy pointers to be cleared yet. This will happen
+ * down the road in this function.
*/
- if (GS(id->name) == ID_OB) {
- /* Special case for objects because we don't want proxy pointers to be
- * cleared yet. This will happen down the road in this function.
- */
- BKE_object_make_local_ex(bmain, (Object *)id, true, false);
- }
- else {
- BKE_lib_id_make_local(bmain, id, false, true);
- }
+ BKE_lib_id_make_local(bmain,
+ id,
+ false,
+ LIB_ID_MAKELOCAL_FULL_LIBRARY |
+ LIB_ID_MAKELOCAL_OBJECT_NO_PROXY_CLEARING);
if (id->newid) {
if (GS(id->newid->name) == ID_OB) {
@@ -2344,7 +2345,7 @@ void BKE_library_make_local(Main *bmain,
else {
/* we can switch the proxy'ing from the linked-in to the made-local proxy.
* BKE_object_make_proxy() shouldn't be used here, as it allocates memory that
- * was already allocated by BKE_object_make_local_ex() (which called BKE_object_copy). */
+ * was already allocated by BKE_object_make_local() (which called BKE_object_copy). */
ob_new->proxy = ob->proxy;
ob_new->proxy_group = ob->proxy_group;
ob_new->proxy_from = ob->proxy_from;
diff --git a/source/blender/blenkernel/intern/light.c b/source/blender/blenkernel/intern/light.c
index 7f89c6f899f..7f8626df409 100644
--- a/source/blender/blenkernel/intern/light.c
+++ b/source/blender/blenkernel/intern/light.c
@@ -129,9 +129,9 @@ Light *BKE_light_localize(Light *la)
return lan;
}
-void BKE_light_make_local(Main *bmain, Light *la, const bool lib_local)
+void BKE_light_make_local(Main *bmain, Light *la, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &la->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &la->id, flags);
}
void BKE_light_free(Light *la)
diff --git a/source/blender/blenkernel/intern/lightprobe.c b/source/blender/blenkernel/intern/lightprobe.c
index 30fbcd4f540..55e7b90d8cf 100644
--- a/source/blender/blenkernel/intern/lightprobe.c
+++ b/source/blender/blenkernel/intern/lightprobe.c
@@ -101,9 +101,9 @@ LightProbe *BKE_lightprobe_copy(Main *bmain, const LightProbe *probe)
return probe_copy;
}
-void BKE_lightprobe_make_local(Main *bmain, LightProbe *probe, const bool lib_local)
+void BKE_lightprobe_make_local(Main *bmain, LightProbe *probe, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &probe->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &probe->id, flags);
}
void BKE_lightprobe_free(LightProbe *probe)
diff --git a/source/blender/blenkernel/intern/linestyle.c b/source/blender/blenkernel/intern/linestyle.c
index 0d7dc7e07e0..c8f21c3f959 100644
--- a/source/blender/blenkernel/intern/linestyle.c
+++ b/source/blender/blenkernel/intern/linestyle.c
@@ -186,11 +186,9 @@ FreestyleLineStyle *BKE_linestyle_copy(struct Main *bmain, const FreestyleLineSt
return linestyle_copy;
}
-void BKE_linestyle_make_local(struct Main *bmain,
- FreestyleLineStyle *linestyle,
- const bool lib_local)
+void BKE_linestyle_make_local(struct Main *bmain, FreestyleLineStyle *linestyle, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &linestyle->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &linestyle->id, flags);
}
FreestyleLineStyle *BKE_linestyle_active_from_view_layer(ViewLayer *view_layer)
diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c
index 170d870ec8a..28ed7606cbf 100644
--- a/source/blender/blenkernel/intern/mask.c
+++ b/source/blender/blenkernel/intern/mask.c
@@ -906,9 +906,9 @@ Mask *BKE_mask_copy(Main *bmain, const Mask *mask)
return mask_copy;
}
-void BKE_mask_make_local(Main *bmain, Mask *mask, const bool lib_local)
+void BKE_mask_make_local(Main *bmain, Mask *mask, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &mask->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &mask->id, flags);
}
void BKE_mask_point_free(MaskSplinePoint *point)
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index a60953f0ed1..af09b4a2db8 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -230,9 +230,9 @@ Material *BKE_material_localize(Material *ma)
return man;
}
-void BKE_material_make_local(Main *bmain, Material *ma, const bool lib_local)
+void BKE_material_make_local(Main *bmain, Material *ma, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &ma->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &ma->id, flags);
}
Material ***BKE_object_material_array(Object *ob)
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index c82928a4094..15a3229aaa7 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -125,9 +125,9 @@ MetaBall *BKE_mball_copy(Main *bmain, const MetaBall *mb)
return mb_copy;
}
-void BKE_mball_make_local(Main *bmain, MetaBall *mb, const bool lib_local)
+void BKE_mball_make_local(Main *bmain, MetaBall *mb, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &mb->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &mb->id, flags);
}
/* most simple meta-element adding function
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index a483a354254..51f37254d8f 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -836,9 +836,9 @@ Mesh *BKE_mesh_from_editmesh_with_coords_thin_wrap(BMEditMesh *em,
return me;
}
-void BKE_mesh_make_local(Main *bmain, Mesh *me, const bool lib_local)
+void BKE_mesh_make_local(Main *bmain, Mesh *me, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &me->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &me->id, flags);
}
BoundBox *BKE_mesh_boundbox_get(Object *ob)
diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c
index 2afdb679518..8e64c02fbb3 100644
--- a/source/blender/blenkernel/intern/movieclip.c
+++ b/source/blender/blenkernel/intern/movieclip.c
@@ -1666,9 +1666,9 @@ MovieClip *BKE_movieclip_copy(Main *bmain, const MovieClip *clip)
return clip_copy;
}
-void BKE_movieclip_make_local(Main *bmain, MovieClip *clip, const bool lib_local)
+void BKE_movieclip_make_local(Main *bmain, MovieClip *clip, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &clip->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &clip->id, flags);
}
float BKE_movieclip_remap_scene_to_clip_frame(const MovieClip *clip, float framenr)
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 5850e1265f9..4793ca93a3b 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -2296,9 +2296,9 @@ ID *BKE_node_tree_find_owner_ID(Main *bmain, struct bNodeTree *ntree)
return NULL;
}
-void ntreeMakeLocal(Main *bmain, bNodeTree *ntree, const bool lib_local)
+void ntreeMakeLocal(Main *bmain, bNodeTree *ntree, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &ntree->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &ntree->id, flags);
}
int ntreeNodeExists(bNodeTree *ntree, bNode *testnode)
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index e9aec7201e2..8d9bffa1637 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1741,11 +1741,10 @@ Object *BKE_object_duplicate(Main *bmain, const Object *ob, const int dupflag)
return obn;
}
-void BKE_object_make_local_ex(Main *bmain,
- Object *ob,
- const bool lib_local,
- const bool clear_proxy)
+void BKE_object_make_local(Main *bmain, Object *ob, const int flags)
{
+ const bool lib_local = (flags & LIB_ID_MAKELOCAL_FULL_LIBRARY) != 0;
+ const bool clear_proxy = (flags & LIB_ID_MAKELOCAL_OBJECT_NO_PROXY_CLEARING) == 0;
bool is_local = false, is_lib = false;
/* - only lib users: do nothing (unless force_local is set)
@@ -1789,11 +1788,6 @@ void BKE_object_make_local_ex(Main *bmain,
}
}
-void BKE_object_make_local(Main *bmain, Object *ob, const bool lib_local)
-{
- BKE_object_make_local_ex(bmain, ob, lib_local, true);
-}
-
/* Returns true if the Object is from an external blend file (libdata) */
bool BKE_object_is_libdata(const Object *ob)
{
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index 8466f67730f..9f05b1656cd 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -517,9 +517,9 @@ PaintCurve *BKE_paint_curve_copy(Main *bmain, const PaintCurve *pc)
return pc_copy;
}
-void BKE_paint_curve_make_local(Main *bmain, PaintCurve *pc, const bool lib_local)
+void BKE_paint_curve_make_local(Main *bmain, PaintCurve *pc, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &pc->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &pc->id, flags);
}
Palette *BKE_paint_palette(Paint *p)
@@ -604,9 +604,9 @@ Palette *BKE_palette_copy(Main *bmain, const Palette *palette)
return palette_copy;
}
-void BKE_palette_make_local(Main *bmain, Palette *palette, const bool lib_local)
+void BKE_palette_make_local(Main *bmain, Palette *palette, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &palette->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &palette->id, flags);
}
void BKE_palette_init(Palette *palette)
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index dce7d643713..a8e43df15a3 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -3837,9 +3837,9 @@ ParticleSettings *BKE_particlesettings_copy(Main *bmain, const ParticleSettings
return part_copy;
}
-void BKE_particlesettings_make_local(Main *bmain, ParticleSettings *part, const bool lib_local)
+void BKE_particlesettings_make_local(Main *bmain, ParticleSettings *part, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &part->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &part->id, flags);
}
/************************************************/
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 59242d5159c..272ce404c35 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -488,11 +488,11 @@ void BKE_scene_groups_relink(Scene *sce)
}
}
-void BKE_scene_make_local(Main *bmain, Scene *sce, const bool lib_local)
+void BKE_scene_make_local(Main *bmain, Scene *sce, const int flags)
{
/* For now should work, may need more work though to support all possible corner cases
* (also scene_copy probably needs some love). */
- BKE_lib_id_make_local_generic(bmain, &sce->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &sce->id, flags);
}
/** Free (or release) any data used by this scene (does not free the scene itself). */
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index ffaec89f579..cd38030faf4 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -217,9 +217,9 @@ void BKE_sound_copy_data(Main *UNUSED(bmain),
BKE_sound_reset_runtime(sound_dst);
}
-void BKE_sound_make_local(Main *bmain, bSound *sound, const bool lib_local)
+void BKE_sound_make_local(Main *bmain, bSound *sound, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &sound->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &sound->id, flags);
}
#ifdef WITH_AUDASPACE
diff --git a/source/blender/blenkernel/intern/speaker.c b/source/blender/blenkernel/intern/speaker.c
index e4c85fda03c..fb16cea093e 100644
--- a/source/blender/blenkernel/intern/speaker.c
+++ b/source/blender/blenkernel/intern/speaker.c
@@ -74,9 +74,9 @@ Speaker *BKE_speaker_copy(Main *bmain, const Speaker *spk)
return spk_copy;
}
-void BKE_speaker_make_local(Main *bmain, Speaker *spk, const bool lib_local)
+void BKE_speaker_make_local(Main *bmain, Speaker *spk, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &spk->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &spk->id, flags);
}
void BKE_speaker_free(Speaker *spk)
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index 09e01723543..c20ef21f486 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -441,9 +441,9 @@ Text *BKE_text_copy(Main *bmain, const Text *ta)
return ta_copy;
}
-void BKE_text_make_local(Main *bmain, Text *text, const bool lib_local)
+void BKE_text_make_local(Main *bmain, Text *text, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &text->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &text->id, flags);
}
void BKE_text_clear(Text *text) /* called directly from rna */
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index 61c48ebbe58..565426e2960 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -386,9 +386,9 @@ Tex *BKE_texture_localize(Tex *tex)
/* ------------------------------------------------------------------------- */
-void BKE_texture_make_local(Main *bmain, Tex *tex, const bool lib_local)
+void BKE_texture_make_local(Main *bmain, Tex *tex, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &tex->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &tex->id, flags);
}
Tex *give_current_linestyle_texture(FreestyleLineStyle *linestyle)
diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c
index d6e28932a36..f8ba4e3085e 100644
--- a/source/blender/blenkernel/intern/world.c
+++ b/source/blender/blenkernel/intern/world.c
@@ -154,9 +154,9 @@ World *BKE_world_localize(World *wrld)
return wrldn;
}
-void BKE_world_make_local(Main *bmain, World *wrld, const bool lib_local)
+void BKE_world_make_local(Main *bmain, World *wrld, const int flags)
{
- BKE_lib_id_make_local_generic(bmain, &wrld->id, lib_local);
+ BKE_lib_id_make_local_generic(bmain, &wrld->id, flags);
}
void BKE_world_eval(struct Depsgraph *depsgraph, World *world)