Blender V5.3
BLO_readfile.hh File Reference

external readfile function prototypes. More...

Go to the source code of this file.

Classes

struct  blender::WorkspaceConfigFileData
struct  blender::BlendFileData
struct  blender::BlendFileReadWMSetupData
struct  blender::BlendFileReadParams
struct  blender::BlendFileReadReport
struct  blender::BLODataBlockInfo
struct  blender::BLODataBlockInfo::Library
struct  blender::TempLibraryContext
struct  blender::ID_Readfile_Data
struct  blender::ID_Readfile_Data::Tags

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define BLO_GROUP_MAX   32
#define BLO_EMBEDDED_STARTUP_BLEND   "<startup.blend>"
#define BLEN_THUMB_MEMSIZE_FILE(_x, _y)

Functions

void blender::BLO_update_defaults_startup_blend (Main *bmain, const char *app_template)
void blender::BLO_update_defaults_workspace (WorkSpace *workspace, const char *app_template)
void blender::BLO_sanitize_experimental_features_userpref_blend (UserDef *userdef)
Library Linking (helper functions)
void * blender::BLO_library_read_struct (FileData *fd, BHead *bh, const char *blockname)
Read Thumbnail from Blend File
BlendThumbnail * blender::BLO_thumbnail_from_file (const char *filepath)
short blender::BLO_version_from_file (const char *filepath)
Read ID
ID_Readfile_Data::Tags blender::BLO_readfile_id_runtime_tags (const ID &id)
ID_Readfile_Data::Tags & blender::BLO_readfile_id_runtime_tags_for_write (ID &id)
void blender::BLO_readfile_id_runtime_data_free_all (Main &bmain)
void blender::BLO_readfile_id_runtime_data_free (ID &id)

BLO Read File API

See also
#BLO_write_file for file writing.
#define BLO_READ_SKIP_ALL   (BLO_READ_SKIP_USERDEF | BLO_READ_SKIP_DATA)
enum  blender::eBlenFileType { blender::BLENFILETYPE_BLEND = 1 }
enum  blender::eBLOReadSkip { blender::BLO_READ_SKIP_NONE = 0 , blender::BLO_READ_SKIP_USERDEF = (1 << 0) , blender::BLO_READ_SKIP_DATA = (1 << 1) , blender::BLO_READ_SKIP_UNDO_OLD_MAIN = (1 << 2) }
BlendFileData * blender::BLO_read_from_file (const char *filepath, eBLOReadSkip skip_flags, BlendFileReadReport *reports)
BlendFileData * blender::BLO_read_from_memory (const void *mem, int memsize, eBLOReadSkip skip_flags, ReportList *reports)
BlendFileData * blender::BLO_read_from_memfile (Main *oldmain, const char *filepath, MemFile *memfile, const BlendFileReadParams *params, ReportList *reports)
void blender::BLO_blendfiledata_free (BlendFileData *bfd)
void blender::BLO_read_do_version_after_setup (Main *new_bmain, BlendfileLinkAppendContext *lapp_context, BlendFileReadReport *reports)

BLO Blend File Handle API

#define BLO_read_assert_message(_check_expr, _ret_value, _bh, _bmain, _message)
void blender::BLO_datablock_info_free (BLODataBlockInfo *datablock_info)
void blender::BLO_datablock_info_linklist_free (LinkNode *datablock_infos)
BlendHandle * blender::BLO_blendhandle_from_file (const char *filepath, BlendFileReadReport *reports)
BlendHandle * blender::BLO_blendhandle_from_memory (const void *mem, int memsize, BlendFileReadReport *reports)
int3 blender::BLO_blendhandle_get_version (const BlendHandle *bh)
LinkNode * blender::BLO_blendhandle_get_datablock_names (BlendHandle *bh, int ofblocktype, bool use_assets_only, int *r_tot_names)
LinkNode * blender::BLO_blendhandle_get_datablock_info (BlendHandle *bh, int ofblocktype, bool use_assets_only, int *r_tot_info_items)
PreviewImage * blender::BLO_blendhandle_get_preview_for_id (BlendHandle *bh, int ofblocktype, const char *name)
LinkNode * blender::BLO_blendhandle_get_linkable_groups (BlendHandle *bh)
void blender::BLO_blendhandle_close (BlendHandle *bh) ATTR_NONNULL(1)
void blender::BLO_read_invalidate_message (BlendHandle *bh, Main *bmain, const char *message)

