|
Blender V4.3
|
#include "BKE_main.hh"#include "BLI_function_ref.hh"#include "BLI_map.hh"#include "BLI_utility_mixins.hh"#include <string>Go to the source code of this file.
Classes | |
| class | blender::bke::blendfile::PartialWriteContext |
| struct | blender::bke::blendfile::PartialWriteContext::IDAddOptions |
Namespaces | |
| namespace | blender |
| namespace | blender::bke |
| namespace | blender::bke::blendfile |
Macros | |
| #define | BLENDER_ASSET_FILE_SUFFIX ".asset.blend" |
| #define BLENDER_ASSET_FILE_SUFFIX ".asset.blend" |
The suffix used for blend-files managed by the asset system.
Definition at line 35 of file BKE_blendfile.hh.
Referenced by blender::bke::asset_blendfile_path_for_save(), blender::bke::asset_link_id(), save_set_filepath(), and wm_file_write_check_with_report_on_failure().
| bool BKE_blendfile_extension_check | ( | 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 83 of file blendfile.cc.
References BLI_path_extension_check_array(), and str.
Referenced by BKE_blendfile_library_path_explode(), ED_path_extension_type(), file_path_to_ui_path(), filelist_readjob_list_dir(), handle_load_file(), uiTemplateRecentFiles(), WM_lib_reload(), wm_lib_relocate_exec_do(), and wm_save_mainfile_check().
| bool BKE_blendfile_is_readable | ( | const char * | path, |
| ReportList * | reports ) |
Check whether a given path is actually a Blender-readable, valid .blend file.
Definition at line 152 of file blendfile.cc.
References BLO_blendhandle_close(), BLO_blendhandle_from_file(), and BlendFileReadReport::reports.
Referenced by file_draw_hint_if_invalid().
| bool BKE_blendfile_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 at least FILE_MAX_LIBEXTRA long (it also stores group and name strings)! |
| r_group | a pointer within r_dir to the 'group' part of the path, if any ('\0' terminated). May be NULL. |
| r_name | a pointer within r_dir to the data-block name, if any ('\0' terminated). May be NULL. |
Definition at line 89 of file blendfile.cc.
References BKE_blendfile_extension_check(), BLI_assert, BLI_is_dir(), BLI_is_file(), BLI_path_slash_rfind(), BLI_strncpy(), BLO_EMBEDDED_STARTUP_BLEND, BLO_GROUP_MAX, FILE_MAX_LIBEXTRA, MAX_ID_NAME, and STREQ.
Referenced by file_directory_enter_handle(), fileentry_uiname(), filelist_checkdir_lib(), filelist_islibrary(), filelist_readjob_list_lib(), blender::asset_system::AssetRepresentation::full_library_path(), IMB_thumb_manage(), and wm_link_append_exec().
| BlendFileData * BKE_blendfile_read | ( | const char * | filepath, |
| const BlendFileReadParams * | params, | ||
| BlendFileReadReport * | reports ) |
Definition at line 1305 of file blendfile.cc.
References BKE_reports_prependf(), BLO_blendfiledata_free(), BLO_read_from_file(), G, handle_subversion_warning(), Main::is_read_invalid, BlendFileData::main, params, printf, and BlendFileReadReport::reports.
Referenced by BKE_memfile_undo_decode(), sequencer_clipboard_paste_exec(), WM_file_read(), and wm_homefile_read_ex().
| BlendFileData * BKE_blendfile_read_from_memfile | ( | Main * | bmain, |
| MemFile * | memfile, | ||
| const BlendFileReadParams * | params, | ||
| ReportList * | reports ) |
memfile is the undo buffer. Definition at line 1350 of file blendfile.cc.
References BKE_main_blendfile_path(), BKE_reports_prepend(), BLO_blendfiledata_free(), BLO_read_from_memfile(), Main::is_read_invalid, BlendFileData::main, and params.
Referenced by BKE_memfile_undo_decode().
| BlendFileData * BKE_blendfile_read_from_memory | ( | const void * | file_buf, |
| int | file_buf_size, | ||
| const BlendFileReadParams * | params, | ||
| ReportList * | reports ) |
Definition at line 1330 of file blendfile.cc.
References BKE_reports_prepend(), BLO_blendfiledata_free(), BLO_read_from_memory(), Main::is_read_invalid, BlendFileData::main, and params.
Referenced by wm_homefile_read_ex().
| 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 1367 of file blendfile.cc.
References BKE_id_delete(), CTX_data_main(), ELEM, FOREACH_MAIN_LISTBASE_BEGIN, FOREACH_MAIN_LISTBASE_END, FOREACH_MAIN_LISTBASE_ID_BEGIN, FOREACH_MAIN_LISTBASE_ID_END, GS, ID_SCE, ID_SCR, ID_WM, and ID_WS.
Referenced by wm_homefile_read_ex().
| void BKE_blendfile_read_setup_readfile | ( | bContext * | C, |
| BlendFileData * | bfd, | ||
| const BlendFileReadParams * | params, | ||
| BlendFileReadWMSetupData * | wm_setup_data, | ||
| 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 returned by 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 1272 of file blendfile.cc.
References BKE_reports_prepend(), BLO_blendfiledata_free(), BLO_READ_SKIP_DATA, BLO_update_defaults_startup_blend(), Main::is_read_invalid, BlendFileData::main, params, BlendFileReadReport::reports, and setup_app_blend_file_data().
Referenced by BKE_blendfile_read_setup_undo(), WM_file_read(), and wm_homefile_read_ex().
| void BKE_blendfile_read_setup_undo | ( | bContext * | C, |
| BlendFileData * | bfd, | ||
| const BlendFileReadParams * | params, | ||
| BlendFileReadReport * | reports ) |
Simpler version of BKE_blendfile_read_setup_readfile used when reading undo steps from memfile.
Definition at line 1297 of file blendfile.cc.
References BKE_blendfile_read_setup_readfile(), and params.
Referenced by BKE_memfile_undo_decode().
| UserDef * BKE_blendfile_userdef_from_defaults | ( | ) |
Definition at line 1457 of file blendfile.cc.
References UserDef::addons, ARRAY_SIZE, BKE_addon_new(), BKE_appdir_font_folder_default(), BKE_colorband_init(), BKE_preferences_asset_library_default_add(), BKE_preferences_asset_shelf_settings_ensure_catalog_path_enabled(), BKE_preferences_extension_repo_add_defaults_all(), BKE_studiolight_default(), BLI_addtail(), BLI_path_slash_ensure(), BLI_system_memory_max_in_megabytes_int(), UserDef::coba_weight, UserDef::flag, UserDef::fontdir, UserDef::language, UserDef::light_ambient, UserDef::light_param, MEM_callocN, 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 BKE_blendfile_userdef_write_app_template(), and wm_homefile_read_ex().
| UserDef * BKE_blendfile_userdef_read | ( | const char * | filepath, |
| ReportList * | reports ) |
Only read the UserDef from a .blend.
Definition at line 1413 of file blendfile.cc.
References BKE_main_free(), BLO_read_from_file(), BLO_READ_SKIP_ALL, BLO_READ_SKIP_USERDEF, BlendFileData::main, MEM_freeN(), BlendFileReadReport::reports, and BlendFileData::user.
Referenced by BKE_blendfile_userdef_write_app_template(), and wm_homefile_read_ex().
| UserDef * BKE_blendfile_userdef_read_from_memory | ( | const void * | file_buf, |
| int | file_buf_size, | ||
| ReportList * | reports ) |
Definition at line 1434 of file blendfile.cc.
References BKE_main_free(), BKE_reports_prepend(), BLO_read_from_memory(), BLO_READ_SKIP_ALL, BLO_READ_SKIP_USERDEF, BlendFileData::main, MEM_freeN(), and BlendFileData::user.
| bool BKE_blendfile_userdef_write | ( | const char * | filepath, |
| ReportList * | reports ) |
Only write the UserDef in a .blend.
Definition at line 1554 of file blendfile.cc.
References BLO_write_file(), MEM_freeN(), and params.
Referenced by BKE_blendfile_userdef_write_all(), and BKE_blendfile_userdef_write_app_template().
| bool BKE_blendfile_userdef_write_all | ( | ReportList * | reports | ) |
Definition at line 1592 of file blendfile.cc.
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, G, printf, 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, |
| ReportList * | reports ) |
Only write the UserDef in a .blend, merging with the existing blend file.
Definition at line 1571 of file blendfile.cc.
References BKE_blender_userdef_app_template_data_swap(), BKE_blender_userdef_data_free(), BKE_blendfile_userdef_from_defaults(), BKE_blendfile_userdef_read(), BKE_blendfile_userdef_write(), BLI_exists(), and MEM_freeN().
Referenced by BKE_blendfile_userdef_write_all().
| void BKE_blendfile_workspace_config_data_free | ( | WorkspaceConfigFileData * | workspace_config | ) |
Definition at line 1701 of file blendfile.cc.
References BKE_main_free(), WorkspaceConfigFileData::main, and MEM_freeN().
Referenced by workspace_add_menu().
| WorkspaceConfigFileData * BKE_blendfile_workspace_config_read | ( | const char * | filepath, |
| const void * | file_buf, | ||
| int | file_buf_size, | ||
| ReportList * | reports ) |
Definition at line 1668 of file blendfile.cc.
References BLO_read_from_file(), BLO_read_from_memory(), BLO_READ_SKIP_USERDEF, BlendFileData::main, WorkspaceConfigFileData::main, MEM_freeN(), BlendFileReadReport::reports, Main::versionfile, Main::workspaces, and WorkspaceConfigFileData::workspaces.
Referenced by workspace_config_file_read(), and workspace_system_file_read().