83 buf[0] = (bhead->
code >> 24) & 0xFF;
84 buf[1] = (bhead->
code >> 16) & 0xFF;
85 buf[2] = (bhead->
code >> 8) & 0xFF;
86 buf[3] = (bhead->
code >> 0) & 0xFF;
88 buf[0] = buf[0] ? buf[0] :
' ';
89 buf[1] = buf[1] ? buf[1] :
' ';
90 buf[2] = buf[2] ? buf[2] :
' ';
91 buf[3] = buf[3] ? buf[3] :
' ';
94 "['%.4s', '%s', %d, %ld ],\n",
98 (
long int)(bhead->
len +
sizeof(
BHead)));
105 const bool use_assets_only,
114 if (bhead->
code == ofblocktype) {
134 const bool use_assets_only,
135 int *r_tot_info_items)
146 if (bhead->
code == ofblocktype) {
150 const bool is_asset = asset_meta_data !=
NULL;
151 const bool skip_datablock = use_assets_only && !is_asset;
152 if (skip_datablock) {
158 if (asset_meta_data) {
173 *r_tot_info_items = tot;
196 for (
int preview_index = 0; preview_index <
NUM_ICON_SIZES; preview_index++) {
197 if (preview_from_file->
rect[preview_index] && preview_from_file->
w[preview_index] &&
198 preview_from_file->
h[preview_index]) {
200 BLI_assert((preview_from_file->
w[preview_index] * preview_from_file->
h[preview_index] *
208 preview_from_file->
w[preview_index] == 0 &&
209 preview_from_file->
h[preview_index] == 0);
211 result->w[preview_index] =
result->h[preview_index] = 0;
224 bool looking =
false;
228 if (bhead->code ==
DATA) {
229 if (looking && bhead->SDNAnr == sdna_preview_image) {
232 if (preview_from_file ==
NULL) {
242 else if (looking || bhead->code ==
ENDB) {
247 else if (bhead->code == ofblocktype) {
269 if (bhead->
code == ofblocktype) {
271 switch (
GS(idname)) {
398 const char *filepath,
void BKE_previewimg_finish(struct PreviewImage *prv, int size)
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(struct Main *mainvar)
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 void BLI_linklist_prepend(LinkNode **listp, void *ptr) ATTR_NONNULL(1)
#define STRNCPY(dst, src)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
Compatibility-like things for windows.
defines for blend-file codes.
external readfile function prototypes.
@ BLO_READ_SKIP_UNDO_OLD_MAIN
struct BlendHandle BlendHandle
void * BLO_library_read_struct(struct FileData *fd, struct BHead *bh, const char *blockname)
blenloader genfile private function prototypes
int DNA_struct_find_nr(const struct SDNA *sdna, const char *str)
Read Guarded memory(de)allocation.
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
BlendHandle * BLO_blendhandle_from_file(const char *filepath, BlendFileReadReport *reports)
PreviewImage * BLO_blendhandle_get_preview_for_id(BlendHandle *bh, int ofblocktype, const char *name)
BlendFileData * BLO_read_from_memory(const void *mem, int memsize, eBLOReadSkip skip_flags, ReportList *reports)
static BHead * blo_blendhandle_read_preview_rects(FileData *fd, BHead *bhead, PreviewImage *result, const PreviewImage *preview_from_file)
void BLO_read_invalidate_message(BlendHandle *bh, Main *bmain, const char *message)
LinkNode * BLO_blendhandle_get_datablock_info(BlendHandle *bh, int ofblocktype, const bool use_assets_only, int *r_tot_info_items)
BlendFileData * BLO_read_from_file(const char *filepath, eBLOReadSkip skip_flags, BlendFileReadReport *reports)
BlendFileData * BLO_read_from_memfile(Main *oldmain, const char *filepath, MemFile *memfile, const struct BlendFileReadParams *params, ReportList *reports)
LinkNode * BLO_blendhandle_get_linkable_groups(BlendHandle *bh)
void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp)
LinkNode * BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype, int *r_tot_prev)
LinkNode * BLO_blendhandle_get_datablock_names(BlendHandle *bh, int ofblocktype, const bool use_assets_only, int *r_tot_names)
void BLO_blendhandle_close(BlendHandle *bh)
BlendHandle * BLO_blendhandle_from_memory(const void *mem, int memsize, BlendFileReadReport *reports)
void BLO_blendfiledata_free(BlendFileData *bfd)
FileData * blo_filedata_from_memfile(MemFile *memfile, const struct BlendFileReadParams *params, BlendFileReadReport *reports)
BlendFileData * blo_read_file_internal(FileData *fd, const char *filepath)
FileData * blo_filedata_from_file(const char *filepath, BlendFileReadReport *reports)
BHead * blo_bhead_first(FileData *fd)
AssetMetaData * blo_bhead_id_asset_data_address(const FileData *fd, const BHead *bhead)
void blo_split_main(ListBase *mainlist, Main *main)
BHead * blo_bhead_next(FileData *fd, BHead *thisblock)
void blo_cache_storage_init(FileData *fd, Main *bmain)
void blo_make_old_idmap_from_main(FileData *fd, Main *bmain)
const char * blo_bhead_id_name(const FileData *fd, const BHead *bhead)
BHead * blo_bhead_prev(FileData *UNUSED(fd), BHead *thisblock)
void blo_filedata_free(FileData *fd)
void blo_readfile_invalidate(FileData *fd, Main *bmain, const char *message)
void blo_cache_storage_old_bmain_clear(FileData *fd, Main *bmain_old)
BHead * blo_read_asset_data_block(FileData *fd, BHead *bhead, AssetMetaData **r_asset_data)
void blo_add_library_pointer_map(ListBase *old_mainlist, FileData *fd)
void blo_join_main(ListBase *mainlist)
FileData * blo_filedata_from_memory(const void *mem, int memsize, BlendFileReadReport *reports)
struct AssetMetaData * asset_data
struct ReportList * reports