81 strcpy(path_dst, path_src);
83 return !
STREQ(path_dst, path_src);
144 const bool is_startup =
params->is_startup;
169 if (mode != LOAD_UNDO) {
174 if (mode != LOAD_UNDO) {
181 if (mode != LOAD_UI) {
198 bool track_undo_scene;
208 if (mode != LOAD_UNDO) {
233 track_undo_scene = (mode == LOAD_UNDO && curscreen && curscene && bfd->
main->
wm.
first);
235 if (curscene ==
NULL) {
239 if (curscene ==
NULL) {
242 if (cur_view_layer ==
NULL) {
247 if (track_undo_scene) {
253 win->
scene = curscene;
259 curscene = win->
scene;
262 if (track_undo_scene) {
266 win->
scene = curscene;
289 if (mode != LOAD_UI) {
305 G.fileflags = (
G.fileflags & fileflags_keep) | (bfd->
fileflags & ~fileflags_keep);
349 bmain->
name[0] =
'\0';
359 if (mode == LOAD_UI) {
364 if (win->scene && win->scene != curscene) {
375 if (mode != LOAD_UNDO) {
381 if (mode != LOAD_UNDO) {
386 if (mode == LOAD_UNDO) {
428 "File written by newer Blender binary (%d.%d), expect loss of data!",
429 main->minversionfile,
430 main->minsubversionfile);
447 const bool startup_update_defaults,
448 const char *startup_app_template)
450 if (startup_update_defaults) {
475 if (
params->is_startup ==
false) {
476 printf(
"Read blend: %s\n", filepath);
599 memcpy(userdef, &
U_default,
sizeof(*userdef));
603 const char *addons[] = {
615 for (
int i = 0; i <
ARRAY_SIZE(addons); i++) {
630 #ifdef WITH_PYTHON_SECURITY
704 if (userdef_default ==
NULL) {
727 printf(
"Writing userprefs: '%s' ", filepath);
728 if (use_template_userpref) {
747 if (use_template_userpref) {
752 printf(
"Writing userprefs app-template: '%s' ", filepath);
768 U.runtime.is_dirty =
false;
789 workspace_config =
MEM_callocN(
sizeof(*workspace_config), __func__);
801 return workspace_config;
872 const char *filepath,
873 const int write_flags,
874 const int remap_mode,
881 void *path_list_backup =
NULL;
896 ListBase *lb_dst = lbarray_dst[
a], *lb_src = lbarray_src[
a];
898 for (
id = lb_src->first;
id;
id = nextid) {
925 .remap_mode = remap_mode,
929 if (path_list_backup) {
939 ListBase *lb_dst = lbarray_dst[
a], *lb_src = lbarray_src[
a];
struct bAddon * BKE_addon_new(void)
const char * BKE_appdir_folder_id_create(const int folder_id, const char *subfolder)
bool BKE_appdir_font_folder_default(char *dir)
#define BLENDER_USERPREF_FILE
bool BKE_appdir_app_template_has_userpref(const char *app_template)
void BKE_blender_globals_clear(void)
void BKE_blender_userdef_data_free(struct UserDef *userdef, bool clear_fonts)
void BKE_blender_userdef_data_set_and_free(struct UserDef *userdef)
void BKE_blender_userdef_app_template_data_swap(struct UserDef *userdef_a, struct UserDef *userdef_b)
#define BLENDER_FILE_SUBVERSION
#define BLENDER_FILE_VERSION
void BKE_bpath_traverse_main(struct Main *bmain, BPathVisitor visit_cb, const int flag, void *bpath_user_data)
void BKE_bpath_list_restore(struct Main *bmain, const int flag, void *ls_handle)
void BKE_bpath_list_free(void *ls_handle)
@ BKE_BPATH_TRAVERSE_SKIP_MULTIFILE
@ BKE_BPATH_TRAVERSE_SKIP_LIBRARY
void * BKE_bpath_list_backup(struct Main *bmain, const int flag)
void BKE_colorband_init(struct ColorBand *coba, bool rangetype)
struct Scene * CTX_data_scene(const bContext *C)
void CTX_wm_region_set(bContext *C, struct ARegion *region)
void CTX_data_scene_set(bContext *C, struct Scene *scene)
bool CTX_py_init_get(bContext *C)
void CTX_wm_menu_set(bContext *C, struct ARegion *menu)
struct wmWindowManager * CTX_wm_manager(const bContext *C)
struct bScreen * CTX_wm_screen(const bContext *C)
void CTX_wm_screen_set(bContext *C, struct bScreen *screen)
void CTX_data_main_set(bContext *C, struct Main *bmain)
void CTX_wm_area_set(bContext *C, struct ScrArea *area)
void CTX_wm_manager_set(bContext *C, struct wmWindowManager *wm)
struct Main * CTX_data_main(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
#define G_FLAG_ALL_READFILE
#define G_FILE_FLAG_ALL_RUNTIME
#define G_FLAG_ALL_RUNTIME
void do_versions_ipos_to_animato(struct Main *main)
struct ViewLayer * BKE_view_layer_default_view(const struct Scene *scene)
void BKE_lib_libblock_session_uuid_renew(struct ID *id)
void BKE_main_id_tag_all(struct Main *mainvar, const int tag, const bool value)
void BKE_id_delete(struct Main *bmain, void *idv) ATTR_NONNULL()
void BKE_main_id_refcount_recompute(struct Main *bmain, const bool do_linked_only)
void id_sort_by_name(struct ListBase *lb, struct ID *id, struct ID *id_sorting_hint)
bool BKE_lib_override_library_main_operations_create(struct Main *bmain, const bool force_auto)
void BKE_lib_override_library_main_resync(struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer)
#define FOREACH_MAIN_LISTBASE_ID_END
int set_listbasepointers(struct Main *main, struct ListBase *lb[])
#define FOREACH_MAIN_LISTBASE_ID_BEGIN(_lb, _id)
#define FOREACH_MAIN_LISTBASE_END
const char * BKE_main_blendfile_path(const struct Main *bmain) ATTR_NONNULL()
#define FOREACH_MAIN_LISTBASE_BEGIN(_bmain, _lb)
void BKE_main_free(struct Main *mainvar)
void BKE_preferences_asset_library_default_add(struct UserDef *userdef) ATTR_NONNULL()
void BKE_report(ReportList *reports, ReportType type, const char *message)
void BKE_reports_prependf(ReportList *reports, const char *prepend,...) ATTR_PRINTF_FORMAT(2
void void BKE_reports_prepend(ReportList *reports, const char *prepend)
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_scene_set_background(struct Main *bmain, struct Scene *sce)
struct Scene * BKE_scene_add(struct Main *bmain, const char *name)
void BKE_screen_view3d_scene_sync(struct bScreen *screen, struct Scene *scene)
void BKE_screen_gizmo_tag_refresh(struct bScreen *screen)
void BKE_studiolight_default(SolidLight lights[4], float light_ambient[4])
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void * BLI_pophead(ListBase *listbase) ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE int min_ii(int a, int b)
size_t BLI_path_join(char *__restrict dst, const size_t dst_len, const char *path_first,...) ATTR_NONNULL(1
void BLI_path_slash_native(char *path) ATTR_NONNULL()
#define STRNCPY(dst, src)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
int BLI_system_memory_max_in_megabytes_int(void)
external readfile function prototypes.
const struct UserDef U_default
void BLO_update_defaults_startup_blend(struct Main *bmain, const char *app_template)
void BLO_main_expander(BLOExpandDoitCallback expand_doit_func)
BlendFileData * BLO_read_from_memfile(struct Main *oldmain, const char *filename, struct MemFile *memfile, const struct BlendFileReadParams *params, struct ReportList *reports)
void BLO_expand_main(void *fdhandle, struct Main *mainvar)
void blo_lib_link_restore(struct Main *oldmain, struct Main *newmain, struct wmWindowManager *curwm, struct Scene *curscene, struct ViewLayer *cur_view_layer)
#define BLO_READ_SKIP_ALL
BlendFileData * BLO_read_from_file(const char *filepath, eBLOReadSkip skip_flags, struct ReportList *reports)
const struct bTheme U_theme_default
BlendFileData * BLO_read_from_memory(const void *mem, int memsize, eBLOReadSkip skip_flags, struct ReportList *reports)
void BLO_blendfiledata_free(BlendFileData *bfd)
external writefile function prototypes.
bool BLO_write_file(struct Main *mainvar, const char *filepath, const int write_flags, const struct BlendFileWriteParams *params, struct ReportList *reports)
@ BLO_WRITE_PATH_REMAP_NONE
void BPY_context_update(struct bContext *C)
@ USER_SCRIPT_AUTOEXEC_DISABLE
#define USER_EXPERIMENTAL_TEST(userdef, member)
void IMB_colormanagement_check_file_config(struct Main *bmain)
Read Guarded memory(de)allocation.
struct BlendFileData * BKE_blendfile_read_from_memory(const void *filebuf, int filelength, const struct BlendFileReadParams *params, ReportList *reports)
struct BlendFileData * BKE_blendfile_read_from_memfile(Main *bmain, struct MemFile *memfile, const struct BlendFileReadParams *params, ReportList *reports)
bool BKE_blendfile_userdef_write_all(ReportList *reports)
UserDef * BKE_blendfile_userdef_read_from_memory(const void *filebuf, int filelength, ReportList *reports)
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)
struct BlendFileData * BKE_blendfile_read(const char *filepath, const struct BlendFileReadParams *params, ReportList *reports)
bool BKE_blendfile_userdef_write(const char *filepath, ReportList *reports)
static void clean_paths(Main *main)
void BKE_blendfile_read_make_empty(bContext *C)
void BKE_blendfile_workspace_config_data_free(WorkspaceConfigFileData *workspace_config)
static void setup_app_blend_file_data(bContext *C, BlendFileData *bfd, const struct BlendFileReadParams *params, ReportList *reports)
UserDef * BKE_blendfile_userdef_from_defaults(void)
static void blendfile_write_partial_cb(void *UNUSED(handle), Main *UNUSED(bmain), void *vid)
void BKE_blendfile_write_partial_end(Main *bmain_src)
UserDef * BKE_blendfile_userdef_read(const char *filepath, ReportList *reports)
bool BKE_blendfile_write_partial(Main *bmain_src, const char *filepath, const int write_flags, const int remap_mode, ReportList *reports)
void BKE_blendfile_write_partial_begin(Main *bmain_src)
static void handle_subversion_warning(Main *main, ReportList *reports)
static void setup_app_data(bContext *C, BlendFileData *bfd, const struct BlendFileReadParams *params, ReportList *reports)
static bool wm_scene_is_visible(wmWindowManager *wm, Scene *scene)
void BKE_blendfile_read_setup(bContext *C, BlendFileData *bfd, const struct BlendFileReadParams *params, ReportList *reports)
bool BKE_blendfile_userdef_write_app_template(const char *filepath, ReportList *reports)
static bool clean_paths_visit_cb(void *UNUSED(userdata), char *path_dst, const char *path_src)
bool BKE_blendfile_workspace_config_write(Main *bmain, const char *filepath, ReportList *reports)
static void setup_app_userdef(BlendFileData *bfd)
void BKE_blendfile_write_partial_tag_ID(ID *id, bool set)
WorkspaceConfigFileData * BKE_blendfile_workspace_config_read(const char *filepath, const void *filebuf, int filelength, ReportList *reports)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
int main(int argc, char **argv)
void RE_FreeAllPersistentData(void)
void RE_FreeAllRenderResults(void)
struct bScreen * curscreen
struct ViewLayer * cur_view_layer
UserDef_Experimental experimental
struct SolidLight light_param[4]
struct ColorBand coba_weight
struct ListBase workspaces