Blender V4.3
blendfile.cc File Reference
#include <cstdlib>
#include <cstring>
#include "CLG_log.h"
#include "MEM_guardedalloc.h"
#include "DNA_brush_types.h"
#include "DNA_material_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_workspace_types.h"
#include "BLI_fileops.h"
#include "BLI_function_ref.hh"
#include "BLI_listbase.h"
#include "BLI_path_utils.hh"
#include "BLI_string.h"
#include "BLI_system.h"
#include "BLI_time.h"
#include "BLI_utildefines.h"
#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_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  ReuseOldBMainData
 

Namespaces

namespace  blender
 
namespace  blender::bke
 
namespace  blender::bke::blendfile
 

Functions

Blend/Library Paths
bool BKE_blendfile_extension_check (const char *str)
 
bool BKE_blendfile_library_path_explode (const char *path, char *r_dir, char **r_group, char **r_name)
 
bool BKE_blendfile_is_readable (const char *path, ReportList *reports)
 
Blend File IO (High Level)
static bool foreach_path_clean_cb (BPathForeachPathData *, char *path_dst, size_t path_dst_maxncpy, const char *path_src)
 
static void clean_paths (Main *bmain)
 
static bool wm_scene_is_visible (wmWindowManager *wm, Scene *scene)
 
static void setup_app_userdef (BlendFileData *bfd)
 
static id::IDRemapper & reuse_bmain_data_remapper_ensure (ReuseOldBMainData *reuse_data)
 
static bool reuse_bmain_data_remapper_is_id_remapped (id::IDRemapper &remapper, ID *id)
 
static bool reuse_bmain_move_id (ReuseOldBMainData *reuse_data, ID *id, Library *lib, const bool reuse_existing)
 
static Libraryreuse_bmain_data_dependencies_new_library_get (ReuseOldBMainData *reuse_data, Library *old_lib)
 
static int reuse_editable_asset_bmain_data_dependencies_process_cb (LibraryIDLinkCallbackData *cb_data)
 
static bool reuse_editable_asset_needed (ReuseOldBMainData *reuse_data)
 
static void reuse_editable_asset_bmain_data_for_blendfile (ReuseOldBMainData *reuse_data, const short idcode)
 
static void unpin_file_local_grease_pencil_brush_materials (const ReuseOldBMainData *reuse_data)
 
static void swap_old_bmain_data_for_blendfile (ReuseOldBMainData *reuse_data, const short id_code)
 
static void swap_wm_data_for_blendfile (ReuseOldBMainData *reuse_data, const bool load_ui)
 
static int swap_old_bmain_data_for_blendfile_dependencies_process_cb (LibraryIDLinkCallbackData *cb_data)
 
static void swap_old_bmain_data_dependencies_process (ReuseOldBMainData *reuse_data, const short id_code)
 
static int reuse_bmain_data_invalid_local_usages_fix_cb (LibraryIDLinkCallbackData *cb_data)
 
static void reuse_bmain_data_invalid_local_usages_fix (ReuseOldBMainData *reuse_data)
 
static void view3d_data_consistency_ensure (wmWindow *win, Scene *scene, ViewLayer *view_layer)
 
static void wm_data_consistency_ensure (wmWindowManager *curwm, Scene *cur_scene, ViewLayer *cur_view_layer)
 
static void setup_app_data (bContext *C, BlendFileData *bfd, const BlendFileReadParams *params, BlendFileReadWMSetupData *wm_setup_data, BlendFileReadReport *reports)
 
static void setup_app_blend_file_data (bContext *C, BlendFileData *bfd, const BlendFileReadParams *params, BlendFileReadWMSetupData *wm_setup_data, BlendFileReadReport *reports)
 
static void handle_subversion_warning (Main *main, BlendFileReadReport *reports)
 
void BKE_blendfile_read_setup_readfile (bContext *C, BlendFileData *bfd, const BlendFileReadParams *params, BlendFileReadWMSetupData *wm_setup_data, BlendFileReadReport *reports, const bool startup_update_defaults, const char *startup_app_template)
 
