Blender V4.3
BLO_readfile.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4#pragma once
5
6#include "BLI_listbase.h"
7#include "BLI_sys_types.h"
8
14struct AssetMetaData;
15struct BHead;
17struct BlendHandle;
18struct BlendThumbnail;
19struct FileData;
20struct ID;
21struct Library;
22struct LinkNode;
23struct ListBase;
24struct Main;
25struct MemFile;
26struct PreviewImage;
27struct ReportList;
28struct Scene;
29struct UserDef;
30struct View3D;
31struct ViewLayer;
32struct WorkSpace;
33struct bScreen;
34struct wmWindowManager;
35
37 Main *main; /* has to be freed when done reading file data */
38
40};
41
42/* -------------------------------------------------------------------- */
50 // BLENFILETYPE_PUB = 2, /* UNUSED */
51 // BLENFILETYPE_RUNTIME = 3, /* UNUSED */
52};
53
75
89
91 uint skip_flags : 3; /* #eBLOReadSkip */
94
96 int undo_direction; /* #eUndoStepDir */
97};
98
143
155#define BLO_READ_SKIP_ALL (BLO_READ_SKIP_USERDEF | BLO_READ_SKIP_DATA)
156
165BlendFileData *BLO_read_from_file(const char *filepath,
166 eBLOReadSkip skip_flags,
167 BlendFileReadReport *reports);
177BlendFileData *BLO_read_from_memory(const void *mem,
178 int memsize,
179 eBLOReadSkip skip_flags,
180 ReportList *reports);
191 const char *filepath,
192 MemFile *memfile,
194 ReportList *reports);
195
203
215 BlendfileLinkAppendContext *lapp_context,
216 BlendFileReadReport *reports);
217
220/* -------------------------------------------------------------------- */
225 char name[64]; /* MAX_NAME */
237};
238
242void BLO_datablock_info_free(BLODataBlockInfo *datablock_info);
246void BLO_datablock_info_linklist_free(LinkNode * /*BLODataBlockInfo*/ datablock_infos);
247
255BlendHandle *BLO_blendhandle_from_file(const char *filepath, BlendFileReadReport *reports);
263BlendHandle *BLO_blendhandle_from_memory(const void *mem,
264 int memsize,
265 BlendFileReadReport *reports);
266
278 int ofblocktype,
279
280 bool use_assets_only,
281 int *r_tot_names);
296LinkNode * /*BLODataBlockInfo*/ BLO_blendhandle_get_datablock_info(BlendHandle *bh,
297 int ofblocktype,
298 bool use_assets_only,
299 int *r_tot_info_items);
310 int ofblocktype,
311 const char *name);
320
326void BLO_blendhandle_close(BlendHandle *bh) ATTR_NONNULL(1);
327
332void BLO_read_invalidate_message(BlendHandle *bh, Main *bmain, const char *message);
333
343#define BLO_read_assert_message(_check_expr, _ret_value, _bh, _bmain, _message) \
344 if (_check_expr) { \
345 BLO_read_invalidate_message((_bh), (_bmain), (_message)); \
346 return _ret_value; \
347 } \
348 (void)0
349
352#define BLO_GROUP_MAX 32
353#define BLO_EMBEDDED_STARTUP_BLEND "<startup.blend>"
354
355/* -------------------------------------------------------------------- */
386
409
411 Main *bmain,
412 int flag,
413 int id_tag_extra);
415 Main *bmain,
416 int flag,
417 int id_tag_extra,
418 Scene *scene,
419 ViewLayer *view_layer,
420 const View3D *v3d);
421
431Main *BLO_library_link_begin(BlendHandle **bh,
432 const char *filepath,
444 BlendHandle **bh,
445 short idcode,
446 const char *name,
457void BLO_library_link_end(Main *mainl, BlendHandle **bh, const LibraryLink_Params *params);
458
475
477 const char *blend_file_path,
478 short idcode,
479 const char *idname,
480 ReportList *reports);
481void BLO_library_temp_free(TempLibraryContext *temp_lib_ctx);
482
485void *BLO_library_read_struct(FileData *fd, BHead *bh, const char *blockname);
486
487using BLOExpandDoitCallback = void (*)(void *fdhandle, Main *mainvar, void *idv);
488
497void BLO_expand_main(void *fdhandle, Main *mainvar, BLOExpandDoitCallback callback);
498
512void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template);
513void BLO_update_defaults_workspace(WorkSpace *workspace, const char *app_template);
514
517
526BlendThumbnail *BLO_thumbnail_from_file(const char *filepath);
527
534short BLO_version_from_file(const char *filepath);
#define ATTR_NONNULL(...)
unsigned int uint
#define ENUM_OPERATORS(_type, _max)
TempLibraryContext * BLO_library_temp_load_id(Main *real_main, const char *blend_file_path, short idcode, const char *idname, ReportList *reports)
void BLO_datablock_info_linklist_free(LinkNode *datablock_infos)
void BLO_datablock_info_free(BLODataBlockInfo *datablock_info)
BlendThumbnail * BLO_thumbnail_from_file(const char *filepath)
Definition readfile.cc:1422
void(*)(void *fdhandle, Main *mainvar, void *idv) BLOExpandDoitCallback
void BLO_update_defaults_workspace(WorkSpace *workspace, const char *app_template)
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)
LinkNode * BLO_blendhandle_get_datablock_info(BlendHandle *bh, int ofblocktype, bool use_assets_only, int *r_tot_info_items)
void BLO_sanitize_experimental_features_userpref_blend(UserDef *userdef)
eBLOLibLinkFlags
@ BLO_LIBLINK_APPEND_RECURSIVE
@ BLO_LIBLINK_USE_PLACEHOLDERS
@ BLO_LIBLINK_APPEND_ASSET_DATA_CLEAR
@ BLO_LIBLINK_OBDATA_INSTANCE
@ BLO_LIBLINK_APPEND_SET_FAKEUSER
@ BLO_LIBLINK_FORCE_INDIRECT
@ BLO_LIBLINK_APPEND_LOCAL_ID_REUSE
@ BLO_LIBLINK_COLLECTION_INSTANCE
void BLO_library_link_params_init(LibraryLink_Params *params, Main *bmain, int flag, int id_tag_extra)
Definition readfile.cc:4304
eBLOReadSkip
@ BLO_READ_SKIP_DATA
@ BLO_READ_SKIP_USERDEF
@ BLO_READ_SKIP_UNDO_OLD_MAIN
@ BLO_READ_SKIP_NONE
BlendHandle * BLO_blendhandle_from_file(const char *filepath, BlendFileReadReport *reports)
void BLO_library_temp_free(TempLibraryContext *temp_lib_ctx)
BlendHandle * BLO_blendhandle_from_memory(const void *mem, int memsize, BlendFileReadReport *reports)
void BLO_blendhandle_close(BlendHandle *bh) ATTR_NONNULL(1)
ID * BLO_library_link_named_part(Main *mainl, BlendHandle **bh, short idcode, const char *name, const LibraryLink_Params *params)
Definition readfile.cc:4248
BlendFileData * BLO_read_from_memfile(Main *oldmain, const char *filepath, MemFile *memfile, const BlendFileReadParams *params, ReportList *reports)
LinkNode * BLO_blendhandle_get_datablock_names(BlendHandle *bh, int ofblocktype, bool use_assets_only, int *r_tot_names)
void BLO_library_link_params_init_with_context(LibraryLink_Params *params, Main *bmain, int flag, int id_tag_extra, Scene *scene, ViewLayer *view_layer, const View3D *v3d)
Definition readfile.cc:4315
Main * BLO_library_link_begin(BlendHandle **bh, const char *filepath, const LibraryLink_Params *params)
Definition readfile.cc:4332
BlendFileData * BLO_read_from_memory(const void *mem, int memsize, eBLOReadSkip skip_flags, ReportList *reports)
short BLO_version_from_file(const char *filepath)
Definition readfile.cc:1449
void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
void * BLO_library_read_struct(FileData *fd, BHead *bh, const char *blockname)
Definition readfile.cc:4513
BlendFileData * BLO_read_from_file(const char *filepath, eBLOReadSkip skip_flags, BlendFileReadReport *reports)
void BLO_expand_main(void *fdhandle, Main *mainvar, BLOExpandDoitCallback callback)
Definition readfile.cc:4159
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_library_link_end(Main *mainl, BlendHandle **bh, const LibraryLink_Params *params)
Definition readfile.cc:4484
eBlenFileType
@ BLENFILETYPE_BLEND
void BLO_blendfiledata_free(BlendFileData *bfd)
DEGForeachIDComponentCallback callback
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
The meta-data of an asset. By creating and giving this for a data-block (ID.asset_data),...
AssetMetaData * asset_data
UserDef * user
ViewLayer * cur_view_layer
char filepath[1024]
eBlenFileType type
bScreen * curscreen
LinkNode * resynced_lib_overrides_libraries
double lib_overrides_recursive_resync
bool do_resynced_lib_overrides_libraries_list
int resynced_lib_overrides_libraries_count
struct BlendFileReadReport::@127 duration
struct BlendFileReadReport::@128 count
wmWindowManager * old_wm
Definition DNA_ID.h:413
BlendHandle * blendhandle
BlendFileReadReport bf_reports
LibraryLink_Params liblink_params
char app_template[64]
Definition wm_files.cc:1166
uint8_t flag
Definition wm_window.cc:138