diff options
Diffstat (limited to 'source/blender')
34 files changed, 113 insertions, 110 deletions
diff --git a/source/blender/blenkernel/BKE_lib_id.h b/source/blender/blenkernel/BKE_lib_id.h index d9d99d607c5..aa4ccd9dbb8 100644 --- a/source/blender/blenkernel/BKE_lib_id.h +++ b/source/blender/blenkernel/BKE_lib_id.h @@ -179,7 +179,6 @@ void BKE_libblock_management_main_remove(struct Main *bmain, void *idv); void BKE_libblock_management_usercounts_set(struct Main *bmain, void *idv); void BKE_libblock_management_usercounts_clear(struct Main *bmain, void *idv); -void BKE_id_lib_local_paths(struct Main *bmain, struct Library *lib, struct ID *id); void id_lib_extern(struct ID *id); void id_lib_indirect_weak_link(struct ID *id); void id_us_ensure_real(struct ID *id); @@ -191,11 +190,14 @@ void id_fake_user_set(struct ID *id); void id_fake_user_clear(struct ID *id); 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); +void BKE_lib_id_make_local_generic(struct Main *bmain, + struct ID *id, + const bool id_in_mainlist, + const bool lib_local); +bool BKE_lib_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, @@ -205,13 +207,11 @@ bool BKE_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, struct ID *id_sorting_hint); -void BKE_id_expand_local(struct Main *bmain, struct ID *id); -void BKE_id_copy_ensure_local(struct Main *bmain, const struct ID *old_id, struct ID *new_id); +void BKE_lib_id_expand_local(struct Main *bmain, struct ID *id); bool BKE_id_new_name_validate(struct ListBase *lb, struct ID *id, const char *name) ATTR_NONNULL(1, 2); -void id_clear_lib_data(struct Main *bmain, struct ID *id); -void id_clear_lib_data_ex(struct Main *bmain, struct ID *id, const bool id_in_mainlist); +void BKE_lib_id_clear_library_data(struct Main *bmain, struct ID *id); /* Affect whole Main database. */ void BKE_main_id_tag_idcode(struct Main *mainvar, diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 97b6a7b2f40..8477a46bb7e 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -93,7 +93,7 @@ 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) { - BKE_id_make_local_generic(bmain, &act->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &act->id, true, lib_local); } /* .................................. */ diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index d4498017ffd..3e27e9e7514 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -138,7 +138,7 @@ void BKE_armature_free(bArmature *arm) void BKE_armature_make_local(Main *bmain, bArmature *arm, const bool lib_local) { - BKE_id_make_local_generic(bmain, &arm->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &arm->id, true, lib_local); } static void copy_bonechildren(Bone *bone_dst, diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index 7eef2bac3e8..aba7df0a936 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -781,15 +781,15 @@ 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. */ - id_make_local(bmain, &brush->clone.image->id, false, false); + BKE_lib_id_make_local(bmain, &brush->clone.image->id, false, false); } BKE_library_ID_test_usages(bmain, brush, &is_local, &is_lib); if (lib_local || is_local) { if (!is_lib) { - id_clear_lib_data(bmain, &brush->id); - BKE_id_expand_local(bmain, &brush->id); + BKE_lib_id_clear_library_data(bmain, &brush->id); + BKE_lib_id_expand_local(bmain, &brush->id); /* enable fake user by default */ id_fake_user_set(&brush->id); diff --git a/source/blender/blenkernel/intern/cachefile.c b/source/blender/blenkernel/intern/cachefile.c index cfef2a7e8e7..25c4d4aedcf 100644 --- a/source/blender/blenkernel/intern/cachefile.c +++ b/source/blender/blenkernel/intern/cachefile.c @@ -213,7 +213,7 @@ CacheFile *BKE_cachefile_copy(Main *bmain, const CacheFile *cache_file) void BKE_cachefile_make_local(Main *bmain, CacheFile *cache_file, const bool lib_local) { - BKE_id_make_local_generic(bmain, &cache_file->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &cache_file->id, true, lib_local); } 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 77a7c9581ac..bbf5e398017 100644 --- a/source/blender/blenkernel/intern/camera.c +++ b/source/blender/blenkernel/intern/camera.c @@ -98,7 +98,7 @@ Camera *BKE_camera_copy(Main *bmain, const Camera *cam) void BKE_camera_make_local(Main *bmain, Camera *cam, const bool lib_local) { - BKE_id_make_local_generic(bmain, &cam->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &cam->id, true, lib_local); } /** 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 ba0f019e700..8a260e918fd 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -371,7 +371,7 @@ Collection *BKE_collection_duplicate(Main *bmain, void BKE_collection_make_local(Main *bmain, Collection *collection, const bool lib_local) { - BKE_id_make_local_generic(bmain, &collection->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &collection->id, true, lib_local); } /********************************* Naming *******************************/ diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index fe4f814ca1f..be011c10608 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -222,7 +222,7 @@ Curve *BKE_curve_copy(Main *bmain, const Curve *cu) void BKE_curve_make_local(Main *bmain, Curve *cu, const bool lib_local) { - BKE_id_make_local_generic(bmain, &cu->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &cu->id, true, lib_local); } /* Get list of nurbs from editnurbs structure */ diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 3d840c6232c..20a0e794f03 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -327,7 +327,7 @@ VFont *BKE_vfont_load_exists(struct Main *bmain, const char *filepath) void BKE_vfont_make_local(Main *bmain, VFont *vfont, const bool lib_local) { - BKE_id_make_local_generic(bmain, &vfont->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &vfont->id, true, lib_local); } 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 e3d6e73e8c9..ce0ed8a9083 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -709,7 +709,7 @@ bGPdata *BKE_gpencil_data_duplicate(Main *bmain, const bGPdata *gpd_src, bool in void BKE_gpencil_make_local(Main *bmain, bGPdata *gpd, const bool lib_local) { - BKE_id_make_local_generic(bmain, &gpd->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &gpd->id, true, lib_local); } /* ************************************************** */ diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 5761bec98b2..efdcf3a92f4 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -464,7 +464,7 @@ Image *BKE_image_copy(Main *bmain, const Image *ima) void BKE_image_make_local(Main *bmain, Image *ima, const bool lib_local) { - BKE_id_make_local_generic(bmain, &ima->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &ima->id, true, lib_local); } 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 5446640b2dd..2f10bdcf732 100644 --- a/source/blender/blenkernel/intern/lattice.c +++ b/source/blender/blenkernel/intern/lattice.c @@ -331,7 +331,7 @@ void BKE_lattice_free(Lattice *lt) void BKE_lattice_make_local(Main *bmain, Lattice *lt, const bool lib_local) { - BKE_id_make_local_generic(bmain, <->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, <->id, true, lib_local); } typedef struct LatticeDeformData { diff --git a/source/blender/blenkernel/intern/lib_id.c b/source/blender/blenkernel/intern/lib_id.c index 051b43a177e..6f51356f8fb 100644 --- a/source/blender/blenkernel/intern/lib_id.c +++ b/source/blender/blenkernel/intern/lib_id.c @@ -138,11 +138,11 @@ static CLG_LogRef LOG = {.identifier = "bke.lib_id"}; /* ************* general ************************ */ -/* this has to be called from each make_local_* func, we could call - * from id_make_local() but then the make local functions would not be self - * contained. - * also note that the id _must_ have a library - campbell */ -void BKE_id_lib_local_paths(Main *bmain, Library *lib, ID *id) +/** + * This has to be called from each make_local_* func, we could call from BKE_lib_id_make_local() + * but then the make local functions would not be self contained. + * Also note that the id _must_ have a library - campbell */ +static void lib_id_library_local_paths(Main *bmain, Library *lib, ID *id) { const char *bpath_user_data[2] = {BKE_main_blendfile_path(bmain), lib->filepath}; @@ -153,6 +153,47 @@ void BKE_id_lib_local_paths(Main *bmain, Library *lib, ID *id) (void *)bpath_user_data); } +/** + * Pull an ID out of a library (make it local). Only call this for IDs that + * don't have other library users. + */ +static void lib_id_clear_library_data_ex(Main *bmain, ID *id, const bool id_in_mainlist) +{ + bNodeTree *ntree = NULL; + Key *key = NULL; + + lib_id_library_local_paths(bmain, id->lib, id); + + id_fake_user_clear(id); + + id->lib = NULL; + id->tag &= ~(LIB_TAG_INDIRECT | LIB_TAG_EXTERN); + id->flag &= ~LIB_INDIRECT_WEAK_LINK; + if (id_in_mainlist) { + if (BKE_id_new_name_validate(which_libbase(bmain, GS(id->name)), id, NULL)) { + bmain->is_memfile_undo_written = false; + } + } + + /* Internal bNodeTree blocks inside data-blocks also stores id->lib, + * make sure this stays in sync. */ + if ((ntree = ntreeFromID(id))) { + lib_id_clear_library_data_ex( + bmain, &ntree->id, false); /* Datablocks' nodetree is never in Main. */ + } + + /* Same goes for shapekeys. */ + if ((key = BKE_key_from_id(id))) { + lib_id_clear_library_data_ex( + bmain, &key->id, id_in_mainlist); /* sigh, why are keys in Main? */ + } +} + +void BKE_lib_id_clear_library_data(Main *bmain, ID *id) +{ + lib_id_clear_library_data_ex(bmain, id, true); +} + void id_lib_extern(ID *id) { if (id && ID_IS_LINKED(id)) { @@ -294,7 +335,7 @@ void BKE_id_clear_newpoin(ID *id) id->newid = NULL; } -static int id_expand_local_callback(LibraryIDLinkCallbackData *cb_data) +static int lib_id_expand_local_cb(LibraryIDLinkCallbackData *cb_data) { ID *id_self = cb_data->id_self; ID **id_pointer = cb_data->id_pointer; @@ -318,29 +359,29 @@ static int id_expand_local_callback(LibraryIDLinkCallbackData *cb_data) * Expand ID usages of given id as 'extern' (and no more indirect) linked data. * Used by ID copy/make_local functions. */ -void BKE_id_expand_local(Main *bmain, ID *id) +void BKE_lib_id_expand_local(Main *bmain, ID *id) { - BKE_library_foreach_ID_link(bmain, id, id_expand_local_callback, NULL, IDWALK_READONLY); + BKE_library_foreach_ID_link(bmain, id, lib_id_expand_local_cb, NULL, IDWALK_READONLY); } /** * Ensure new (copied) ID is fully made local. */ -void BKE_id_copy_ensure_local(Main *bmain, const ID *old_id, ID *new_id) +static void lib_id_copy_ensure_local(Main *bmain, const ID *old_id, ID *new_id) { if (ID_IS_LINKED(old_id)) { - BKE_id_expand_local(bmain, new_id); - BKE_id_lib_local_paths(bmain, old_id->lib, new_id); + BKE_lib_id_expand_local(bmain, new_id); + lib_id_library_local_paths(bmain, old_id->lib, new_id); } } /** * Generic 'make local' function, works for most of data-block types... */ -void BKE_id_make_local_generic(Main *bmain, - ID *id, - const bool id_in_mainlist, - const bool lib_local) +void BKE_lib_id_make_local_generic(Main *bmain, + ID *id, + const bool id_in_mainlist, + const bool lib_local) { bool is_local = false, is_lib = false; @@ -359,8 +400,8 @@ void BKE_id_make_local_generic(Main *bmain, if (lib_local || is_local) { if (!is_lib) { - id_clear_lib_data_ex(bmain, id, id_in_mainlist); - BKE_id_expand_local(bmain, id); + lib_id_clear_library_data_ex(bmain, id, id_in_mainlist); + BKE_lib_id_expand_local(bmain, id); } else { ID *id_new; @@ -399,7 +440,7 @@ void BKE_id_make_local_generic(Main *bmain, * * \return true if the block can be made local. */ -bool 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 bool lib_local) { /* We don't care whether ID is directly or indirectly linked * in case we are making a whole lib local... */ @@ -772,7 +813,7 @@ bool BKE_id_copy_ex(Main *bmain, const ID *id, ID **r_newid, const int flag) * XXX TODO: is this behavior OK, or should we need own flag to control that? */ if ((flag & LIB_ID_CREATE_NO_MAIN) == 0) { BLI_assert((flag & LIB_ID_COPY_KEEP_LIB) == 0); - BKE_id_copy_ensure_local(bmain, id, *r_newid); + lib_id_copy_ensure_local(bmain, id, *r_newid); } else { (*r_newid)->lib = id->lib; @@ -1924,45 +1965,6 @@ bool BKE_id_new_name_validate(ListBase *lb, ID *id, const char *tname) return result; } -/** - * Pull an ID out of a library (make it local). Only call this for IDs that - * don't have other library users. - */ -void id_clear_lib_data_ex(Main *bmain, ID *id, const bool id_in_mainlist) -{ - bNodeTree *ntree = NULL; - Key *key = NULL; - - BKE_id_lib_local_paths(bmain, id->lib, id); - - id_fake_user_clear(id); - - id->lib = NULL; - id->tag &= ~(LIB_TAG_INDIRECT | LIB_TAG_EXTERN); - id->flag &= ~LIB_INDIRECT_WEAK_LINK; - if (id_in_mainlist) { - if (BKE_id_new_name_validate(which_libbase(bmain, GS(id->name)), id, NULL)) { - bmain->is_memfile_undo_written = false; - } - } - - /* Internal bNodeTree blocks inside data-blocks also stores id->lib, - * make sure this stays in sync. */ - if ((ntree = ntreeFromID(id))) { - id_clear_lib_data_ex(bmain, &ntree->id, false); /* Datablocks' nodetree is never in Main. */ - } - - /* Same goes for shapekeys. */ - if ((key = BKE_key_from_id(id))) { - id_clear_lib_data_ex(bmain, &key->id, id_in_mainlist); /* sigh, why are keys in Main? */ - } -} - -void id_clear_lib_data(Main *bmain, ID *id) -{ - id_clear_lib_data_ex(bmain, id, true); -} - /* next to indirect usage in read/writefile also in editobject.c scene.c */ void BKE_main_id_clear_newpoins(Main *bmain) { @@ -2224,8 +2226,8 @@ void BKE_library_make_local(Main *bmain, * currently there are some indirect usages. So instead of making a copy that we'll likely * get rid of later, directly make that data block local. * Saves a tremendous amount of time with complex scenes... */ - id_clear_lib_data_ex(bmain, id, true); - BKE_id_expand_local(bmain, id); + lib_id_clear_library_data_ex(bmain, id, true); + BKE_lib_id_expand_local(bmain, id); id->tag &= ~LIB_TAG_DOIT; if (GS(id->name) == ID_OB) { @@ -2242,7 +2244,7 @@ void BKE_library_make_local(Main *bmain, BKE_object_make_local_ex(bmain, (Object *)id, true, false); } else { - id_make_local(bmain, id, false, true); + BKE_lib_id_make_local(bmain, id, false, true); } if (id->newid) { diff --git a/source/blender/blenkernel/intern/light.c b/source/blender/blenkernel/intern/light.c index e517b4f8f18..e2527523d64 100644 --- a/source/blender/blenkernel/intern/light.c +++ b/source/blender/blenkernel/intern/light.c @@ -131,7 +131,7 @@ Light *BKE_light_localize(Light *la) void BKE_light_make_local(Main *bmain, Light *la, const bool lib_local) { - BKE_id_make_local_generic(bmain, &la->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &la->id, true, lib_local); } void BKE_light_free(Light *la) diff --git a/source/blender/blenkernel/intern/lightprobe.c b/source/blender/blenkernel/intern/lightprobe.c index c6d025439d5..09f4667fc88 100644 --- a/source/blender/blenkernel/intern/lightprobe.c +++ b/source/blender/blenkernel/intern/lightprobe.c @@ -103,7 +103,7 @@ LightProbe *BKE_lightprobe_copy(Main *bmain, const LightProbe *probe) void BKE_lightprobe_make_local(Main *bmain, LightProbe *probe, const bool lib_local) { - BKE_id_make_local_generic(bmain, &probe->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &probe->id, true, lib_local); } void BKE_lightprobe_free(LightProbe *probe) diff --git a/source/blender/blenkernel/intern/linestyle.c b/source/blender/blenkernel/intern/linestyle.c index 3396a2e448e..6dc8a525993 100644 --- a/source/blender/blenkernel/intern/linestyle.c +++ b/source/blender/blenkernel/intern/linestyle.c @@ -190,7 +190,7 @@ void BKE_linestyle_make_local(struct Main *bmain, FreestyleLineStyle *linestyle, const bool lib_local) { - BKE_id_make_local_generic(bmain, &linestyle->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &linestyle->id, true, lib_local); } 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 513e2863dd5..04fdbd11608 100644 --- a/source/blender/blenkernel/intern/mask.c +++ b/source/blender/blenkernel/intern/mask.c @@ -908,7 +908,7 @@ Mask *BKE_mask_copy(Main *bmain, const Mask *mask) void BKE_mask_make_local(Main *bmain, Mask *mask, const bool lib_local) { - BKE_id_make_local_generic(bmain, &mask->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &mask->id, true, lib_local); } void BKE_mask_point_free(MaskSplinePoint *point) diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index d8d5653730b..e13f9bcf684 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -232,7 +232,7 @@ Material *BKE_material_localize(Material *ma) void BKE_material_make_local(Main *bmain, Material *ma, const bool lib_local) { - BKE_id_make_local_generic(bmain, &ma->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &ma->id, true, lib_local); } Material ***BKE_object_material_array(Object *ob) diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index 1659199656b..752a3b32794 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -127,7 +127,7 @@ MetaBall *BKE_mball_copy(Main *bmain, const MetaBall *mb) void BKE_mball_make_local(Main *bmain, MetaBall *mb, const bool lib_local) { - BKE_id_make_local_generic(bmain, &mb->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &mb->id, true, lib_local); } /* most simple meta-element adding function diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 2191ac53a54..b4419baf845 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -838,7 +838,7 @@ Mesh *BKE_mesh_from_editmesh_with_coords_thin_wrap(BMEditMesh *em, void BKE_mesh_make_local(Main *bmain, Mesh *me, const bool lib_local) { - BKE_id_make_local_generic(bmain, &me->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &me->id, true, lib_local); } BoundBox *BKE_mesh_boundbox_get(Object *ob) diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index 6ea642f9876..85871eb86e6 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -1668,7 +1668,7 @@ MovieClip *BKE_movieclip_copy(Main *bmain, const MovieClip *clip) void BKE_movieclip_make_local(Main *bmain, MovieClip *clip, const bool lib_local) { - BKE_id_make_local_generic(bmain, &clip->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &clip->id, true, lib_local); } 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 9e52f7ea939..0213727e828 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -2298,7 +2298,7 @@ ID *BKE_node_tree_find_owner_ID(Main *bmain, struct bNodeTree *ntree) void ntreeMakeLocal(Main *bmain, bNodeTree *ntree, bool id_in_mainlist, const bool lib_local) { - BKE_id_make_local_generic(bmain, &ntree->id, id_in_mainlist, lib_local); + BKE_lib_id_make_local_generic(bmain, &ntree->id, id_in_mainlist, lib_local); } int ntreeNodeExists(bNodeTree *ntree, bNode *testnode) diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 4d7d5861a09..e9aec7201e2 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1763,8 +1763,8 @@ void BKE_object_make_local_ex(Main *bmain, if (lib_local || is_local) { if (!is_lib) { - id_clear_lib_data(bmain, &ob->id); - BKE_id_expand_local(bmain, &ob->id); + BKE_lib_id_clear_library_data(bmain, &ob->id); + BKE_lib_id_expand_local(bmain, &ob->id); if (clear_proxy) { if (ob->proxy_from != NULL) { ob->proxy_from->proxy = NULL; diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 4da7d8d007a..111d28a4cda 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -519,7 +519,7 @@ PaintCurve *BKE_paint_curve_copy(Main *bmain, const PaintCurve *pc) void BKE_paint_curve_make_local(Main *bmain, PaintCurve *pc, const bool lib_local) { - BKE_id_make_local_generic(bmain, &pc->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &pc->id, true, lib_local); } Palette *BKE_paint_palette(Paint *p) @@ -606,7 +606,7 @@ Palette *BKE_palette_copy(Main *bmain, const Palette *palette) void BKE_palette_make_local(Main *bmain, Palette *palette, const bool lib_local) { - BKE_id_make_local_generic(bmain, &palette->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &palette->id, true, lib_local); } void BKE_palette_init(Palette *palette) diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 0a5637c103b..56aeaeffef4 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3839,7 +3839,7 @@ ParticleSettings *BKE_particlesettings_copy(Main *bmain, const ParticleSettings void BKE_particlesettings_make_local(Main *bmain, ParticleSettings *part, const bool lib_local) { - BKE_id_make_local_generic(bmain, &part->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &part->id, true, lib_local); } /************************************************/ diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index fd1f030c3d3..1e8d680e6fb 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -492,7 +492,7 @@ void BKE_scene_make_local(Main *bmain, Scene *sce, const bool lib_local) { /* For now should work, may need more work though to support all possible corner cases * (also scene_copy probably needs some love). */ - BKE_id_make_local_generic(bmain, &sce->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &sce->id, true, lib_local); } /** 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 719978c64ad..e47ef0cb14f 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -219,7 +219,7 @@ void BKE_sound_copy_data(Main *UNUSED(bmain), void BKE_sound_make_local(Main *bmain, bSound *sound, const bool lib_local) { - BKE_id_make_local_generic(bmain, &sound->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &sound->id, true, lib_local); } #ifdef WITH_AUDASPACE diff --git a/source/blender/blenkernel/intern/speaker.c b/source/blender/blenkernel/intern/speaker.c index 7ab0f9231fa..4d8f010e0db 100644 --- a/source/blender/blenkernel/intern/speaker.c +++ b/source/blender/blenkernel/intern/speaker.c @@ -76,7 +76,7 @@ Speaker *BKE_speaker_copy(Main *bmain, const Speaker *spk) void BKE_speaker_make_local(Main *bmain, Speaker *spk, const bool lib_local) { - BKE_id_make_local_generic(bmain, &spk->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &spk->id, true, lib_local); } void BKE_speaker_free(Speaker *spk) diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index c6428211db3..06738e01afa 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -443,7 +443,7 @@ Text *BKE_text_copy(Main *bmain, const Text *ta) void BKE_text_make_local(Main *bmain, Text *text, const bool lib_local) { - BKE_id_make_local_generic(bmain, &text->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &text->id, true, lib_local); } 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 35026288663..266e91f95ba 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -388,7 +388,7 @@ Tex *BKE_texture_localize(Tex *tex) void BKE_texture_make_local(Main *bmain, Tex *tex, const bool lib_local) { - BKE_id_make_local_generic(bmain, &tex->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &tex->id, true, lib_local); } Tex *give_current_linestyle_texture(FreestyleLineStyle *linestyle) diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c index 02c2a884bda..42b6cca77c9 100644 --- a/source/blender/blenkernel/intern/world.c +++ b/source/blender/blenkernel/intern/world.c @@ -156,7 +156,7 @@ World *BKE_world_localize(World *wrld) void BKE_world_make_local(Main *bmain, World *wrld, const bool lib_local) { - BKE_id_make_local_generic(bmain, &wrld->id, true, lib_local); + BKE_lib_id_make_local_generic(bmain, &wrld->id, true, lib_local); } void BKE_world_eval(struct Depsgraph *depsgraph, World *world) diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 9294f614e18..7a80baf1b80 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -557,7 +557,7 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event) } } else { - if (id_make_local(bmain, id, false, false)) { + if (BKE_lib_id_make_local(bmain, id, false, false)) { BKE_main_id_clear_newpoins(bmain); /* reassign to get get proper updates/notifiers */ @@ -879,7 +879,8 @@ static void template_ID(bContext *C, UI_but_flag_enable(but, UI_BUT_DISABLED); } else { - const bool disabled = (!id_make_local(CTX_data_main(C), id, true /* test */, false) || + const bool disabled = (!BKE_lib_id_make_local( + CTX_data_main(C), id, true /* test */, false) || (idfrom && idfrom->lib)); but = uiDefIconBut(block, UI_BTYPE_BUT, diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index 503a4570352..5a3663a12b9 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -698,8 +698,8 @@ static void id_local_cb(bContext *C, Main *bmain = CTX_data_main(C); /* if the ID type has no special local function, * just clear the lib */ - if (id_make_local(bmain, tselem->id, false, false) == false) { - id_clear_lib_data(bmain, tselem->id); + if (BKE_lib_id_make_local(bmain, tselem->id, false, false) == false) { + BKE_lib_id_clear_library_data(bmain, tselem->id); } else { BKE_main_id_clear_newpoins(bmain); diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 12fa8150d5f..b1c20bcd8f2 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -582,12 +582,12 @@ static void rna_ID_user_remap(ID *id, Main *bmain, ID *new_id) static struct ID *rna_ID_make_local(struct ID *self, Main *bmain, bool clear_proxy) { - /* Special case, as we can't rely on id_make_local(); it clears proxies. */ + /* Special case, as we can't rely on BKE_lib_id_make_local(); it clears proxies. */ if (!clear_proxy && GS(self->name) == ID_OB) { BKE_object_make_local_ex(bmain, (Object *)self, false, clear_proxy); } else { - id_make_local(bmain, self, false, false); + BKE_lib_id_make_local(bmain, self, false, false); } ID *ret_id = self->newid ? self->newid : self; |