Blender V5.3
blendfile.cc File Reference
#include <cstdlib>
#include <cstring>
#include <optional>
#include "CLG_log.h"
#include "MEM_guardedalloc.h"
#include "DNA_brush_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_windowmanager_types.h"
#include "BLI_fileops.hh"
#include "BLI_function_ref.hh"
#include "BLI_listbase.hh"
#include "BLI_path_utils.hh"
#include "BLI_string.hh"
#include "BLI_string_utf8.hh"
#include "BLI_system.hh"
#include "BLI_time.hh"
#include "BLI_utildefines.hh"
#include "BLI_vector.hh"
#include "BLI_vector_set.hh"
#include "BLT_translation.hh"
#include "IMB_colormanagement.hh"
#include "BKE_addon.h"
#include "BKE_appdir.hh"
#include "BKE_blender.hh"
#include "BKE_blender_version.h"
#include "BKE_blendfile.hh"
#include "BKE_bpath.hh"
#include "BKE_colorband.hh"
#include "BKE_context.hh"
#include "BKE_global.hh"
#include "BKE_idtype.hh"
#include "BKE_layer.hh"
#include "BKE_lib_id.hh"
#include "BKE_lib_override.hh"
#include "BKE_lib_query.hh"
#include "BKE_lib_remap.hh"
#include "BKE_library.hh"
#include "BKE_main.hh"
#include "BKE_main_idmap.hh"
#include "BKE_main_namemap.hh"
#include "BKE_preferences.h"
#include "BKE_report.hh"
#include "BKE_scene.hh"
#include "BKE_screen.hh"
#include "BKE_studiolight.h"
#include "BKE_undo_system.hh"
#include "BKE_workspace.hh"
#include "BLO_read_write.hh"
#include "BLO_readfile.hh"
#include "BLO_userdef_default.h"
#include "BLO_writefile.hh"
#include "RE_pipeline.h"

Go to the source code of this file.

Classes

struct  blender::ReuseOldBMainData

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::bke
namespace  blender::bke::blendfile

Functions

Blend/Library Paths
bool blender::BKE_blendfile_extension_check (const char *str)
bool blender::BKE_blendfile_library_path_explode (const char *path, char *r_dir, char **r_group, char **r_name)
bool blender::BKE_blendfile_is_readable (const char *path, ReportList *reports)
Blend File IO (Preferences)

Application Templates

When using app-templates, both regular & app-template preferences are used. Note that "regular" preferences refers to the preferences used with no app-template is active.

  • Reading preferences is performed for both the app-template & regular preferences.

    The preferences are merged by using some from the app-template and other settings from the regular preferences (add-ons from the app-template for example are used), undo-memory uses the regular preferences (for example).

  • Writing preferences is performed for both the app-template & regular preferences.

    Writing unmodified preference (U) into the regular preferences would loose any settings the app-template overrides. To keep default settings the regular preferences is read, add-ons etc temporarily swapped into U for writing, then swapped back out so as not to change the run-time preferences.

Note
The function BKE_blender_userdef_app_template_data_swap determines which settings the app-template overrides.
UserDef * blender::BKE_blendfile_userdef_read (const char *filepath, ReportList *reports)
UserDef * blender::BKE_blendfile_userdef_read_from_memory (const void *file_buf, int file_buf_size, ReportList *reports)
UserDef * blender::BKE_blendfile_userdef_from_defaults ()
bool blender::BKE_blendfile_userdef_write (const char *filepath, ReportList *reports)
bool blender::BKE_blendfile_userdef_write_app_template (const char *filepath, ReportList *reports)
bool blender::BKE_blendfile_userdef_write_all (ReportList *reports)
Blend File IO (WorkSpace)
WorkspaceConfigFileData * blender::BKE_blendfile_workspace_config_read (const char *filepath, const void *file_buf, int file_buf_size, ReportList *reports)
void blender::BKE_blendfile_workspace_config_data_free (WorkspaceConfigFileData *workspace_config)