void BKE_blendfile_read_setup_undo (bContext *C, BlendFileData *bfd, const BlendFileReadParams *params, BlendFileReadReport *reports)
 
BlendFileDataBKE_blendfile_read (const char *filepath, const BlendFileReadParams *params, BlendFileReadReport *reports)
 
BlendFileDataBKE_blendfile_read_from_memory (const void *file_buf, int file_buf_size, const BlendFileReadParams *params, ReportList *reports)
 
BlendFileDataBKE_blendfile_read_from_memfile (Main *bmain, MemFile *memfile, const BlendFileReadParams *params, ReportList *reports)
 
void BKE_blendfile_read_make_empty (bContext *C)
 
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 e.g.).

  • 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.
UserDefBKE_blendfile_userdef_read (const char *filepath, ReportList *reports)
 
UserDefBKE_blendfile_userdef_read_from_memory (const void *file_buf, int file_buf_size, ReportList *reports)
 
UserDefBKE_blendfile_userdef_from_defaults ()
 
bool BKE_blendfile_userdef_write (const char *filepath, ReportList *reports)
 
bool BKE_blendfile_userdef_write_app_template (const char *filepath, ReportList *reports)
 
bool BKE_blendfile_userdef_write_all (ReportList *reports)
 
Blend File IO (WorkSpace)
WorkspaceConfigFileDataBKE_blendfile_workspace_config_read (const char *filepath, const void *file_buf, int file_buf_size, ReportList *reports)
 
void BKE_blendfile_workspace_config_data_free (WorkspaceConfigFileData *workspace_config)
 

Variables

Blend File Write (Partial)
static CLG_LogRef LOG_PARTIALWRITE = {"bke.blendfile.partial_write"}
 

Detailed Description

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

Definition in file blendfile.cc.

Function Documentation

◆ BKE_blendfile_extension_check()

bool BKE_blendfile_extension_check ( const char * str)

Check whether given path ends with a blend file compatible extension (.blend, .ble or .blend.gz).

Parameters
strThe path to check.
Returns
true is this path ends with a blender file extension.

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().

◆ BKE_blendfile_is_readable()

bool BKE_blendfile_is_readable ( const char * path,
ReportList * reports )

Check whether a given path is actually a Blender-readable, valid .blend file.

Note
Currently does attempt to open and read (part of) the given 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().

◆ BKE_blendfile_library_path_explode()

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).

Parameters
paththe full path to explode.
r_dirthe 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_groupa pointer within r_dir to the 'group' part of the path, if any ('\0' terminated). May be NULL.
r_namea pointer within r_dir to the data-block name, if any ('\0' terminated). May be NULL.
Returns
true if path contains a blend file.

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().

◆ BKE_blendfile_read()

◆ BKE_blendfile_read_from_memfile()

BlendFileData * BKE_blendfile_read_from_memfile ( Main * bmain,
MemFile * memfile,
const BlendFileReadParams * params,
ReportList * reports )
Returns
Blend file data, this must be passed to BKE_blendfile_read_setup_readfile/BKE_blendfile_read_setup_undo when non-NULL.
Note
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().

◆ BKE_blendfile_read_from_memory()

BlendFileData * BKE_blendfile_read_from_memory ( const void * file_buf,
int file_buf_size,
const BlendFileReadParams * params,
ReportList * reports )

◆ BKE_blendfile_read_make_empty()

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().

◆ BKE_blendfile_read_setup_readfile()

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().

◆ BKE_blendfile_read_setup_undo()

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().

◆ BKE_blendfile_userdef_from_defaults()

◆ BKE_blendfile_userdef_read()

UserDef * BKE_blendfile_userdef_read ( const char * filepath,
ReportList * reports )

◆ BKE_blendfile_userdef_read_from_memory()

UserDef * BKE_blendfile_userdef_read_from_memory ( const void * file_buf,
int file_buf_size,
ReportList * reports )

◆ BKE_blendfile_userdef_write()

