80 const bool use_assets_only,
89 if (bhead->
code == ofblocktype) {
112 const bool use_assets_only,
113 int *r_tot_info_items)
126 if (bhead->
code == ofblocktype) {
127 BHead *id_bhead = bhead;
133 const char *name = idname + 2;
136 const bool is_asset = asset_meta_data !=
nullptr;
137 const bool skip_datablock = use_assets_only && !is_asset;
138 if (skip_datablock) {
144 if (asset_meta_data) {
155 bool has_preview =
false;
160 if (data_bhead->SDNAnr == sdna_nr_preview_image) {
172 *r_tot_info_items = tot;
195 for (
int preview_index = 0; preview_index <
NUM_ICON_SIZES; preview_index++) {
196 if (preview_from_file->
rect[preview_index] && preview_from_file->
w[preview_index] &&
197 preview_from_file->
h[preview_index])
200 BLI_assert((preview_from_file->
w[preview_index] * preview_from_file->
h[preview_index] *
202 result->rect[preview_index] =
static_cast<uint *
>(
209 preview_from_file->
w[preview_index] == 0 &&
210 preview_from_file->
h[preview_index] == 0);
211 result->rect[preview_index] =
nullptr;
212 result->w[preview_index] =
result->h[preview_index] = 0;
225 bool looking =
false;
230 if (looking && bhead->SDNAnr == sdna_preview_image) {
234 if (preview_from_file ==
nullptr) {
239 result->runtime = MEM_new<blender::bke::PreviewImageRuntime>(__func__);
250 else if (bhead->code == ofblocktype) {
252 if (idname &&
STREQ(&idname[2], name)) {
345 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)
blenloader genfile private function prototypes
int DNA_struct_find_with_alias(const struct SDNA *sdna, const char *str)
Read Guarded memory(de)allocation.
BKE_main_namemap_clear * new_bmain
void * MEM_mallocN(size_t len, const char *str)
void * MEM_dupallocN(const void *vmemh)
void MEM_freeN(void *vmemh)
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)
BlendHandle * BLO_blendhandle_from_file(const char *filepath, BlendFileReadReport *reports)
BlendHandle * BLO_blendhandle_from_memory(const void *mem, int memsize, BlendFileReadReport *reports)
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)
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_split_main(ListBase *mainlist, Main *main)
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_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 blo_join_main(ListBase *mainlist)
void do_versions_after_setup(Main *new_bmain, BlendfileLinkAppendContext *lapp_context, BlendFileReadReport *reports)
AssetMetaData * asset_data