Variables

Blend File Write (Partial)
static CLG_LogRef blender::LOG_PARTIALWRITE = {"blend.partial_write"}

Blend File IO (High Level)

static CLG_LogRef blender::LOG_BLEND = {"blend"}
static bool blender::foreach_path_clean_cb (BPathForeachPathData *, char *path_dst, size_t path_dst_maxncpy, const char *path_src)
static void blender::clean_paths (Main *bmain)
static bool blender::wm_scene_is_visible (wmWindowManager *wm, Scene *scene)
static void blender::setup_app_userdef (BlendFileData *bfd)
static id::IDRemapper & blender::reuse_bmain_data_remapper_ensure (ReuseOldBMainData *reuse_data)
static bool blender::reuse_bmain_data_remapper_is_id_remapped (id::IDRemapper &remapper, ID *id)
static bool blender::reuse_bmain_move_id (ReuseOldBMainData *reuse_data, ID *id, Library *lib, const bool reuse_existing)
static Library * blender::reuse_bmain_data_dependencies_new_library_get (ReuseOldBMainData *reuse_data, Library *old_lib)
static int blender::reuse_editable_asset_bmain_data_dependencies_process_cb (LibraryIDLinkCallbackData *cb_data)
static bool blender::reuse_editable_asset_needed (ReuseOldBMainData *reuse_data)
static void blender::reuse_editable_asset_bmain_data_for_blendfile (ReuseOldBMainData *reuse_data, const short idcode)
static void blender::unpin_file_local_grease_pencil_brush_materials (const ReuseOldBMainData *reuse_data)
static void blender::swap_old_bmain_data_for_blendfile (ReuseOldBMainData *reuse_data, const short id_code)
static void blender::swap_wm_data_for_blendfile (ReuseOldBMainData *reuse_data, const bool load_ui)
static int blender::swap_old_bmain_data_for_blendfile_dependencies_process_cb (LibraryIDLinkCallbackData *cb_data)
static void blender::swap_old_bmain_data_dependencies_process (ReuseOldBMainData *reuse_data, const short id_code)
static int blender::reuse_bmain_data_invalid_local_usages_fix_cb (LibraryIDLinkCallbackData *cb_data)
static void blender::reuse_bmain_data_invalid_local_usages_fix (ReuseOldBMainData *reuse_data)
static void blender::view3d_data_consistency_ensure (wmWindow *win, Scene *scene, ViewLayer *view_layer)
static void blender::wm_data_consistency_ensure (wmWindowManager *curwm, Scene *cur_scene, ViewLayer *cur_view_layer)
static void blender::setup_app_data (bContext *C, BlendFileData *bfd, const BlendFileReadParams *params, BlendFileReadWMSetupData *wm_setup_data, BlendFileReadReport *reports)
static void blender::setup_app_blend_file_data (bContext *C, BlendFileData *bfd, const BlendFileReadParams *params, BlendFileReadWMSetupData *wm_setup_data, BlendFileReadReport *reports)
static void blender::handle_subversion_warning (Main *main, BlendFileReadReport *reports)
void blender::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)
void blender::BKE_blendfile_read_setup_undo (bContext *C, BlendFileData *bfd, const BlendFileReadParams *params, BlendFileReadReport *reports)
BlendFileData * blender::BKE_blendfile_read (const char *filepath, const BlendFileReadParams *params, BlendFileReadReport *reports)
BlendFileData * blender::BKE_blendfile_read_from_memory (const void *file_buf, int file_buf_size, const BlendFileReadParams *params, ReportList *reports)
BlendFileData * blender::BKE_blendfile_read_from_memfile (Main *bmain, MemFile *memfile, const BlendFileReadParams *params, ReportList *reports)
void blender::BKE_blendfile_read_make_empty (bContext *C)

Detailed Description

High level .blend file read/write, and functions for writing partial files (only selected data-blocks).

Definition in file blendfile.cc.