52 int i = lbarray.size();
54 for (
ID *
id =
static_cast<ID *
>(lbarray[
i]->first);
id !=
nullptr;
55 id =
static_cast<ID *
>(
id->next))
61 "ID %s is in local database while being linked from library %s!",
68 for (
Main *curmain : split_mains) {
69 if (curmain == bmain) {
72 Library *curlib = curmain->curlib;
73 if (curlib ==
nullptr) {
86 "Library ID %s not found at expected path %s!",
95 ID *
id =
static_cast<ID *
>(lbarray[
i]->first);
104 "Library ID %s in library %s, this should not happen!",
112 for (;
id !=
nullptr;
id =
static_cast<ID *
>(
id->next)) {
117 "ID %s has null lib pointer while being in library %s!",
122 if (id->
lib != curlib) {
130 const char *str_name = (
const char *)
name->link;
131 if (id->
name[2] == str_name[0] &&
STREQ(str_name, id->
name + 2)) {
136 if (
name ==
nullptr) {
140 "ID %s not found in library %s anymore!",
165 bool is_valid =
true;
177 if (shapekey !=
nullptr && shapekey->
from !=
id) {
181 "ID %s uses shapekey %s, but its 'from' pointer is invalid (%p), fixing...",
198 if (shapekey->from !=
nullptr) {
204 "ShapeKey %s has an invalid 'from' pointer (%p), it will be deleted",
230 Scene *scene =
reinterpret_cast<Scene *
>(id_iter);
247 &
LOG,
"ID %s is flagged as embedded, while existing in Main data-base", id_iter->
name);
255 "ID %s has an embedded nodetree which is not flagged as embedded",
262 Scene *scene =
reinterpret_cast<Scene *
>(id_iter);
267 "ID %s has an embedded Collection which is not flagged as embedded",
Key * BKE_key_from_id(ID *id)
bool BKE_key_idtype_support(short id_type)
void BKE_id_delete_ex(Main *bmain, void *idv, const int extra_remapping_flags) ATTR_NONNULL(1
@ ID_REMAP_FORCE_UI_POINTERS
void BKE_library_filepath_set(Main *bmain, Library *lib, const char *filepath)
#define FOREACH_MAIN_ID_END
MainListsArray BKE_main_lists_get(Main &bmain)
#define FOREACH_MAIN_LISTBASE_ID_END
std::array< ListBase *, INDEX_ID_MAX - 1 > MainListsArray
#define FOREACH_MAIN_LISTBASE_ID_BEGIN(_lb, _id)
#define FOREACH_MAIN_LISTBASE_END
void BKE_main_lock(Main *bmain)
#define FOREACH_MAIN_LISTBASE_BEGIN(_bmain, _lb)
#define FOREACH_MAIN_ID_BEGIN(_bmain, _id)
void BKE_main_unlock(Main *bmain)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
void BLI_linklist_freeN(LinkNode *list)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
Utilities ensuring .blend file (i.e. Main) is in valid state during write and/or read process.
external readfile function prototypes.
BlendHandle * BLO_blendhandle_from_file(const char *filepath, BlendFileReadReport *reports)
void BLO_blendhandle_close(BlendHandle *bh) ATTR_NONNULL(1)
LinkNode * BLO_blendhandle_get_datablock_names(BlendHandle *bh, int ofblocktype, bool use_assets_only, int *r_tot_names)
#define CLOG_ERROR(clg_ref,...)
#define ID_IS_LINKED(_id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
@ ID_FLAG_EMBEDDED_DATA_LIB_OVERRIDE
Object groups, one object can be in many groups at once.
void BLO_main_validate_embedded_liboverrides(Main *bmain, ReportList *)
void BLO_main_validate_embedded_flag(Main *bmain, ReportList *)
bool BLO_main_validate_libraries(Main *bmain, ReportList *reports)
bool BLO_main_validate_shapekeys(Main *bmain, ReportList *reports)
bNodeTree * node_tree_from_id(ID *id)
void blo_join_main(Main *bmain)
void blo_split_main(Main *bmain, const bool do_split_packed_ids)
LibraryRuntimeHandle * runtime
std::shared_ptr< blender::VectorSet< Main * > > split_mains
struct Collection * master_collection