54 int i = lbarray.size();
56 for (
ID *
id = lbarray[i]->first();
id !=
nullptr;
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 = 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) {
129 for (; name; name = name->
next) {
130 const char *str_name =
static_cast<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...",
197 for (
Key &shapekey : bmain->
shapekeys.items_mutable()) {
198 if (shapekey.from !=
nullptr) {
204 "ShapeKey %s has an invalid 'from' pointer (%p), it will be deleted",
218 .prevent_invariants_update =
true});
237 if (id_iter->id_type() ==
ID_SCE) {
238 Scene *scene =
reinterpret_cast<Scene *
>(id_iter);
255 &
LOG,
"ID %s is flagged as embedded, while existing in Main data-base", id_iter->
name);
263 "ID %s has an embedded nodetree which is not flagged as embedded",
269 if (id_iter->id_type() ==
ID_SCE) {
270 Scene *scene =
reinterpret_cast<Scene *
>(id_iter);
275 "ID %s has an embedded Collection which is not flagged as embedded",
#define FOREACH_MAIN_ID_END
#define FOREACH_MAIN_LISTBASE_ID_END
#define FOREACH_MAIN_LISTBASE_ID_BEGIN(_lb, _id)
#define FOREACH_MAIN_LISTBASE_END
#define FOREACH_MAIN_LISTBASE_BEGIN(_bmain, _lb)
#define FOREACH_MAIN_ID_BEGIN(_bmain, _id)
Utilities ensuring .blend file (i.e. Main) is in valid state during write and/or read process.
external readfile function prototypes.
#define CLOG_ERROR(clg_ref,...)
#define ID_IS_LINKED(_id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
Object groups, one object can be in many groups at once.
bNodeTree * node_tree_from_id(ID *id)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
BlendHandle * BLO_blendhandle_from_file(const char *filepath, BlendFileReadReport *reports)
std::array< ListBaseT< ID > *, INDEX_ID_MAX - 1 > MainListsArray
bool BKE_key_idtype_support(short id_type)
void BKE_id_delete(Main *bmain, void *idv, const BKEIDDeleteOptions &options={}) ATTR_NONNULL()
void BLO_blendhandle_close(BlendHandle *bh) ATTR_NONNULL(1)
@ ID_REMAP_FORCE_UI_POINTERS
MainListsArray BKE_main_lists_get(Main &bmain)
bool BLO_main_validate_libraries(Main *bmain, ReportList *reports)
Key * BKE_key_from_id(ID *id)
void BLI_linklist_freeN(LinkNode *list)
void blo_split_main(Main *bmain, const bool do_split_packed_ids)
void BKE_report(ReportList *reports, eReportType type, const char *message)
void BLO_main_validate_embedded_liboverrides(Main *bmain, ReportList *reports)
void BLO_main_validate_embedded_flag(Main *bmain, ReportList *reports)
void BKE_library_filepath_set(Main *bmain, Library *lib, const char *filepath)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_main_unlock(Main *bmain)
LinkNode * BLO_blendhandle_get_datablock_names(BlendHandle *bh, int ofblocktype, bool use_assets_only, int *r_tot_names)
void BKE_main_lock(Main *bmain)
@ ID_FLAG_EMBEDDED_DATA_LIB_OVERRIDE
bool BLO_main_validate_shapekeys(Main *bmain, ReportList *reports)
void blo_join_main(Main *bmain)
bke::library::LibraryRuntime * runtime
ListBaseT< Key > shapekeys
std::shared_ptr< VectorSet< Main * > > split_mains
struct Collection * master_collection