Blender V5.0
blender::bke::library Namespace Reference

Classes

struct  LibraryRuntime

Functions

Librarysearch_filepath_abs (ListBase *libraries, blender::StringRef filepath_abs)
void pack_linked_id_hierarchy (Main &bmain, ID &root_id)
void main_cleanup_parent_archives (Main &bmain)
Libraryensure_archive_library (Main &bmain, ID &id, Library &reference_library, const IDHash &id_deep_hash, bool &is_new)

Function Documentation

◆ ensure_archive_library()

Library * blender::bke::library::ensure_archive_library ( Main & bmain,
ID & id,
Library & reference_library,
const IDHash & id_deep_hash,
bool & is_new )

Ensure that there is a valid archive library in given bmain, for the given id, reference_library and id_deep_hash parameters.

Note
Typically, both the reference_library and id_deep_hash are the same as the id library and deephash, but in some cases they may still differ (see e.g. #PartialWriteContext::ensure_library).
Returns
the archive library. is_new is set to true if a new archive library had to be created, false if an existing one could be re-used.

Definition at line 468 of file library.cc.

References add_archive_library(), Library::archive_parent_library, BKE_id_name(), BKE_libblock_find_name_and_library(), BKE_main_namemap_contain_name(), BLI_assert, BLI_assert_msg, ID::deep_hash, Library::flag, GS, Library::id, ID_IS_LINKED, LIBRARY_FLAG_IS_ARCHIVE, name, Library::runtime, and UNUSED_VARS_NDEBUG.

Referenced by pack_linked_id().

◆ main_cleanup_parent_archives()

void blender::bke::library::main_cleanup_parent_archives ( Main & bmain)

Cleanup references to removed/deleted archive libraries in their archive parent.

Definition at line 714 of file library.cc.

References BLI_assert, lib, Main::libraries, LIBRARY_FLAG_IS_ARCHIVE, and LISTBASE_FOREACH.

Referenced by id_delete().

◆ pack_linked_id_hierarchy()

◆ search_filepath_abs()

Library * blender::bke::library::search_filepath_abs ( ListBase * libraries,
blender::StringRef filepath_abs )

Search for given absolute filepath in all libraries in given ListBase.

Definition at line 417 of file library.cc.

References LIBRARY_FLAG_IS_ARCHIVE, and LISTBASE_FOREACH.

Referenced by library_copy_data(), and blender::ed::space_node::NodeClipboard::paste_validate_id_references().