BLO Blend File Linking API

enum  blender::eBLOLibLinkFlags {
  blender::BLO_LIBLINK_USE_PLACEHOLDERS = 1 << 16 , blender::BLO_LIBLINK_FORCE_INDIRECT = 1 << 17 , blender::BLO_LIBLINK_APPEND_SET_OB_ACTIVE_CLIPBOARD = 1 << 18 , blender::BLO_LIBLINK_APPEND_SET_FAKEUSER = 1 << 19 ,
  blender::BLO_LIBLINK_APPEND_RECURSIVE = 1 << 20 , blender::BLO_LIBLINK_APPEND_LOCAL_ID_REUSE = 1 << 21 , blender::BLO_LIBLINK_APPEND_ASSET_DATA_CLEAR = 1 << 22 , blender::BLO_LIBLINK_OBDATA_INSTANCE = 1 << 24 ,
  blender::BLO_LIBLINK_COLLECTION_INSTANCE = 1 << 25 , blender::BLO_LIBLINK_COLLECTION_NO_HIERARCHY_REBUILD = 1 << 26 , blender::BLO_LIBLINK_PACK = 1 << 27
}
void blender::BLO_library_link_params_init (LibraryLink_Params *params, Main *bmain, int flag, int id_tag_extra)
void blender::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)
Main * blender::BLO_library_link_begin (BlendHandle **bh, const char *filepath, const LibraryLink_Params *params)
ID * blender::BLO_library_link_named_part (Main *mainl, BlendHandle **bh, short idcode, const char *name, const LibraryLink_Params *params)
void blender::BLO_library_link_end (Main *mainl, BlendHandle **bh, const LibraryLink_Params *params, ReportList *reports)
TempLibraryContext * blender::BLO_library_temp_load_id (Main *real_main, const char *blend_file_path, short idcode, const char *idname, ReportList *reports)
void blender::BLO_library_temp_free (TempLibraryContext *temp_lib_ctx)

Detailed Description

external readfile function prototypes.

Definition in file BLO_readfile.hh.

Macro Definition Documentation

◆ BLEN_THUMB_MEMSIZE_FILE

#define BLEN_THUMB_MEMSIZE_FILE ( _x,
_y )
Value:
(sizeof(int) * (2 + size_t(_x) * size_t(_y)))

Definition at line 637 of file BLO_readfile.hh.

Referenced by blender::blo_read_file_internal(), blender::BLO_thumbnail_from_file(), blender::read_file_thumbnail(), and blender::write_thumb().

◆ BLO_EMBEDDED_STARTUP_BLEND

#define BLO_EMBEDDED_STARTUP_BLEND   "<startup.blend>"

◆ BLO_GROUP_MAX

#define BLO_GROUP_MAX   32

◆ BLO_read_assert_message

#define BLO_read_assert_message ( _check_expr,
_ret_value,
_bh,
_bmain,
_message )
Value:
if (_check_expr) { \
BLO_read_invalidate_message((_bh), (_bmain), (_message)); \
return _ret_value; \
} \
(void)0

BLI_assert-like macro to check a condition, and if false, fail the whole .blend reading process by marking the Main data-base as invalid, and returning provided _ret_value.

NOTE: About usages:

  • BLI_assert should be used when the error is considered as a bug, but there is some code to recover from it and produce a valid Main data-base.
  • BLO_read_assert_message should be used when the error is not considered as recoverable.

Definition at line 367 of file BLO_readfile.hh.

Referenced by blender::do_versions_after_linking_280().

◆ BLO_READ_SKIP_ALL

#define BLO_READ_SKIP_ALL   (BLO_READ_SKIP_USERDEF | BLO_READ_SKIP_DATA)