410 const char *library_filepath,
423 const char *library_filepath,
424 const char *library_id_name,
442 const char *library_filepath,
443 const char *library_id_name,
457 const char *library_filepath,
458 const char *library_id_name,
463#define FOREACH_MAIN_LISTBASE_ID_BEGIN(_lb, _id) \
465 ID *_id_next = static_cast<ID *>((_lb)->first); \
466 for ((_id) = _id_next; (_id) != nullptr; (_id) = _id_next) { \
467 _id_next = static_cast<ID *>((_id)->next);
469#define FOREACH_MAIN_LISTBASE_ID_END \
474#define FOREACH_MAIN_LISTBASE_BEGIN(_bmain, _lb) \
476 ListBase *_lbarray[INDEX_ID_MAX]; \
477 int _i = set_listbasepointers((_bmain), _lbarray); \
479 (_lb) = _lbarray[_i];
481#define FOREACH_MAIN_LISTBASE_END \
494#define FOREACH_MAIN_ID_BEGIN(_bmain, _id) \
497 FOREACH_MAIN_LISTBASE_BEGIN ((_bmain), _lb) { \
498 FOREACH_MAIN_LISTBASE_ID_BEGIN (_lb, (_id))
500#define FOREACH_MAIN_ID_END \
501 FOREACH_MAIN_LISTBASE_ID_END; \
503 FOREACH_MAIN_LISTBASE_END; \
572#define MAIN_VERSION_FILE_ATLEAST(main, ver, subver) \
573 ((main)->versionfile > (ver) || \
574 ((main)->versionfile == (ver) && (main)->subversionfile >= (subver)))
576#define MAIN_VERSION_FILE_OLDER(main, ver, subver) \
577 ((main)->versionfile < (ver) || \
578 ((main)->versionfile == (ver) && (main)->subversionfile < (subver)))
580#define MAIN_VERSION_FILE_OLDER_OR_EQUAL(main, ver, subver) \
581 ((main)->versionfile < (ver) || \
582 ((main)->versionfile == (ver) && (main)->subversionfile <= (subver)))
584#define LIBRARY_VERSION_FILE_ATLEAST(lib, ver, subver) \
585 ((lib)->runtime.versionfile > (ver) || \
586 ((lib)->runtime.versionfile == (ver) && (lib)->runtime.subversionfile >= (subver)))
595#define BLEN_THUMB_SIZE 128
597#define BLEN_THUMB_MEMSIZE(_x, _y) \
598 (sizeof(BlendThumbnail) + ((size_t)(_x) * (size_t)(_y)) * sizeof(int))
600#define BLEN_THUMB_MEMSIZE_IS_VALID(_x, _y) \
601 (((_x) > 0 && (_y) > 0) && ((uint64_t)(_x) * (uint64_t)(_y) < (SIZE_MAX / (sizeof(int) * 4))))
BlendThumbnail * BKE_main_thumbnail_from_imbuf(Main *bmain, ImBuf *img)
ListBase * which_libbase(Main *bmain, short type)
void BKE_main_clear(Main &bmain)
void BKE_main_library_weak_reference_destroy(MainLibraryWeakReferenceMap *library_weak_reference_mapping) ATTR_NONNULL()
@ MAINIDRELATIONS_INCLUDE_UI
void BKE_main_merge(Main *bmain_dst, Main **r_bmain_src, MainMergeReport &reports)
void BKE_main_destroy(Main &bmain)
bool BKE_main_needs_overwrite_confirm(const Main *bmain)
bool BKE_main_has_issues(const Main *bmain)
ID * BKE_main_library_weak_reference_search_item(MainLibraryWeakReferenceMap *library_weak_reference_mapping, const char *library_filepath, const char *library_id_name) ATTR_NONNULL()
eMainIDRelationsEntryTags
@ MAINIDRELATIONS_ENTRY_TAGS_INPROGRESS_FROM
@ MAINIDRELATIONS_ENTRY_TAGS_PROCESSED_TO
@ MAINIDRELATIONS_ENTRY_TAGS_PROCESSED
@ MAINIDRELATIONS_ENTRY_TAGS_INPROGRESS
@ MAINIDRELATIONS_ENTRY_TAGS_DOIT
@ MAINIDRELATIONS_ENTRY_TAGS_PROCESSED_FROM
@ MAINIDRELATIONS_ENTRY_TAGS_INPROGRESS_TO
void BKE_main_lock(Main *bmain)
int set_listbasepointers(Main *bmain, ListBase *lb[])
void BKE_main_thumbnail_create(Main *bmain)
void BKE_main_relations_tag_set(Main *bmain, eMainIDRelationsEntryTags tag, bool value)
ImBuf * BKE_main_thumbnail_to_imbuf(Main *bmain, BlendThumbnail *data)
void BKE_main_init(Main &bmain)
Main * BKE_main_new(void)
void BKE_main_free(Main *bmain)
void BKE_main_relations_create(Main *bmain, short flag)
const char * BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL()
MainLibraryWeakReferenceMap * BKE_main_library_weak_reference_create(Main *bmain) ATTR_NONNULL()
BlendThumbnail * BKE_main_thumbnail_from_buffer(Main *bmain, const uint8_t *rect, const int size[2])
void BKE_main_unlock(Main *bmain)
bool BKE_main_is_empty(Main *bmain)
void BKE_main_library_weak_reference_remove_item(MainLibraryWeakReferenceMap *library_weak_reference_mapping, const char *library_filepath, const char *library_id_name, ID *old_id) ATTR_NONNULL()
GSet * BKE_main_gset_create(Main *bmain, GSet *gset)
void BKE_main_library_weak_reference_update_item(MainLibraryWeakReferenceMap *library_weak_reference_mapping, const char *library_filepath, const char *library_id_name, ID *old_id, ID *new_id) ATTR_NONNULL()
void BKE_main_relations_free(Main *bmain)
void BKE_main_library_weak_reference_add_item(MainLibraryWeakReferenceMap *library_weak_reference_mapping, const char *library_filepath, const char *library_id_name, ID *new_id) ATTR_NONNULL()
const char * BKE_main_blendfile_path_from_global()
#define ATTR_NONNULL(...)
These structs are the foundation for all linked lists in the library system.
unsigned __int64 uint64_t
union MainIDRelationsEntryItem::@41 id_pointer
MainIDRelationsEntryItem * next
MainIDRelationsEntryItem * from_ids
MainIDRelationsEntryItem * to_ids
GHash * relations_from_pointers
BLI_mempool * entry_items_pool
int num_remapped_libraries
bool is_locked_for_linking
UniqueName_Map * name_map_global
bool has_forward_compatibility_issues
UniqueName_Map * name_map
bool is_memfile_undo_written
BlendThumbnail * blen_thumb
bool is_action_slot_to_id_map_dirty
uint64_t build_commit_timestamp
bool is_memfile_undo_flush_needed
bool use_memfile_full_barrier
MainIDRelations * relations