bool BKE_blendfile_userdef_write ( const char * filepath,
ReportList * reports )

Only write the UserDef in a .blend.

Returns
success.

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().

◆ BKE_blendfile_userdef_write_all()

◆ BKE_blendfile_userdef_write_app_template()

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.

Returns
success.
Note
In the future we should re-evaluate user preferences, possibly splitting out system/hardware specific preferences.

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().

◆ BKE_blendfile_workspace_config_data_free()

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().

◆ BKE_blendfile_workspace_config_read()

◆ clean_paths()

◆ foreach_path_clean_cb()

static bool foreach_path_clean_cb ( BPathForeachPathData * ,
char * path_dst,
size_t path_dst_maxncpy,
const char * path_src )
static

Definition at line 170 of file blendfile.cc.

References BLI_path_slash_native(), BLI_strncpy(), and STREQ.

Referenced by clean_paths().

◆ handle_subversion_warning()

static void handle_subversion_warning ( Main * main,
BlendFileReadReport * reports )
static

◆ reuse_bmain_data_dependencies_new_library_get()

◆ reuse_bmain_data_invalid_local_usages_fix()

static void reuse_bmain_data_invalid_local_usages_fix ( ReuseOldBMainData * reuse_data)
static

◆ reuse_bmain_data_invalid_local_usages_fix_cb()

◆ reuse_bmain_data_remapper_ensure()

static id::IDRemapper & reuse_bmain_data_remapper_ensure ( ReuseOldBMainData * reuse_data)
static

Search for all libraries in old_bmain that are also in new_bmain (i.e. different Library IDs having the same absolute filepath), and create a remapping rule for these.

NOTE: The case where the old_bmain would be a library in the newly read one is not handled here, as it does not create explicit issues. The local data from old_bmain is either discarded, or added to the new_bmain as local data as well. Worst case, there will be a double of a linked data as a local one, without any known relationships between them. In practice, this latter case is not expected to commonly happen.

Definition at line 261 of file blendfile.cc.

References blender::bke::id::IDRemapper::add(), Main::filepath, ReuseOldBMainData::is_libraries_remapped, Main::libraries, LISTBASE_FOREACH, ReuseOldBMainData::new_bmain, ReuseOldBMainData::old_bmain, ReuseOldBMainData::remapper, and STREQ.

Referenced by reuse_bmain_data_dependencies_new_library_get(), reuse_bmain_move_id(), reuse_editable_asset_bmain_data_dependencies_process_cb(), reuse_editable_asset_bmain_data_for_blendfile(), swap_old_bmain_data_for_blendfile(), swap_old_bmain_data_for_blendfile_dependencies_process_cb(), and swap_wm_data_for_blendfile().

◆ reuse_bmain_data_remapper_is_id_remapped()

◆ reuse_bmain_move_id()

◆ reuse_editable_asset_bmain_data_dependencies_process_cb()

◆ reuse_editable_asset_bmain_data_for_blendfile()

static void reuse_editable_asset_bmain_data_for_blendfile ( ReuseOldBMainData * reuse_data,
const short idcode )
static

Selectively 'import' data from old Main into new Main, provided it does not conflict with data already present in the new Main (name-wise and library-wise).

Dependencies from moved over old data are also imported into the new Main, (unless, in case of linked data, a matching linked ID is already available in new Main).

When a conflict is found, usages of the conflicted ID by the old data are stored in the remapper of ReuseOldBMainData to be remapped to the matching data in the new Main later.

NOTE: This function will never remove any original new data from the new Main, it only moves (some of) the old data to the new Main.

Definition at line 473 of file blendfile.cc.

References blender::bke::id::IDRemapper::add(), BKE_library_foreach_ID_link(), FOREACH_MAIN_LISTBASE_ID_BEGIN, FOREACH_MAIN_LISTBASE_ID_END, ID_IS_LINKED, IDWALK_DO_LIBRARY_POINTER, IDWALK_RECURSE, ID::lib, LIBRARY_ASSET_EDITABLE, ReuseOldBMainData::new_bmain, ReuseOldBMainData::old_bmain, reuse_bmain_data_dependencies_new_library_get(), reuse_bmain_data_remapper_ensure(), reuse_bmain_move_id(), reuse_editable_asset_bmain_data_dependencies_process_cb(), Library::runtime, Library_Runtime::tag, and which_libbase().

