diff options
Diffstat (limited to 'source/blender/windowmanager/intern/wm_init_exit.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_init_exit.c | 49 |
1 files changed, 31 insertions, 18 deletions
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index a0ac945b647..e08d0afb906 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -64,6 +64,7 @@ #include "BKE_mball_tessellate.h" #include "BKE_node.h" #include "BKE_report.h" +#include "BKE_font.h" #include "BKE_addon.h" #include "BKE_appdir.h" @@ -96,9 +97,11 @@ #include "wm_files.h" #include "wm_window.h" +#include "ED_anim_api.h" #include "ED_armature.h" #include "ED_gpencil.h" #include "ED_keyframing.h" +#include "ED_keyframes_edit.h" #include "ED_node.h" #include "ED_render.h" #include "ED_space_api.h" @@ -118,7 +121,7 @@ #include "COM_compositor.h" #ifdef WITH_OPENSUBDIV -# include "opensubdiv_capi.h" +# include "BKE_subsurf.h" #endif static void wm_init_reports(bContext *C) @@ -174,6 +177,10 @@ void WM_init(bContext *C, int argc, const char **argv) /* Enforce loading the UI for the initial homefile */ G.fileflags &= ~G_FILE_NO_UI; + /* reports cant be initialized before the wm, + * but keep before file reading, since that may report errors */ + wm_init_reports(C); + /* get the default database, plus a wm */ wm_homefile_read(C, NULL, G.factory_startup, NULL); @@ -192,7 +199,7 @@ void WM_init(bContext *C, int argc, const char **argv) GPU_set_gpu_mipmapping(U.use_gpu_mipmap); #ifdef WITH_OPENSUBDIV - openSubdiv_init(); + BKE_subsurf_osd_init(); #endif UI_init(); @@ -229,8 +236,6 @@ void WM_init(bContext *C, int argc, const char **argv) if (!G.background && !wm_start_with_console) GHOST_toggleConsole(3); - wm_init_reports(C); /* reports cant be initialized before the wm */ - clear_matcopybuf(); ED_render_clear_mtex_copybuf(); @@ -259,13 +264,24 @@ void WM_init(bContext *C, int argc, const char **argv) /* that prevents loading both the kept session, and the file on the command line */ } else { + /* note, logic here is from wm_file_read_post, + * call functions that depend on Python being initialized. */ + /* normally 'wm_homefile_read' will do this, * however python is not initialized when called from this function. * * unlikely any handlers are set but its possible, * note that recovering the last session does its own callbacks. */ + CTX_wm_window_set(C, CTX_wm_manager(C)->windows.first); + BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_VERSION_UPDATE); BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST); + + wm_file_read_report(C); + + if (!G.background) { + CTX_wm_window_set(C, NULL); + } } } @@ -385,13 +401,6 @@ static void free_openrecent(void) } -/* bad stuff*/ - -// XXX copy/paste buffer stuff... -extern void free_anim_copybuf(void); -extern void free_anim_drivers_copybuf(void); -extern void free_fmodifiers_copybuf(void); - #ifdef WIN32 /* Read console events until there is a key event. Also returns on any error. */ static void wait_for_console_key(void) @@ -415,8 +424,9 @@ static void wait_for_console_key(void) } #endif -/* called in creator.c even... tsk, split this! */ -/* note, doesnt run exit() call WM_exit() for that */ +/** + * \note doesn't run exit() call #WM_exit() for that. + */ void WM_exit_ext(bContext *C, const bool do_python) { wmWindowManager *wm = C ? CTX_wm_manager(C) : NULL; @@ -490,6 +500,7 @@ void WM_exit_ext(bContext *C, const bool do_python) BKE_sequencer_free_clipboard(); /* sequencer.c */ BKE_tracking_clipboard_free(); BKE_mask_clipboard_free(); + BKE_vfont_clipboard_free(); #ifdef WITH_COMPOSITOR COM_deinitialize(); @@ -497,9 +508,11 @@ void WM_exit_ext(bContext *C, const bool do_python) free_blender(); /* blender.c, does entire library and spacetypes */ // free_matcopybuf(); - free_anim_copybuf(); - free_anim_drivers_copybuf(); - free_fmodifiers_copybuf(); + ANIM_fcurves_copybuf_free(); + ANIM_drivers_copybuf_free(); + ANIM_driver_vars_copybuf_free(); + ANIM_fmodifiers_copybuf_free(); + ED_gpencil_anim_copybuf_free(); ED_gpencil_strokes_copybuf_free(); ED_clipboard_posebuf_free(); BKE_node_clipboard_clear(); @@ -533,11 +546,11 @@ void WM_exit_ext(bContext *C, const bool do_python) (void)do_python; #endif + if (!G.background) { #ifdef WITH_OPENSUBDIV - openSubdiv_cleanup(); + BKE_subsurf_osd_cleanup(); #endif - if (!G.background) { GPU_global_buffer_pool_free(); GPU_free_unused_buffers(); |