|
Blender
V2.93
|
Go to the source code of this file.
Functions | |
| void | BKE_blendfile_read_setup_ex (struct bContext *C, struct BlendFileData *bfd, const struct BlendFileReadParams *params, struct ReportList *reports, const bool startup_update_defaults, const char *startup_app_template) |
| void | BKE_blendfile_read_setup (struct bContext *C, struct BlendFileData *bfd, const struct BlendFileReadParams *params, struct ReportList *reports) |
| struct BlendFileData * | BKE_blendfile_read (const char *filepath, const struct BlendFileReadParams *params, struct ReportList *reports) |
| struct BlendFileData * | BKE_blendfile_read_from_memory (const void *filebuf, int filelength, const struct BlendFileReadParams *params, struct ReportList *reports) |
| struct BlendFileData * | BKE_blendfile_read_from_memfile (struct Main *bmain, struct MemFile *memfile, const struct BlendFileReadParams *params, struct ReportList *reports) |
| void | BKE_blendfile_read_make_empty (struct bContext *C) |
| struct UserDef * | BKE_blendfile_userdef_read (const char *filepath, struct ReportList *reports) |
| struct UserDef * | BKE_blendfile_userdef_read_from_memory (const void *filebuf, int filelength, struct ReportList *reports) |
| struct UserDef * | BKE_blendfile_userdef_from_defaults (void) |
| bool | BKE_blendfile_userdef_write (const char *filepath, struct ReportList *reports) |
| bool | BKE_blendfile_userdef_write_app_template (const char *filepath, struct ReportList *reports) |
| bool | BKE_blendfile_userdef_write_all (struct ReportList *reports) |
| struct WorkspaceConfigFileData * | BKE_blendfile_workspace_config_read (const char *filepath, const void *filebuf, int filelength, struct ReportList *reports) |
| bool | BKE_blendfile_workspace_config_write (struct Main *bmain, const char *filepath, struct ReportList *reports) |
| void | BKE_blendfile_workspace_config_data_free (struct WorkspaceConfigFileData *workspace_config) |
| void | BKE_blendfile_write_partial_tag_ID (struct ID *id, bool set) |
| void | BKE_blendfile_write_partial_begin (struct Main *bmain_src) |
| bool | BKE_blendfile_write_partial (struct Main *bmain_src, const char *filepath, const int write_flags, const int remap_mode, struct ReportList *reports) |
| void | BKE_blendfile_write_partial_end (struct Main *bmain_src) |
| struct BlendFileData* BKE_blendfile_read | ( | const char * | filepath, |
| const struct BlendFileReadParams * | params, | ||
| ReportList * | reports | ||
| ) |
Definition at line 470 of file blendfile.c.
References BKE_reports_prependf(), BLO_read_from_file(), handle_subversion_warning(), BlendFileData::main, and params.
Referenced by BKE_memfile_undo_decode(), WM_file_read(), and wm_homefile_read().
| struct BlendFileData* BKE_blendfile_read_from_memfile | ( | Main * | bmain, |
| struct MemFile * | memfile, | ||
| const struct BlendFileReadParams * | params, | ||
| ReportList * | reports | ||
| ) |
memfile is the undo buffer. Definition at line 511 of file blendfile.c.
References BKE_main_blendfile_path(), BKE_reports_prepend(), BLI_assert, BLI_listbase_is_empty(), BLO_read_from_memfile(), BlendFileData::main, params, Main::screens, Main::wm, and Main::workspaces.
Referenced by BKE_memfile_undo_decode().
| struct BlendFileData* BKE_blendfile_read_from_memory | ( | const void * | filebuf, |
| int | filelength, | ||
| const struct BlendFileReadParams * | params, | ||
| ReportList * | reports | ||
| ) |
Definition at line 492 of file blendfile.c.
References BKE_reports_prepend(), BLO_read_from_memory(), and params.
Referenced by wm_homefile_read().
| void BKE_blendfile_read_make_empty | ( | bContext * | C | ) |
Utility to make a file 'empty' used for startup to optionally give an empty file. Handy for tests.
Definition at line 537 of file blendfile.c.
References BKE_id_delete(), C, CTX_data_main(), ELEM, FOREACH_MAIN_LISTBASE_BEGIN, FOREACH_MAIN_LISTBASE_END, FOREACH_MAIN_LISTBASE_ID_BEGIN, FOREACH_MAIN_LISTBASE_ID_END, GS, id, ID_SCE, ID_SCR, ID_WM, ID_WS, and ID::name.
Referenced by wm_homefile_read().
| void BKE_blendfile_read_setup | ( | struct bContext * | C, |
| struct BlendFileData * | bfd, | ||
| const struct BlendFileReadParams * | params, | ||
| struct ReportList * | reports | ||
| ) |
Definition at line 459 of file blendfile.c.
References BKE_blendfile_read_setup_ex(), C, NULL, and params.
Referenced by BKE_memfile_undo_decode(), and WM_file_read().
| void BKE_blendfile_read_setup_ex | ( | bContext * | C, |
| BlendFileData * | bfd, | ||
| const struct BlendFileReadParams * | params, | ||
| ReportList * | reports, | ||
| const bool | startup_update_defaults, | ||
| const char * | startup_app_template | ||
| ) |
Shared setup function that makes the data from bfd into the current blend file, replacing the contents of #G.main. This uses the bfd BKE_blendfile_read and similarly named functions.
This is done in a separate step so the caller may perform actions after it is known the file loaded correctly but before the file replaces the existing blend file contents.
Definition at line 442 of file blendfile.c.
References BLO_blendfiledata_free(), BLO_READ_SKIP_DATA, BLO_update_defaults_startup_blend(), C, BlendFileData::main, params, and setup_app_blend_file_data().
Referenced by BKE_blendfile_read_setup(), and wm_homefile_read().
| struct UserDef* BKE_blendfile_userdef_from_defaults | ( | void | ) |
Definition at line 596 of file blendfile.c.
References UserDef::addons, ARRAY_SIZE, BKE_addon_new(), BKE_appdir_font_folder_default(), BKE_colorband_init(), BKE_preferences_asset_library_default_add(), BKE_studiolight_default(), BLI_addtail(), BLI_system_memory_max_in_megabytes_int(), UserDef::coba_weight, UserDef::experimental, UserDef::flag, UserDef::fontdir, UserDef::language, UserDef::light_ambient, UserDef::light_param, MEM_mallocN, UserDef::memcachelimit, min_ii(), bAddon::module, STRNCPY, UserDef::themes, UserDef::transopts, U_default, U_theme_default, ULANGUAGE_AUTO, UserDef_Experimental::use_asset_browser, USER_SCRIPT_AUTOEXEC_DISABLE, USER_TR_IFACE, USER_TR_NEWDATANAME, and USER_TR_TOOLTIPS.
Referenced by wm_homefile_read().
| struct UserDef* BKE_blendfile_userdef_read | ( | const char * | filepath, |
| struct ReportList * | reports | ||
| ) |
Definition at line 556 of file blendfile.c.
References BKE_main_free(), BLO_read_from_file(), BLO_READ_SKIP_ALL, BLO_READ_SKIP_USERDEF, BlendFileData::main, MEM_freeN, NULL, and BlendFileData::user.
Referenced by BKE_blendfile_userdef_write_app_template(), and wm_homefile_read().
| struct UserDef* BKE_blendfile_userdef_read_from_memory | ( | const void * | filebuf, |
| int | filelength, | ||
| struct ReportList * | reports | ||
| ) |
Definition at line 573 of file blendfile.c.
References BKE_main_free(), BKE_reports_prepend(), BLO_read_from_memory(), BLO_READ_SKIP_ALL, BLO_READ_SKIP_USERDEF, BlendFileData::main, MEM_freeN, NULL, and BlendFileData::user.
| bool BKE_blendfile_userdef_write | ( | const char * | filepath, |
| ReportList * | reports | ||
| ) |
Only write the userdef in a .blend
Definition at line 673 of file blendfile.c.
References BLO_write_file(), MEM_callocN, and MEM_freeN.
Referenced by BKE_blendfile_userdef_write_all(), and BKE_blendfile_userdef_write_app_template().
| bool BKE_blendfile_userdef_write_all | ( | struct ReportList * | reports | ) |
Definition at line 716 of file blendfile.c.
References BKE_appdir_app_template_has_userpref(), BKE_appdir_folder_id_create(), BKE_blendfile_userdef_write(), BKE_blendfile_userdef_write_app_template(), BKE_report(), BLENDER_USER_CONFIG, BLENDER_USERPREF_FILE, BLI_path_join(), FILE_MAX, NULL, and RPT_ERROR.
Referenced by WM_exit_ex(), and wm_userpref_write_exec().
| bool BKE_blendfile_userdef_write_app_template | ( | const char * | filepath, |
| ReportList * | reports | ||
| ) |
Only write the userdef in a .blend, merging with the existing blend file.
Definition at line 700 of file blendfile.c.
References BKE_blender_userdef_app_template_data_swap(), BKE_blender_userdef_data_free(), BKE_blendfile_userdef_read(), BKE_blendfile_userdef_write(), MEM_freeN, and NULL.
Referenced by BKE_blendfile_userdef_write_all().
| void BKE_blendfile_workspace_config_data_free | ( | struct WorkspaceConfigFileData * | workspace_config | ) |
Definition at line 825 of file blendfile.c.
References BKE_main_free(), WorkspaceConfigFileData::main, and MEM_freeN.
Referenced by workspace_add_menu().
| struct WorkspaceConfigFileData* BKE_blendfile_workspace_config_read | ( | const char * | filepath, |
| const void * | filebuf, | ||
| int | filelength, | ||
| struct ReportList * | reports | ||
| ) |
Definition at line 773 of file blendfile.c.
References BLO_read_from_file(), BLO_read_from_memory(), BLO_READ_SKIP_USERDEF, WorkspaceConfigFileData::main, BlendFileData::main, MEM_callocN, MEM_freeN, NULL, Main::versionfile, Main::workspaces, and WorkspaceConfigFileData::workspaces.
Referenced by workspace_config_file_read(), and workspace_system_file_read().
| bool BKE_blendfile_workspace_config_write | ( | struct Main * | bmain, |
| const char * | filepath, | ||
| struct ReportList * | reports | ||
| ) |
Definition at line 804 of file blendfile.c.
References BKE_blendfile_write_partial(), BKE_blendfile_write_partial_begin(), BKE_blendfile_write_partial_end(), BKE_blendfile_write_partial_tag_ID(), BLO_WRITE_PATH_REMAP_NONE, BlendFileData::fileflags, ListBase::first, G, G_FILE_NO_UI, and Main::workspaces.
| bool BKE_blendfile_write_partial | ( | Main * | bmain_src, |
| const char * | filepath, | ||
| const int | write_flags, | ||
| const int | remap_mode, | ||
| ReportList * | reports | ||
| ) |
| remap_mode | Choose the kind of path remapping or none eBLO_WritePathRemap. |
Definition at line 871 of file blendfile.c.
References Freestyle::a, BKE_bpath_list_backup(), BKE_bpath_list_free(), BKE_bpath_list_restore(), BKE_BPATH_TRAVERSE_SKIP_LIBRARY, BKE_BPATH_TRAVERSE_SKIP_MULTIFILE, blendfile_write_partial_cb(), BLI_addtail(), BLI_pophead(), BLI_remlink(), BLI_strncpy(), BLO_expand_main(), BLO_main_expander(), BLO_write_file(), BLO_WRITE_PATH_REMAP_NONE, id, id_sort_by_name(), INDEX_ID_MAX, LIB_TAG_DOIT, MEM_callocN, MEM_freeN, Main::name, ID::next, NULL, set_listbasepointers(), and ID::tag.
Referenced by BKE_blendfile_workspace_config_write(), BKE_copybuffer_save(), and bpy_lib_write().
| void BKE_blendfile_write_partial_begin | ( | struct Main * | bmain_src | ) |
Definition at line 837 of file blendfile.c.
References BKE_main_id_tag_all(), LIB_TAG_DOIT, and LIB_TAG_NEED_EXPAND.
Referenced by BKE_blendfile_workspace_config_write(), BKE_copybuffer_begin(), and bpy_lib_write().
| void BKE_blendfile_write_partial_end | ( | struct Main * | bmain_src | ) |
Definition at line 952 of file blendfile.c.
References BKE_main_id_tag_all(), LIB_TAG_DOIT, and LIB_TAG_NEED_EXPAND.
Referenced by BKE_blendfile_workspace_config_write(), BKE_copybuffer_save(), and bpy_lib_write().
| void BKE_blendfile_write_partial_tag_ID | ( | struct ID * | id, |
| bool | set | ||
| ) |
Definition at line 842 of file blendfile.c.
References LIB_TAG_DOIT, and LIB_TAG_NEED_EXPAND.
Referenced by BKE_blendfile_workspace_config_write(), BKE_copybuffer_tag_ID(), and bpy_lib_write().