Referenced by setup_app_data().

◆ reuse_editable_asset_needed()

static bool reuse_editable_asset_needed ( ReuseOldBMainData * reuse_data)
static

◆ setup_app_blend_file_data()

static void setup_app_blend_file_data ( bContext * C,
BlendFileData * bfd,
const BlendFileReadParams * params,
BlendFileReadWMSetupData * wm_setup_data,
BlendFileReadReport * reports )
static

◆ setup_app_data()

static void setup_app_data ( bContext * C,
BlendFileData * bfd,
const BlendFileReadParams * params,
BlendFileReadWMSetupData * wm_setup_data,
BlendFileReadReport * reports )
static

This function runs after loading blend-file data and is responsible for setting up the context (the active view-layer, scene & work-space).

When loading a blend-file without it's UI (G_FILE_NO_UI), the existing screen-data needs to point to the newly loaded blend-file data.

Note
this is called on undo so any slow conversion functions here should be avoided or check mode != LOAD_UNDO.
Parameters
bfdBlend file data, freed by this function on exit.

Definition at line 883 of file blendfile.cc.

References BKE_blender_globals_main_replace(), BKE_idtype_get_info_from_idtype_index(), BKE_idtype_idcode_to_name(), BKE_lib_override_library_main_operations_create(), BKE_lib_override_library_main_resync(), BKE_libblock_remap_multiple_raw(), BKE_main_id_refcount_recompute(), BKE_main_idmap_create(), BKE_main_idmap_destroy(), BKE_main_namemap_validate(), BKE_report(), BKE_scene_add(), BKE_scene_set_background(), BKE_screen_gizmo_tag_refresh(), BKE_screen_runtime_refresh_for_blendfile(), BKE_screen_view3d_scene_sync(), BKE_view_layer_default_view(), BLI_assert, BLI_time_now_seconds(), BLO_read_do_version_after_setup(), BLO_reportf_wrap(), BPY_context_update(), clean_paths(), BlendFileReadReport::count, CTX_data_main_set(), CTX_data_scene_set(), CTX_py_init_get(), CTX_wm_area_set(), CTX_wm_manager(), CTX_wm_manager_set(), CTX_wm_region_popup_set(), CTX_wm_region_set(), CTX_wm_screen(), CTX_wm_screen_set(), CTX_wm_window(), BlendFileData::cur_view_layer, BlendFileData::curscene, BlendFileData::curscreen, BlendFileReadReport::duration, ELEM, BlendFileData::fileflags, BlendFileData::filepath, Main::filepath, Library_Runtime::filepath_abs, ListBase::first, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, G, G_FILE_ASSET_EDIT_FILE, G_FILE_FLAG_ALL_RUNTIME, G_FILE_NO_UI, G_FILE_RECOVER_READ, G_FLAG_ALL_READFILE, G_FLAG_ALL_RUNTIME, G_MAIN, BlendFileData::globalf, GS, IDTypeInfo::id_code, ID_IS_LINKED, ReuseOldBMainData::id_map, ID_REMAP_FORCE_UI_POINTERS, ID_REMAP_SKIP_UPDATE_TAGGING, ID_REMAP_SKIP_USER_CLEAR, ID_REMAP_SKIP_USER_REFCOUNT, ID_SCR, ID_TAG_MISSING, ID_TYPE_SUPPORTS_ASSET_EDITABLE, ID_WM, ID_WS, IMB_colormanagement_check_file_config(), INDEX_ID_MAX, Main::is_asset_edit_file, ID::lib, BlendFileReadReport::lib_overrides_resync, LISTBASE_FOREACH, BlendFileData::main, MAIN_IDMAP_TYPE_NAME, BlendFileReadReport::missing_linked_id, ID::name, ReuseOldBMainData::new_bmain, ReuseOldBMainData::old_bmain, params, Library_Runtime::parent, RE_FreeAllPersistentData(), RE_FreeAllRenderResults(), Main::recovered, ReuseOldBMainData::remapper, BlendFileReadReport::reports, reuse_bmain_data_invalid_local_usages_fix(), reuse_editable_asset_bmain_data_for_blendfile(), reuse_editable_asset_needed(), RPT_, RPT_INFO, RPT_WARNING, Library::runtime, wmWindow::scene, Main::scenes, Main::screens, STEP_INVALID, STRNCPY, swap_old_bmain_data_dependencies_process(), swap_old_bmain_data_for_blendfile(), swap_wm_data_for_blendfile(), ID::tag, unpin_file_local_grease_pencil_brush_materials(), USER_EXPERIMENTAL_TEST, wmWindowManager::windows, Main::wm, wm_data_consistency_ensure(), wm_scene_is_visible(), and ReuseOldBMainData::wm_setup_data.

