Blender
V3.3
|
Go to the source code of this file.
bool BKE_blendfile_is_readable | ( | const char * | path, |
struct ReportList * | reports | ||
) |
Check whether a given path is actually a Blender-readable, valid .blend file.
Definition at line 68 of file blendfile.c.
References BLO_blendhandle_close(), BLO_blendhandle_from_file(), NULL, and BlendFileReadReport::reports.
Referenced by file_draw_hint_if_invalid().
struct BlendFileData* BKE_blendfile_read | ( | const char * | filepath, |
const struct BlendFileReadParams * | params, | ||
struct BlendFileReadReport * | reports | ||
) |
Definition at line 514 of file blendfile.c.
References BKE_reports_prependf(), BLO_blendfiledata_free(), BLO_read_from_file(), BlendFileData::filepath, handle_subversion_warning(), Main::is_read_invalid, BlendFileData::main, NULL, params, and BlendFileReadReport::reports.
Referenced by BKE_memfile_undo_decode(), WM_file_read(), and wm_homefile_read_ex().
struct BlendFileData* BKE_blendfile_read_from_memfile | ( | struct Main * | bmain, |
struct MemFile * | memfile, | ||
const struct BlendFileReadParams * | params, | ||
struct ReportList * | reports | ||
) |
memfile
is the undo buffer. Definition at line 556 of file blendfile.c.
References BKE_main_blendfile_path(), BKE_reports_prepend(), BLI_assert, BLI_listbase_is_empty(), BLO_blendfiledata_free(), BLO_read_from_memfile(), Main::is_read_invalid, BlendFileData::main, NULL, 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, | ||
struct ReportList * | reports | ||
) |
Definition at line 537 of file blendfile.c.
References BKE_reports_prepend(), BLO_blendfiledata_free(), BLO_read_from_memory(), Main::is_read_invalid, BlendFileData::main, NULL, and params.
Referenced by wm_homefile_read_ex().
Utility to make a file 'empty' used for startup to optionally give an empty file. Handy for tests.
Definition at line 582 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_ex().
void BKE_blendfile_read_setup | ( | struct bContext * | C, |
struct BlendFileData * | bfd, | ||
const struct BlendFileReadParams * | params, | ||
struct BlendFileReadReport * | reports | ||
) |
Definition at line 506 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 | ( | struct bContext * | C, |
struct BlendFileData * | bfd, | ||
const struct BlendFileReadParams * | params, | ||
struct BlendFileReadReport * | reports, | ||
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 482 of file blendfile.c.
References BKE_reports_prepend(), BLO_blendfiledata_free(), BLO_READ_SKIP_DATA, BLO_update_defaults_startup_blend(), C, Main::is_read_invalid, BlendFileData::main, params, BlendFileReadReport::reports, and setup_app_blend_file_data().
Referenced by BKE_blendfile_read_setup(), and wm_homefile_read_ex().
Definition at line 642 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::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, USER_SCRIPT_AUTOEXEC_DISABLE, USER_TR_IFACE, USER_TR_NEWDATANAME, and USER_TR_TOOLTIPS.
Referenced by wm_homefile_read_ex().
struct UserDef* BKE_blendfile_userdef_read | ( | const char * | filepath, |
struct ReportList * | reports | ||
) |
Only read the UserDef from a .blend.
Definition at line 600 of file blendfile.c.
References BKE_main_free(), BLO_read_from_file(), BLO_READ_SKIP_ALL, BLO_READ_SKIP_USERDEF, BlendFileData::filepath, BlendFileData::main, MEM_freeN, NULL, and BlendFileData::user.
Referenced by BKE_blendfile_userdef_write_app_template(), and wm_homefile_read_ex().
struct UserDef* BKE_blendfile_userdef_read_from_memory | ( | const void * | filebuf, |
int | filelength, | ||
struct ReportList * | reports | ||
) |
Definition at line 619 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, |
struct ReportList * | reports | ||
) |
Only write the UserDef in a .blend
.
Definition at line 712 of file blendfile.c.
References BLO_write_file(), BlendFileData::filepath, 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 748 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, BlendFileData::filepath, NULL, RPT_ERROR, and RPT_INFO.
Referenced by WM_exit_ex(), and wm_userpref_write_exec().
bool BKE_blendfile_userdef_write_app_template | ( | const char * | filepath, |
struct ReportList * | reports | ||
) |
Only write the UserDef in a .blend
, merging with the existing blend file.
Definition at line 732 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(), BlendFileData::filepath, 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 860 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 807 of file blendfile.c.
References BLO_read_from_file(), BLO_read_from_memory(), BLO_READ_SKIP_USERDEF, BlendFileData::filepath, 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 839 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, BlendFileData::filepath, ListBase::first, G, G_FILE_NO_UI, and Main::workspaces.
bool BKE_blendfile_write_partial | ( | struct Main * | bmain_src, |
const char * | filepath, | ||
int | write_flags, | ||
int | remap_mode, | ||
struct ReportList * | reports | ||
) |
remap_mode | Choose the kind of path remapping or none eBLO_WritePathRemap. |
Definition at line 902 of file blendfile.c.
References Freestyle::a, BKE_BPATH_FOREACH_PATH_SKIP_LINKED, BKE_BPATH_FOREACH_PATH_SKIP_MULTIFILE, BKE_bpath_list_backup(), BKE_bpath_list_free(), BKE_bpath_list_restore(), blendfile_write_partial_cb(), BLI_addtail(), BLI_pophead(), BLI_remlink(), BLO_expand_main(), BLO_main_expander(), BLO_write_file(), BLO_WRITE_PATH_REMAP_NONE, Main::filepath, BlendFileData::filepath, id, id_sort_by_name(), INDEX_ID_MAX, LIB_TAG_DOIT, MEM_callocN, MEM_freeN, ID::next, NULL, set_listbasepointers(), STRNCPY, and ID::tag.
Referenced by BKE_blendfile_workspace_config_write(), BKE_copybuffer_copy_end(), and bpy_lib_write().
Definition at line 872 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_copy_begin(), and bpy_lib_write().
Definition at line 984 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_copy_end(), and bpy_lib_write().
Definition at line 877 of file blendfile.c.
References LIB_TAG_DOIT, and LIB_TAG_NEED_EXPAND.
Referenced by BKE_blendfile_workspace_config_write(), BKE_copybuffer_copy_tag_ID(), and bpy_lib_write().