84 const bool use_assets_only,
93 if (bhead->
code == ofblocktype) {
113 const bool use_assets_only,
114 int *r_tot_info_items)
127 if (bhead->
code == ofblocktype) {
128 BHead *id_bhead = bhead;
133 const bool is_asset = asset_meta_data !=
nullptr;
134 const bool skip_datablock = use_assets_only && !is_asset;
135 if (skip_datablock) {
142 if (asset_meta_data) {
153 bool has_preview =
false;
158 if (data_bhead->SDNAnr == sdna_nr_preview_image) {
170 *r_tot_info_items = tot;
193 for (
int preview_index = 0; preview_index <
NUM_ICON_SIZES; preview_index++) {
194 if (preview_from_file->
rect[preview_index] && preview_from_file->
w[preview_index] &&
195 preview_from_file->
h[preview_index])
198 BLI_assert((preview_from_file->
w[preview_index] * preview_from_file->
h[preview_index] *
200 result->rect[preview_index] =
static_cast<uint *
>(
207 preview_from_file->
w[preview_index] == 0 &&
208 preview_from_file->
h[preview_index] == 0);
209 result->rect[preview_index] =
nullptr;
210 result->w[preview_index] = result->h[preview_index] = 0;
223 bool looking =
false;
228 if (looking && bhead->SDNAnr == sdna_preview_image) {
232 if (preview_from_file ==
nullptr) {
237 result->
runtime = MEM_new<blender::bke::PreviewImageRuntime>(__func__);
248 else if (bhead->code == ofblocktype) {
250 if (
STREQ(&idname[2], name)) {
343 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
#define STRNCPY(dst, src)
Compatibility-like things for windows.
defines for blend-file codes.
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.
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
void *(* MEM_dupallocN)(const 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)
FileData * blo_filedata_from_memory(const void *mem, int memsize, BlendFileReadReport *reports)
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)
const char * blo_bhead_id_name(const FileData *fd, const BHead *bhead)
FileData * blo_filedata_from_file(const char *filepath, 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
PreviewImageRuntimeHandle * runtime