|
Blender V5.0
|
#include <optional>#include "CLG_log.h"#include "DNA_ID.h"#include "DNA_collection_types.h"#include "DNA_scene_types.h"#include "BLI_utildefines.h"#include "BLI_ghash.h"#include "BLI_listbase.h"#include "BLI_path_utils.hh"#include "BLI_set.hh"#include "BLI_string.h"#include "BLI_vector_set.hh"#include "BLT_translation.hh"#include "BLO_read_write.hh"#include "BKE_bpath.hh"#include "BKE_id_hash.hh"#include "BKE_idtype.hh"#include "BKE_key.hh"#include "BKE_lib_id.hh"#include "BKE_lib_query.hh"#include "BKE_lib_remap.hh"#include "BKE_library.hh"#include "BKE_main.hh"#include "BKE_main_invariants.hh"#include "BKE_main_namemap.hh"#include "BKE_node.hh"#include "BKE_packedFile.hh"#include "BKE_report.hh"Go to the source code of this file.
Functions | |
| static void | library_runtime_reset (Library *lib) |
| static void | library_init_data (ID *id) |
| static void | library_free_data (ID *id) |
| static void | library_copy_data (Main *bmain, std::optional< Library * > owner_library, ID *id_dst, const ID *id_src, int) |
| static void | library_foreach_id (ID *id, LibraryForeachIDData *data) |
| static void | library_foreach_path (ID *id, BPathForeachPathData *bpath_data) |
| static void | library_blend_write_data (BlendWriter *writer, ID *id, const void *id_address) |
| static void | library_blend_read_data (BlendDataReader *, ID *id) |
| static void | library_blend_read_after_liblink (BlendLibReader *, ID *id) |
| void | BKE_library_filepath_set (Main *bmain, Library *lib, const char *filepath) |
| static void | rebuild_hierarchy_best_parent_find (Main *bmain, blender::Set< Library * > &directly_used_libs, Library *lib) |
| void | BKE_library_main_rebuild_hierarchy (Main *bmain) |
| static Library * | add_archive_library (Main &bmain, Library &reference_library) |
| static void | pack_linked_id (Main &bmain, ID *linked_id, const id_hash::ValidDeepHashes &deep_hashes, blender::Map< IDHash, ID * > &already_packed_ids, blender::VectorSet< ID * > &ids_to_remap, blender::bke::id::IDRemapper &id_remapper) |
| static void | pack_linked_ids (Main &bmain, const blender::Set< ID * > &ids_to_pack) |
Variables | |
| static CLG_LogRef | LOG = {"lib.library"} |
| IDTypeInfo | IDType_ID_LI |
Contains code specific to the Library ID type.
Definition in file library.cc.
Add a new 'archive' copy of the given reference library. It is used to store linked packed IDs.
Definition at line 436 of file library.cc.
References Library::archive_parent_library, BKE_id_name(), BKE_id_new(), BKE_library_filepath_set(), BLI_assert, Library::filepath, Library::flag, Library::id, ID_LI, id_us_ensure_real(), LIBRARY_ASSET_EDITABLE, LIBRARY_FLAG_IS_ARCHIVE, LIBRARY_IS_ASSET_EDIT_FILE, LIBRARY_TAG_RESYNC_REQUIRED, Library::runtime, Main::subversionfile, and Main::versionfile.
Referenced by blender::bke::library::ensure_archive_library().
Definition at line 229 of file library.cc.
References BKE_main_blendfile_path(), BLI_path_abs(), BLI_path_is_rel(), lib, and STRNCPY().
Referenced by add_archive_library(), BLO_main_validate_libraries(), library_foreach_path(), blender::ed::outliner::namebutton_fn(), and blender::bke::tests::TEST_F().
| void BKE_library_main_rebuild_hierarchy | ( | Main * | bmain | ) |
Rebuild the hierarchy of libraries, after e.g. deleting or relocating one, often some indirectly linked libraries lose their 'parent' pointer, making them wrongly directly used ones.
Definition at line 328 of file library.cc.
References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), BKE_main_relations_create(), BKE_main_relations_free(), BLI_assert, BLI_ghash_lookup(), blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, MainIDRelationsEntry::from_ids, ID_IS_LINKED, blender::Vector< T, InlineBufferCapacity, Allocator >::last(), ID::lib, Main::libraries, LISTBASE_FOREACH, MainIDRelationsEntryItem::next, rebuild_hierarchy_best_parent_find(), Main::relations, MainIDRelations::relations_from_pointers, Library::runtime, and blender::Vector< T, InlineBufferCapacity, Allocator >::size().
Referenced by BKE_id_free_us(), blendfile_relocate_postprocess_liboverrides(), and id_delete().
|
static |
Definition at line 189 of file library.cc.
References BLI_assert, lib, and LIBRARY_FLAG_IS_ARCHIVE.
|
static |
Definition at line 183 of file library.cc.
References lib.
|
static |
Definition at line 163 of file library.cc.
References BKE_id_blend_write(), BKE_packedfile_blend_write(), BLO_write_id_struct, BLO_write_is_undo(), CLOG_DEBUG, and LOG.
|
static |
Definition at line 76 of file library.cc.
References BKE_packedfile_duplicate(), BLI_assert, BLI_strncpy(), Main::libraries, Library::packedfile, Library::runtime, blender::bke::library::search_filepath_abs(), and UNUSED_VARS_NDEBUG.
|
static |
Definition at line 110 of file library.cc.
References BKE_LIB_FOREACHID_PROCESS_ID, BKE_LIB_FOREACHID_PROCESS_IDSUPER, BKE_lib_query_foreachid_process_flags_get(), BLI_assert, data, IDWALK_CB_INTERNAL, IDWALK_CB_LOOPBACK, IDWALK_CB_NEVER_NULL, IDWALK_CB_NEVER_SELF, IDWALK_DO_INTERNAL_RUNTIME_POINTERS, lib, and LIBRARY_FLAG_IS_ARCHIVE.
|
static |
Definition at line 146 of file library.cc.
References BKE_bpath_foreach_path_fixed_process(), BKE_library_filepath_set(), BPathForeachPathData::bmain, and lib.
|
static |
Definition at line 66 of file library.cc.
References BKE_packedfile_free(), and library_runtime_reset().
|
static |
Definition at line 60 of file library.cc.
|
static |
Definition at line 55 of file library.cc.
References BKE_main_namemap_destroy(), and lib.
Referenced by library_free_data().
|
static |
Definition at line 506 of file library.cc.
References blender::bke::id::IDRemapper::add(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), BKE_id_copy_in_lib(), BKE_key_from_id(), BLI_assert, ID::deep_hash, blender::bke::library::ensure_archive_library(), GS, blender::bke::id_hash::ValidDeepHashes::hashes, Key::id, ID_IS_PACKED, ID_SCE, id_us_ensure_real(), id_us_min(), ID::lib, LIB_ID_COPY_ASSET_METADATA, LIB_ID_COPY_DEFAULT, LIB_ID_COPY_ID_NEW_SET, LIB_ID_COPY_NO_ANIMDATA, Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default(), ID::name, ID::newid, and UNUSED_VARS_NDEBUG.
Referenced by pack_linked_ids().
|
static |
Pack given linked IDs. Low-level code, assumes all given IDs are valid and safe to pack.
Will set final packed ID into each ID::newid pointers.
Definition at line 601 of file library.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::as_span(), BKE_libblock_relink_multiple(), BKE_main_ensure_invariants(), BLI_assert, CLOG_ERROR, blender::bke::id_hash::compute_linked_id_deep_hashes(), FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, ID_IS_LINKED, ID_IS_PACKED, ID_REMAP_TYPE_REMAP, LOG, and pack_linked_id().
Referenced by blender::bke::library::pack_linked_id_hierarchy().
|
static |
Definition at line 254 of file library.cc.
References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), BLI_assert, BLI_assert_unreachable, BLI_ghash_lookup(), blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), FOREACH_MAIN_LISTBASE_BEGIN, FOREACH_MAIN_LISTBASE_END, FOREACH_MAIN_LISTBASE_ID_BEGIN, FOREACH_MAIN_LISTBASE_ID_END, MainIDRelationsEntry::from_ids, ID_IS_LINKED, ID::lib, lib, MainIDRelationsEntryItem::next, rebuild_hierarchy_best_parent_find(), Main::relations, MainIDRelations::relations_from_pointers, and Library::runtime.
Referenced by BKE_library_main_rebuild_hierarchy(), and rebuild_hierarchy_best_parent_find().
| IDTypeInfo IDType_ID_LI |
Definition at line 198 of file library.cc.
|
static |
Definition at line 50 of file library.cc.