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

Classes

struct  LibraryRuntime

Functions

Library * search_filepath_abs (ListBaseT< Library > *libraries, StringRef filepath_abs)
Set< ID * > pack_linked_id_hierarchy (Main &bmain, ID &root_id)
void main_cleanup_parent_archives (Main &bmain)
Library * ensure_archive_library (Main &bmain, ID &id, Library &reference_library, const IDHash &id_deep_hash, bool &is_new)
Library * create_external_archive_library (Main &bmain, Library &external_library)

Function Documentation

◆ create_external_archive_library()

◆ 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 deep-hash, 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 542 of file library.cc.

References blender::add_archive_library(), blender::Library::archive_parent_library, blender::bke::library::LibraryRuntime::archived_libraries, blender::BKE_id_name(), blender::BKE_libblock_find_name_and_library(), blender::BKE_main_namemap_contain_name(), blender::BLI_assert(), BLI_assert_msg, blender::ID::deep_hash, blender::Library::flag, blender::Library::id, ID_IS_LINKED, blender::LIBRARY_FLAG_IS_ARCHIVE, blender::Library::runtime, and UNUSED_VARS_NDEBUG.

Referenced by blender::BKE_libblock_management_main_add(), blender::pack_linked_id(), and blender::bke::tests::TEST_F().

◆ 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 833 of file library.cc.

References blender::bke::library::LibraryRuntime::archived_libraries, blender::BLI_assert(), blender::Library::flag, blender::Main::libraries, blender::LIBRARY_FLAG_IS_ARCHIVE, and blender::Library::runtime.

Referenced by blender::id_delete().

◆ pack_linked_id_hierarchy()

◆ search_filepath_abs()

Library * blender::bke::library::search_filepath_abs ( ListBaseT< Library > * libraries,
StringRef filepath_abs )

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

Definition at line 492 of file library.cc.

References blender::LIBRARY_FLAG_IS_ARCHIVE.

Referenced by blender::bke::asset_edit_id_from_weak_reference(), and blender::library_copy_data().