89 const char *&r_idname,
94 if (!r_idname || r_idname[0] ==
'\0') {
106 if (use_assets_only && r_asset_meta_data ==
nullptr) {
114 const bool use_assets_only,
123 if (bhead->
code == ofblocktype) {
128 fd, bhead, use_assets_only, idname, idflag, asset_meta_data))
147 const bool use_assets_only,
148 int *r_tot_info_items)
161 if (bhead->
code == ofblocktype) {
162 BHead *id_bhead = bhead;
168 fd, id_bhead, use_assets_only, idname, idflag, asset_meta_data))
173 const char *
name = idname + 2;
177 if (asset_meta_data) {
188 bool has_preview =
false;
193 if (data_bhead->SDNAnr == sdna_nr_preview_image) {
205 *r_tot_info_items = tot;
228 for (
int preview_index = 0; preview_index <
NUM_ICON_SIZES; preview_index++) {
229 if (preview_from_file->
rect[preview_index] && preview_from_file->
w[preview_index] &&
230 preview_from_file->
h[preview_index])
233 BLI_assert((preview_from_file->
w[preview_index] * preview_from_file->
h[preview_index] *
235 result->rect[preview_index] =
static_cast<uint *
>(
242 preview_from_file->
w[preview_index] == 0 &&
243 preview_from_file->
h[preview_index] == 0);
244 result->rect[preview_index] =
nullptr;
245 result->w[preview_index] =
result->h[preview_index] = 0;
258 bool looking =
false;
263 if (looking && bhead->SDNAnr == sdna_preview_image) {
267 if (preview_from_file ==
nullptr) {
272 result->runtime = MEM_new<blender::bke::PreviewImageRuntime>(__func__);
283 else if (bhead->code == ofblocktype) {
378 const char *filepath,
void BKE_asset_metadata_free(AssetMetaData **asset_data)
const char * BKE_idtype_idcode_to_name(short idcode)
bool BKE_idtype_idcode_is_linkable(short idcode)
bool BKE_idtype_idcode_is_valid(short idcode)
void BKE_main_free(Main *bmain)
void BKE_previewimg_finish(PreviewImage *prv, int size)
GSet * BLI_gset_ptr_new(const char *info)
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp)
bool BLI_gset_add(GSet *gs, void *key)
void BLI_linklist_free(LinkNode *list, LinkNodeFreeFP freefunc)
void void BLI_linklist_prepend(LinkNode **listp, void *ptr) ATTR_NONNULL(1)
bool BLI_path_is_abs_from_cwd(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
bool BLI_path_is_rel(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
char * STRNCPY(char(&dst)[N], const char *src)
Compatibility-like things for windows.
external readfile function prototypes.
void * BLO_library_read_struct(FileData *fd, BHead *bh, const char *blockname)
@ ID_FLAG_LINKED_AND_PACKED
blenloader genfile private function prototypes
int DNA_struct_find_with_alias(const struct SDNA *sdna, const char *str)
Read Guarded memory(de)allocation.
void * MEM_mallocN(size_t len, const char *str)
void * MEM_dupallocN(const void *vmemh)
void MEM_freeN(void *vmemh)
VecBase< int32_t, 3 > int3
LinkNode * BLO_blendhandle_get_datablock_info(BlendHandle *bh, int ofblocktype, const bool use_assets_only, int *r_tot_info_items)
void BLO_datablock_info_linklist_free(LinkNode *datablock_infos)
void BLO_datablock_info_free(BLODataBlockInfo *datablock_info)
void BLO_read_invalidate_message(BlendHandle *bh, Main *bmain, const char *message)
PreviewImage * BLO_blendhandle_get_preview_for_id(BlendHandle *bh, int ofblocktype, const char *name)
static bool blendhandle_load_id_data_and_validate(FileData *fd, BHead *bhead, bool use_assets_only, const char *&r_idname, short &r_idflag, AssetMetaData *&r_asset_meta_data)
BlendHandle * BLO_blendhandle_from_file(const char *filepath, BlendFileReadReport *reports)
BlendHandle * BLO_blendhandle_from_memory(const void *mem, int memsize, BlendFileReadReport *reports)
blender::int3 BLO_blendhandle_get_version(const BlendHandle *bh)
BlendFileData * BLO_read_from_memfile(Main *oldmain, const char *filepath, MemFile *memfile, const BlendFileReadParams *params, ReportList *reports)
BlendFileData * BLO_read_from_memory(const void *mem, int memsize, eBLOReadSkip skip_flags, ReportList *reports)
BlendFileData * BLO_read_from_file(const char *filepath, eBLOReadSkip skip_flags, BlendFileReadReport *reports)
static BHead * blo_blendhandle_read_preview_rects(FileData *fd, BHead *bhead, PreviewImage *result, const PreviewImage *preview_from_file)
LinkNode * BLO_blendhandle_get_datablock_names(BlendHandle *bh, int ofblocktype, const bool use_assets_only, int *r_tot_names)
void BLO_read_do_version_after_setup(Main *new_bmain, BlendfileLinkAppendContext *lapp_context, BlendFileReadReport *reports)
LinkNode * BLO_blendhandle_get_linkable_groups(BlendHandle *bh)
void BLO_blendhandle_close(BlendHandle *bh)
void BLO_blendfiledata_free(BlendFileData *bfd)
void blo_join_main(Main *bmain)
const char * blo_bhead_id_name(FileData *fd, const BHead *bhead)
BHead * blo_bhead_next(FileData *fd, BHead *thisblock)
BHead * blo_bhead_first(FileData *fd)
AssetMetaData * blo_bhead_id_asset_data_address(const FileData *fd, const BHead *bhead)
BlendFileData * blo_read_file_internal(FileData *fd, const char *filepath)
FileData * blo_filedata_from_memfile(MemFile *memfile, const BlendFileReadParams *params, BlendFileReadReport *reports)
FileData * blo_filedata_from_file(const char *filepath, BlendFileReadReport *reports)
FileData * blo_filedata_from_memory(const void *mem, const int memsize, BlendFileReadReport *reports)
void blo_cache_storage_init(FileData *fd, Main *bmain)
void blo_make_old_idmap_from_main(FileData *fd, Main *bmain)
BHead * blo_read_asset_data_block(FileData *fd, BHead *bhead, AssetMetaData **r_asset_data)
void blo_split_main(Main *bmain, const bool do_split_packed_ids)
short blo_bhead_id_flag(const FileData *fd, const BHead *bhead)
void blo_filedata_free(FileData *fd)
BHead * blo_bhead_prev(FileData *, BHead *thisblock)
void blo_readfile_invalidate(FileData *fd, Main *bmain, const char *message)
void blo_cache_storage_old_bmain_clear(FileData *fd, Main *bmain_old)
void do_versions_after_setup(Main *new_bmain, BlendfileLinkAppendContext *lapp_context, BlendFileReadReport *reports)
AssetMetaData * asset_data
std::shared_ptr< blender::VectorSet< Main * > > split_mains