|
Blender
V2.93
|
external readfile function prototypes. More...
Go to the source code of this file.
Classes | |
| struct | WorkspaceConfigFileData |
| struct | BlendFileData |
| struct | BlendFileReadParams |
| struct | BLODataBlockInfo |
| struct | LibraryLink_Params |
| struct | TempLibraryContext |
Macros | |
| #define | BLO_GROUP_MAX 32 |
| #define | BLO_EMBEDDED_STARTUP_BLEND "<startup.blend>" |
Typedefs | |
| typedef struct BlendHandle | BlendHandle |
| typedef struct WorkspaceConfigFileData | WorkspaceConfigFileData |
| typedef void(* | BLOExpandDoitCallback) (void *fdhandle, struct Main *mainvar, void *idv) |
Functions | |
| bool | BLO_has_bfile_extension (const char *str) |
| bool | BLO_library_path_explode (const char *path, char *r_dir, char **r_group, char **r_name) |
| void * | BLO_library_read_struct (struct FileData *fd, struct BHead *bh, const char *blockname) |
| void | blo_lib_link_restore (struct Main *oldmain, struct Main *newmain, struct wmWindowManager *curwm, struct Scene *curscene, struct ViewLayer *cur_view_layer) |
| void | BLO_main_expander (BLOExpandDoitCallback expand_doit_func) |
| void | BLO_expand_main (void *fdhandle, struct Main *mainvar) |
| void | BLO_update_defaults_startup_blend (struct Main *bmain, const char *app_template) |
| void | BLO_update_defaults_workspace (struct WorkSpace *workspace, const char *app_template) |
| void | BLO_sanitize_experimental_features_userpref_blend (struct UserDef *userdef) |
| struct BlendThumbnail * | BLO_thumbnail_from_file (const char *filepath) |
BLO Blend File Handle API | |
| BlendHandle * | BLO_blendhandle_from_file (const char *filepath, struct ReportList *reports) |
| BlendHandle * | BLO_blendhandle_from_memory (const void *mem, int memsize) |
| struct LinkNode * | BLO_blendhandle_get_datablock_names (BlendHandle *bh, int ofblocktype, const bool use_assets_only, int *r_tot_names) |
| struct LinkNode * | BLO_blendhandle_get_datablock_info (BlendHandle *bh, int ofblocktype, int *r_tot_info_items) |
| struct LinkNode * | BLO_blendhandle_get_previews (BlendHandle *bh, int ofblocktype, int *r_tot_prev) |
| struct LinkNode * | BLO_blendhandle_get_linkable_groups (BlendHandle *bh) |
| void | BLO_blendhandle_close (BlendHandle *bh) |
Variables | |
| const struct bTheme | U_theme_default |
| const struct UserDef | U_default |
BLO Read File API | |
| |
| #define | BLO_READ_SKIP_ALL (BLO_READ_SKIP_USERDEF | BLO_READ_SKIP_DATA) |
| enum | eBlenFileType { BLENFILETYPE_BLEND = 1 } |
| enum | eBLOReadSkip { BLO_READ_SKIP_NONE = 0 , BLO_READ_SKIP_USERDEF = (1 << 0) , BLO_READ_SKIP_DATA = (1 << 1) , BLO_READ_SKIP_UNDO_OLD_MAIN = (1 << 2) } |
| typedef enum eBlenFileType | eBlenFileType |
| typedef struct BlendFileData | BlendFileData |
| typedef enum eBLOReadSkip | eBLOReadSkip |
| BlendFileData * | BLO_read_from_file (const char *filepath, eBLOReadSkip skip_flags, struct ReportList *reports) |
| BlendFileData * | BLO_read_from_memory (const void *mem, int memsize, eBLOReadSkip skip_flags, struct ReportList *reports) |
| BlendFileData * | BLO_read_from_memfile (struct Main *oldmain, const char *filename, struct MemFile *memfile, const struct BlendFileReadParams *params, struct ReportList *reports) |
| void | BLO_blendfiledata_free (BlendFileData *bfd) |
BLO Blend File Linking API | |
| enum | eBLOLibLinkFlags { BLO_LIBLINK_USE_PLACEHOLDERS = 1 << 16 , BLO_LIBLINK_FORCE_INDIRECT = 1 << 17 , BLO_LIBLINK_NEEDS_ID_TAG_DOIT = 1 << 18 } |
| typedef enum eBLOLibLinkFlags | eBLOLibLinkFlags |
| typedef struct TempLibraryContext | TempLibraryContext |
| void | BLO_library_link_params_init (struct LibraryLink_Params *params, struct Main *bmain, const int flag, const int id_tag_extra) |
| void | BLO_library_link_params_init_with_context (struct LibraryLink_Params *params, struct Main *bmain, const int flag, const int id_tag_extra, struct Scene *scene, struct ViewLayer *view_layer, const struct View3D *v3d) |
| struct Main * | BLO_library_link_begin (BlendHandle **bh, const char *filepath, const struct LibraryLink_Params *params) |
| struct ID * | BLO_library_link_named_part (struct Main *mainl, BlendHandle **bh, const short idcode, const char *name, const struct LibraryLink_Params *params) |
| void | BLO_library_link_end (struct Main *mainl, BlendHandle **bh, const struct LibraryLink_Params *params) |
| int | BLO_library_link_copypaste (struct Main *mainl, BlendHandle *bh, const uint64_t id_types_mask) |
| TempLibraryContext * | BLO_library_temp_load_id (struct Main *real_main, const char *blend_file_path, const short idcode, const char *idname, struct ReportList *reports) |
| void | BLO_library_temp_free (TempLibraryContext *temp_lib_ctx) |
external readfile function prototypes.
Definition in file BLO_readfile.h.
| #define BLO_EMBEDDED_STARTUP_BLEND "<startup.blend>" |
Definition at line 147 of file BLO_readfile.h.
| #define BLO_GROUP_MAX 32 |
Definition at line 146 of file BLO_readfile.h.
| #define BLO_READ_SKIP_ALL (BLO_READ_SKIP_USERDEF | BLO_READ_SKIP_DATA) |
Definition at line 100 of file BLO_readfile.h.
| typedef struct BlendFileData BlendFileData |
| typedef struct BlendHandle BlendHandle |
Definition at line 1 of file BLO_readfile.h.
| typedef void(* BLOExpandDoitCallback) (void *fdhandle, struct Main *mainvar, void *idv) |
Definition at line 259 of file BLO_readfile.h.
| typedef enum eBlenFileType eBlenFileType |
| typedef enum eBLOLibLinkFlags eBLOLibLinkFlags |
Options controlling behavior of append/link code.
| typedef enum eBLOReadSkip eBLOReadSkip |
| typedef struct TempLibraryContext TempLibraryContext |
Struct for temporarily loading datablocks from a blend file.
| typedef struct WorkspaceConfigFileData WorkspaceConfigFileData |
| enum eBlenFileType |
| Enumerator | |
|---|---|
| BLENFILETYPE_BLEND | |
Definition at line 63 of file BLO_readfile.h.
| enum eBLOLibLinkFlags |
Options controlling behavior of append/link code.
| Enumerator | |
|---|---|
| BLO_LIBLINK_USE_PLACEHOLDERS | Generate a placeholder (empty ID) if not found in current lib file. |
| BLO_LIBLINK_FORCE_INDIRECT | Force loaded ID to be tagged as LIB_TAG_INDIRECT (used in reload context only). |
| BLO_LIBLINK_NEEDS_ID_TAG_DOIT | When set, tag ID types that pass the internal check library_link_idcode_needs_tag_check Currently this is only used to instantiate objects in the scene. Set this from BLO_library_link_params_init_with_context so callers don't need to remember to set this flag. |
Definition at line 161 of file BLO_readfile.h.
| enum eBLOReadSkip |
| Enumerator | |
|---|---|
| BLO_READ_SKIP_NONE | |
| BLO_READ_SKIP_USERDEF | |
| BLO_READ_SKIP_DATA | |
| BLO_READ_SKIP_UNDO_OLD_MAIN | Do not attempt to re-use IDs from old bmain for unchanged ones in case of undo. |
Definition at line 93 of file BLO_readfile.h.
| void BLO_blendfiledata_free | ( | BlendFileData * | bfd | ) |
Frees a BlendFileData structure and all the data associated with it (the userdef data, and the main libblock data).
| bfd | The structure to free. |
Definition at line 482 of file readblenentry.c.
References BKE_main_free(), BlendFileData::main, MEM_freeN, and BlendFileData::user.
Referenced by BKE_blendfile_read_setup_ex(), and BlendfileLoadingBaseTest::blendfile_free().
| void BLO_blendhandle_close | ( | BlendHandle * | bh | ) |
Close and free a blendhandle. The handle becomes invalid after this call.
| bh | The handle to close. |
Definition at line 350 of file readblenentry.c.
References blo_filedata_free().
Referenced by BKE_copybuffer_paste(), BKE_copybuffer_read(), BLO_library_temp_free(), BLO_main_validate_libraries(), bpy_lib_exit(), filelist_freelib(), filelist_readjob_list_lib(), IMB_thumb_load_blend(), and wm_link_do().
| BlendHandle* BLO_blendhandle_from_file | ( | const char * | filepath, |
| ReportList * | reports | ||
| ) |
Open a blendhandle from a file path.
| filepath | The file path to open. |
| reports | Report errors in opening the file (can be NULL). |
Definition at line 71 of file readblenentry.c.
References blo_filedata_from_file().
Referenced by BKE_copybuffer_paste(), BKE_copybuffer_read(), BLO_library_temp_load_id(), BLO_main_validate_libraries(), bpy_lib_enter(), filelist_readjob_list_lib(), IMB_thumb_load_blend(), and wm_link_do().
| BlendHandle* BLO_blendhandle_from_memory | ( | const void * | mem, |
| int | memsize | ||
| ) |
Open a blendhandle from memory.
| mem | The data to load from. |
| memsize | The size of the data. |
Definition at line 87 of file readblenentry.c.
References blo_filedata_from_memory(), and NULL.
Referenced by wm_link_do().
| struct LinkNode* BLO_blendhandle_get_datablock_info | ( | BlendHandle * | bh, |
| int | ofblocktype, | ||
| int * | r_tot_info_items | ||
| ) |
Gets the names and asset-data (if ID is an asset) of all the data-blocks in a file of a certain type (e.g. all the scene names in a file).
| bh | The blendhandle to access. |
| ofblocktype | The type of names to get. |
| tot_info_items | The length of the returned list. |
Definition at line 180 of file readblenentry.c.
References BLODataBlockInfo::asset_data, BLI_linklist_prepend(), blo_bhead_first(), blo_bhead_id_asset_data_address(), blo_bhead_id_name(), blo_bhead_next(), blo_bhead_prev(), blo_read_asset_data_block(), BHead::code, ENDB, MEM_mallocN, BLODataBlockInfo::name, NULL, and STRNCPY.
Referenced by filelist_readjob_list_lib().
| struct LinkNode* BLO_blendhandle_get_datablock_names | ( | BlendHandle * | bh, |
| int | ofblocktype, | ||
| const bool | use_assets_only, | ||
| int * | r_tot_names | ||
| ) |
Gets the names of all the data-blocks in a file of a certain type (e.g. all the scene names in a file).
| bh | The blendhandle to access. |
| ofblocktype | The type of names to get. |
| tot_names | The length of the returned list. |
| use_assets_only | Only list IDs marked as assets. |
Definition at line 141 of file readblenentry.c.
References BLI_linklist_prepend(), BLI_strdup(), blo_bhead_first(), blo_bhead_id_asset_data_address(), blo_bhead_id_name(), blo_bhead_next(), BHead::code, ENDB, names, and NULL.
Referenced by _bpy_names(), BLO_main_validate_libraries(), and IMB_thumb_load_blend().
| struct LinkNode* BLO_blendhandle_get_linkable_groups | ( | BlendHandle * | bh | ) |
Gets the names of all the linkable data-block types available in a file. (e.g. "Scene", "Mesh", "Light", etc.).
| bh | The blendhandle to access. |
Definition at line 318 of file readblenentry.c.
References BKE_idtype_idcode_is_linkable(), BKE_idtype_idcode_is_valid(), BKE_idtype_idcode_to_name(), BLI_gset_add(), BLI_gset_free(), BLI_gset_ptr_new(), BLI_linklist_prepend(), BLI_strdup(), blo_bhead_first(), blo_bhead_next(), BHead::code, ENDB, names, NULL, and str.
Referenced by filelist_readjob_list_lib().
| struct LinkNode* BLO_blendhandle_get_previews | ( | BlendHandle * | bh, |
| int | ofblocktype, | ||
| int * | r_tot_prev | ||
| ) |
Gets the previews of all the data-blocks in a file of a certain type (e.g. all the scene previews in a file).
| bh | The blendhandle to access. |
| ofblocktype | The type of names to get. |
| r_tot_prev | The length of the returned list. |
Definition at line 226 of file readblenentry.c.
References BKE_previewimg_finish(), BLI_assert, BLI_linklist_prepend(), blo_bhead_first(), blo_bhead_id_name(), blo_bhead_next(), BLO_library_read_struct(), BHead::code, DATA, DNA_struct_find_nr(), ENDB, FileData::filesdna, GS, PreviewImage::h, ID_AC, ID_GR, ID_IM, ID_LA, ID_MA, ID_OB, ID_SCE, ID_TE, ID_WO, BHead::len, MEM_callocN, MEM_freeN, NULL, PreviewImage::rect, BHead::SDNAnr, and PreviewImage::w.
Referenced by IMB_thumb_load_blend().
| void BLO_expand_main | ( | void * | fdhandle, |
| Main * | mainvar | ||
| ) |
Loop over all ID data in Main to mark relations. Set (id->tag & LIB_TAG_NEED_EXPAND) to mark expanding. Flags get cleared after expanding.
| fdhandle | usually filedata, or own handle. |
| mainvar | the Main database to expand. |
Definition at line 4587 of file readfile.c.
References Freestyle::a, BKE_idtype_get_info_from_id(), IDTypeInfo::blend_read_expand, expand_id(), ListBase::first, id, INDEX_ID_MAX, LIB_TAG_NEED_EXPAND, NULL, set_listbasepointers(), and ID::tag.
Referenced by BKE_blendfile_write_partial(), library_link_end(), and read_libraries().
| bool BLO_has_bfile_extension | ( | const char * | str | ) |
Check whether given path ends with a blend file compatible extension (.blend, .ble or .blend.gz).
| str | The path to check. |
Definition at line 1684 of file readfile.c.
References BLI_path_extension_check_array(), NULL, and str.
Referenced by arg_handle_load_file(), blend_save_check(), BLO_library_path_explode(), ED_path_extension_type(), file_path_to_ui_path(), filelist_readjob_list_dir(), recent_files_menu_draw(), uiTemplateRecentFiles(), WM_lib_reload(), and wm_lib_relocate_exec_do().
| void blo_lib_link_restore | ( | Main * | oldmain, |
| Main * | newmain, | ||
| wmWindowManager * | curwm, | ||
| Scene * | curscene, | ||
| ViewLayer * | cur_view_layer | ||
| ) |
Used to link a file (without UI) to the current UI. Note that it assumes the old pointers in UI are still valid, so old Main is not freed.
Definition at line 3030 of file readfile.c.
References BKE_main_idmap_create(), BKE_main_idmap_destroy(), BKE_view_layer_find(), BKE_workspace_active_get(), BKE_workspace_active_set(), BLI_assert, Scene::cursor, lib_link_clipboard_restore(), lib_link_main_data_restore(), lib_link_window_scene_data_restore(), lib_link_wm_xr_data_restore(), lib_link_workspace_layout_restore(), LISTBASE_FOREACH, MAIN_IDMAP_TYPE_NAME, ViewLayer::name, NULL, restore_pointer_by_name(), id_map< K, T >::scene, STRNCPY, USER_REAL, wmWindowManager::windows, Main::workspaces, and wmWindowManager::xr.
Referenced by setup_app_data().
| struct Main* BLO_library_link_begin | ( | BlendHandle ** | bh, |
| const char * | filepath, | ||
| const struct LibraryLink_Params * | params | ||
| ) |
Initialize the BlendHandle for linking library data.
| bh | A blender file handle as returned by BLO_blendhandle_from_file or BLO_blendhandle_from_memory. |
| filepath | Used for relative linking, copied to the lib->filepath. |
| params | Settings for linking that don't change from beginning to end of linking. |
Definition at line 5109 of file readfile.c.
References library_link_begin(), and params.
Referenced by BKE_copybuffer_paste(), BKE_copybuffer_read(), BLO_library_temp_load_id(), bpy_lib_exit(), and wm_link_do().
| int BLO_library_link_copypaste | ( | Main * | mainl, |
| BlendHandle * | bh, | ||
| const uint64_t | id_types_mask | ||
| ) |
Simple reader for copy/paste buffers.
Definition at line 4941 of file readfile.c.
References BHeadSort::bhead, BKE_idtype_idcode_is_linkable(), BKE_idtype_idcode_to_idfilter(), BLI_assert, blo_bhead_first(), blo_bhead_is_id_valid_type(), blo_bhead_next(), BHead::code, ENDB, GS, id, ID_OB, id_sort_by_name(), LIB_TAG_INDIRECT, LIB_TAG_NEED_EXPAND, Object::mode, ID::name, NULL, OB_MODE_OBJECT, read_libblock(), ID::us, and which_libbase().
Referenced by BKE_copybuffer_paste(), and BKE_copybuffer_read().
| void BLO_library_link_end | ( | Main * | mainl, |
| BlendHandle ** | bh, | ||
| const struct LibraryLink_Params * | params | ||
| ) |
Finalize linking from a given .blend file (library). Optionally instance the indirect object/collection in the scene when the flags are set.
| mainl | The main database to link from (not the active one). |
| bh | The blender file handle (WARNING! may be freed by this function!). |
| params | Settings for linking that don't change from beginning to end of linking. |
Definition at line 5258 of file readfile.c.
References library_link_end(), and params.
Referenced by BKE_copybuffer_paste(), BKE_copybuffer_read(), BLO_library_temp_free(), bpy_lib_exit(), and wm_link_do().
| struct ID* BLO_library_link_named_part | ( | Main * | mainl, |
| BlendHandle ** | bh, | ||
| const short | idcode, | ||
| const char * | name, | ||
| const struct LibraryLink_Params * | params | ||
| ) |
Link a named data-block from an external blend file.
| mainl | The main database to link from (not the active one). |
| bh | The blender file handle. |
| idcode | The kind of data-block to link. |
| name | The name of the data-block (without the 2 char ID prefix). |
Definition at line 4989 of file readfile.c.
References link_named_part(), and params.
Referenced by BLO_library_temp_load_id(), bpy_lib_exit(), and wm_link_do().
| void BLO_library_link_params_init | ( | struct LibraryLink_Params * | params, |
| struct Main * | bmain, | ||
| const int | flag, | ||
| const int | id_tag_extra | ||
| ) |
Definition at line 5069 of file readfile.c.
References params.
Referenced by BKE_copybuffer_read(), BLO_library_link_params_init_with_context(), BLO_library_temp_load_id(), and bpy_lib_exit().
| void BLO_library_link_params_init_with_context | ( | struct LibraryLink_Params * | params, |
| struct Main * | bmain, | ||
| const int | flag, | ||
| const int | id_tag_extra, | ||
| struct Scene * | scene, | ||
| struct ViewLayer * | view_layer, | ||
| const struct View3D * | v3d | ||
| ) |
Definition at line 5080 of file readfile.c.
References BLO_LIBLINK_NEEDS_ID_TAG_DOIT, BLO_library_link_params_init(), NULL, params, and scene.
Referenced by BKE_copybuffer_paste(), and wm_link_do().
| bool BLO_library_path_explode | ( | const char * | path, |
| char * | r_dir, | ||
| char ** | r_group, | ||
| char ** | r_name | ||
| ) |
Try to explode given path into its 'library components' (i.e. a .blend file, id type/group, and data-block itself).
| path | the full path to explode. |
| r_dir | the string that'll contain path up to blend file itself ('library' path). WARNING! Must be FILE_MAX_LIBEXTRA long (it also stores group and name strings)! |
| r_group | the string that'll contain 'group' part of the path, if any. May be NULL. |
| r_name | the string that'll contain data's name part of the path, if any. May be NULL. |
Definition at line 1701 of file readfile.c.
References BLI_assert, BLI_is_dir(), BLI_is_file(), BLI_path_slash_rfind(), BLO_EMBEDDED_STARTUP_BLEND, BLO_GROUP_MAX, BLO_has_bfile_extension(), Freestyle::c, MAX_ID_NAME, NULL, and STREQ.
Referenced by file_directory_enter_handle(), file_draw_icon(), file_draw_preview(), fileentry_uiname(), filelist_checkdir_lib(), filelist_islibrary(), filelist_readjob_list_lib(), IMB_thumb_manage(), is_filtered_lib(), and wm_link_append_exec().
Definition at line 5271 of file readfile.c.
References read_struct().
Referenced by BLO_blendhandle_get_previews().
| void BLO_library_temp_free | ( | TempLibraryContext * | temp_lib_ctx | ) |
Definition at line 60 of file readfile_tempload.c.
References BKE_main_free(), TempLibraryContext::blendhandle, BLO_blendhandle_close(), BLO_library_link_end(), TempLibraryContext::bmain_base, TempLibraryContext::bmain_lib, TempLibraryContext::liblink_params, and MEM_freeN.
| TempLibraryContext* BLO_library_temp_load_id | ( | struct Main * | real_main, |
| const char * | blend_file_path, | ||
| const short | idcode, | ||
| const char * | idname, | ||
| struct ReportList * | reports | ||
| ) |
Definition at line 31 of file readfile_tempload.c.
References BKE_main_new(), TempLibraryContext::blendhandle, BLO_blendhandle_from_file(), BLO_library_link_begin(), BLO_library_link_named_part(), BLO_library_link_params_init(), TempLibraryContext::bmain_base, TempLibraryContext::bmain_lib, LIB_TAG_TEMP_MAIN, TempLibraryContext::liblink_params, MEM_callocN, Main::name, STRNCPY, and TempLibraryContext::temp_id.
| void BLO_main_expander | ( | BLOExpandDoitCallback | expand_doit_func | ) |
Set the callback func used over all ID data found by BLO_expand_main func.
| expand_doit_func | Called for each ID block it finds. |
Definition at line 4575 of file readfile.c.
References expand_doit.
Referenced by BKE_blendfile_write_partial(), library_link_end(), and read_libraries().
| BlendFileData* BLO_read_from_file | ( | const char * | filepath, |
| eBLOReadSkip | skip_flags, | ||
| ReportList * | reports | ||
| ) |
Open a blender file from a pathname. The function returns NULL and sets a report in the list if it cannot open the file.
| filepath | The path of the file to open. |
| reports | If the return value is NULL, errors indicating the cause of the failure. |
Definition at line 367 of file readblenentry.c.
References blo_filedata_free(), blo_filedata_from_file(), blo_read_file_internal(), NULL, FileData::reports, and FileData::skip_flags.
Referenced by BKE_blendfile_read(), BKE_blendfile_userdef_read(), BKE_blendfile_workspace_config_read(), and BlendfileLoadingBaseTest::blendfile_load().
| BlendFileData* BLO_read_from_memfile | ( | Main * | oldmain, |
| const char * | filename, | ||
| MemFile * | memfile, | ||
| const struct BlendFileReadParams * | params, | ||
| ReportList * | reports | ||
| ) |
Used for undo/redo, skips part of libraries reading (assuming their data are already loaded & valid).
| oldmain | old main, from which we will keep libraries and other data-blocks that should not have changed. |
| filename | current file, only for retrieving library data. |
Definition at line 421 of file readblenentry.c.
References BLI_assert, BLI_strncpy(), blo_add_library_pointer_map(), blo_cache_storage_init(), blo_cache_storage_old_bmain_clear(), blo_clear_proxy_pointers_from_lib(), blo_filedata_free(), blo_filedata_from_memfile(), blo_join_main(), blo_make_old_idmap_from_main(), blo_read_file_internal(), BLO_READ_SKIP_UNDO_OLD_MAIN, blo_split_main(), ListBase::first, NULL, params, FileData::relabase, FileData::reports, and FileData::skip_flags.
Referenced by BKE_blendfile_read_from_memfile(), and BLO_memfile_main_get().
| BlendFileData* BLO_read_from_memory | ( | const void * | mem, |
| int | memsize, | ||
| eBLOReadSkip | skip_flags, | ||
| ReportList * | reports | ||
| ) |
Open a blender file from memory. The function returns NULL and sets a report in the list if it cannot open the file.
| mem | The file data. |
| memsize | The length of mem. |
| reports | If the return value is NULL, errors indicating the cause of the failure. |
Definition at line 394 of file readblenentry.c.
References blo_filedata_free(), blo_filedata_from_memory(), blo_read_file_internal(), NULL, FileData::reports, and FileData::skip_flags.
Referenced by BKE_blendfile_read_from_memory(), BKE_blendfile_userdef_read_from_memory(), BKE_blendfile_workspace_config_read(), and load_main_from_memory().
| void BLO_sanitize_experimental_features_userpref_blend | ( | struct UserDef * | userdef | ) |
Definition at line 896 of file versioning_userdef.c.
References BKE_blender_version_is_alpha(), UserDef::experimental, and MEMSET_STRUCT_AFTER.
Referenced by wm_init_userdef().
| struct BlendThumbnail* BLO_thumbnail_from_file | ( | const char * | filepath | ) |
Does a very light reading of given .blend file to extract its stored thumbnail.
| filepath | The path of the file to extract thumbnail from. |
Definition at line 1769 of file readfile.c.
References BLEN_THUMB_MEMSIZE, BLEN_THUMB_MEMSIZE_FILE, BLEN_THUMB_MEMSIZE_IS_VALID, BLI_assert, blo_filedata_free(), blo_filedata_from_file_minimal(), data, height, MEM_mallocN, NULL, read_file_thumbnail(), and width.
Referenced by IMB_thumb_load_blend().
| void BLO_update_defaults_startup_blend | ( | Main * | bmain, |
| const char * | app_template | ||
| ) |
Update defaults in startup.blend, without having to save and embed it.
userdef_default.c and can be updated there.Update defaults in startup.blend, without having to save and embed the file. This function can be emptied each time the startup.blend is updated.
Definition at line 390 of file versioning_defaults.c.
References app_template, Scene::audio, AUDIO_SYNC, BKE_brush_add(), BKE_brush_gpencil_paint_presets(), BKE_brush_gpencil_sculpt_presets(), BKE_brush_gpencil_vertex_presets(), BKE_brush_gpencil_weight_presets(), BKE_brush_sculpt_reset(), BKE_gpencil_material_add(), BKE_gpencil_palette_ensure(), BKE_id_delete(), BKE_mesh_smooth_flag_set(), BKE_paint_ensure_from_paintmode(), BKE_workspace_active_layout_for_workspace_get(), BKE_workspace_layout_remove(), BLI_assert, BLI_findstring(), BLI_libblock_ensure_unique_name(), BLI_strncpy(), blo_is_builtin_template(), blo_update_defaults_scene(), BLO_update_defaults_workspace(), BRUSH_PAINT_ANTIALIASING, Main::brushes, Main::cameras, DEG2RADF, Object::dtx, ListBase::first, bGPdata::flag, MaterialGPencilStyle::flag, Mesh::flag, AudioData::flag, Scene::flag, Paint::flags, GP_BRUSH_ICON_PEN, GP_DATA_STROKE_PAINTMODE, GP_MATERIAL_MODE_DOT, GP_MATERIAL_MODE_SQUARE, GP_MATERIAL_STROKE_SHOW, ToolSettings::gp_paint, GP_SELECTMODE_STROKE, Material::gp_style, ToolSettings::gpencil_selectmode_edit, Brush::gpencil_settings, BrushGpencilSettings::icon_id, Brush::id, Mesh::id, Scene::id, bScreen::id, ID_BR, ID_LA, ID_MA, ID_OB, id_us_min(), Main::lights, LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, ColorManagedViewSettings::look, Main::materials, ME_REMESH_FIX_POLES, ME_REMESH_REPROJECT_VOLUME, mesh, Main::meshes, MaterialGPencilStyle::mix_factor, MaterialGPencilStyle::mix_rgba, MaterialGPencilStyle::mode, ID::name, ID::next, node, nodeFindSocket(), NULL, OB_GPENCIL, Brush::ob_mode, OB_MODE_EDIT, OB_MODE_PAINT_GPENCIL, OB_MODE_SCULPT, OB_USE_GPENCIL_LIGHTS, Main::objects, GpPaint::paint, PAINT_MODE_SCULPT_GPENCIL, PAINT_MODE_VERTEX_GPENCIL, PAINT_MODE_WEIGHT_GPENCIL, PAINT_SHOW_BRUSH, Mesh::remesh_voxel_size, rename_id_for_versioning(), roughness_socket, SCE_FRAME_DROP, scene, Main::scenes, WorkSpaceLayout::screen, Brush::sculpt_tool, SCULPT_TOOL_BOUNDARY, SCULPT_TOOL_CLAY_THUMB, SCULPT_TOOL_CLOTH, SCULPT_TOOL_DISPLACEMENT_ERASER, SCULPT_TOOL_DISPLACEMENT_SMEAR, SCULPT_TOOL_DRAW_FACE_SETS, SCULPT_TOOL_DRAW_SHARP, SCULPT_TOOL_ELASTIC_DEFORM, SCULPT_TOOL_MULTIPLANE_SCRAPE, SCULPT_TOOL_PAINT, SCULPT_TOOL_POSE, SCULPT_TOOL_SIMPLIFY, SCULPT_TOOL_SLIDE_RELAX, SCULPT_TOOL_SMEAR, SH_NODE_BSDF_PRINCIPLED, Mesh::smoothresh, SOCK_IN, Brush::spacing, STREQ, STRNCPY, MaterialGPencilStyle::texture_offset, Scene::toolsettings, Object::type, bNodeSocketValueFloat::value, Scene::view_settings, ColorManagedViewSettings::view_transform, Main::wm, and Main::workspaces.
Referenced by BKE_blendfile_read_setup_ex().
| void BLO_update_defaults_workspace | ( | struct WorkSpace * | workspace, |
| const char * | app_template | ||
| ) |
Definition at line 264 of file versioning_defaults.c.
References app_template, blender::compositor::area(), bScreen::areabase, BKE_workspace_tool_remove(), BLI_listbase_is_empty(), blo_is_builtin_template(), blo_update_defaults_screen(), copy_v3_fl(), ListBase::first, View3DShading::flag, WorkSpace::id, WorkSpace::layouts, LISTBASE_FOREACH, View3DShading::matcap, ID::name, OB_MODE_PAINT_GPENCIL, WorkSpace::object_mode, View3D::shading, View3DShading::single_color, SPACE_VIEW3D, STREQ, STRNCPY, WorkSpace::tools, and V3D_SHADING_CAVITY.
Referenced by BLO_update_defaults_startup_blend(), and workspace_append_activate_exec().
|
extern |
|
extern |