Referenced by setup_app_blend_file_data().

◆ setup_app_userdef()

static void setup_app_userdef ( BlendFileData * bfd)
static

◆ swap_old_bmain_data_dependencies_process()

◆ swap_old_bmain_data_for_blendfile()

static void swap_old_bmain_data_for_blendfile ( ReuseOldBMainData * reuse_data,
const short id_code )
static

Does a complete replacement of data in new_bmain by data from old_bmain. Original new data are moved to theold_bmain`, and will be freed together with it.

WARNING: Currently only expects to work on local data, won't work properly if some of the IDs of given type are linked.

NOTE: Unlike with reuse_editable_asset_bmain_data_for_blendfile, there is no support at all for potential dependencies of the IDs moved around. This is not expected to be necessary for the current use cases (UI-related IDs).

Definition at line 547 of file blendfile.cc.

References blender::bke::id::IDRemapper::add(), blender::bke::id::IDRemapper::add_overwrite(), BKE_lib_libblock_session_uid_renew(), BKE_main_namemap_clear(), BLI_assert, BLI_listbase_is_empty(), ELEM, ListBase::first, FOREACH_MAIN_LISTBASE_ID_BEGIN, FOREACH_MAIN_LISTBASE_ID_END, ID_IS_LINKED, ListBase::last, ID::name, ReuseOldBMainData::new_bmain, ID::next, ReuseOldBMainData::old_bmain, reuse_bmain_data_remapper_ensure(), and which_libbase().

Referenced by setup_app_data(), and swap_wm_data_for_blendfile().

◆ swap_old_bmain_data_for_blendfile_dependencies_process_cb()

◆ swap_wm_data_for_blendfile()

◆ unpin_file_local_grease_pencil_brush_materials()

static void unpin_file_local_grease_pencil_brush_materials ( const ReuseOldBMainData * reuse_data)
static

Grease pencil brushes may have a material pinned that is from the current file. Moving local scene data to a different Main is tricky, so in that case, unpin the material.

Definition at line 519 of file blendfile.cc.

References Main::brushes, BrushGpencilSettings::flag, FOREACH_MAIN_LISTBASE_ID_BEGIN, FOREACH_MAIN_LISTBASE_ID_END, Brush::gpencil_settings, ID_IS_LINKED, BrushGpencilSettings::material, and ReuseOldBMainData::old_bmain.

Referenced by setup_app_data().

◆ view3d_data_consistency_ensure()

◆ wm_data_consistency_ensure()

static void wm_data_consistency_ensure ( wmWindowManager * curwm,
Scene * cur_scene,
ViewLayer * cur_view_layer )
static

◆ wm_scene_is_visible()

static bool wm_scene_is_visible ( wmWindowManager * wm,
Scene * scene )
static

Definition at line 196 of file blendfile.cc.

References LISTBASE_FOREACH, and wmWindowManager::windows.

Referenced by setup_app_data().

Variable Documentation

◆ LOG_PARTIALWRITE