Blender V4.5
wm_init_exit.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2007 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11#include <cstdio>
12#include <cstdlib>
13#include <cstring>
14
15#include "MEM_guardedalloc.h"
16
17#include "CLG_log.h"
18
19#include "DNA_genfile.h"
20#include "DNA_scene_types.h"
21#include "DNA_userdef_types.h"
23
24#include "BLI_listbase.h"
25#include "BLI_path_utils.hh"
26#include "BLI_string.h"
27#include "BLI_task.h"
28#include "BLI_threads.h"
29#include "BLI_timer.h"
30#include "BLI_utildefines.h"
31
32#include "BLO_undofile.hh"
33#include "BLO_writefile.hh"
34
35#include "BKE_blender.hh"
36#include "BKE_blendfile.hh"
37#include "BKE_context.hh"
38#include "BKE_global.hh"
39#include "BKE_icons.h"
40#include "BKE_image.hh"
41#include "BKE_keyconfig.h"
42#include "BKE_lib_remap.hh"
43#include "BKE_main.hh"
45#include "BKE_preferences.h"
46#include "BKE_preview_image.hh"
47#include "BKE_scene.hh"
48#include "BKE_screen.hh"
49#include "BKE_sound.h"
50#include "BKE_vfont.hh"
51
52#include "BKE_addon.h"
53#include "BKE_appdir.hh"
55#include "BKE_mask.h" /* Free mask clipboard. */
56#include "BKE_material.hh" /* #BKE_material_copybuf_clear. */
57#include "BKE_studiolight.h"
58#include "BKE_subdiv.hh"
59#include "BKE_tracking.h" /* Free tracking clipboard. */
60
61#include "RE_engine.h"
62#include "RE_pipeline.h" /* `RE_` free stuff. */
63
64#ifdef WITH_PYTHON
65# include "BPY_extern_python.hh"
66# include "BPY_extern_run.hh"
67#endif
68
69#include "GHOST_C-api.h"
70
71#include "RNA_define.hh"
72
73#include "WM_api.hh"
74#include "WM_keymap.hh"
75#include "WM_message.hh"
76#include "WM_types.hh"
77
78#include "wm.hh"
79#include "wm_cursors.hh"
80#include "wm_event_system.hh"
81#include "wm_files.hh"
83#include "wm_surface.hh"
84#include "wm_window.hh"
85
86#include "ED_anim_api.hh"
87#include "ED_asset.hh"
88#include "ED_gpencil_legacy.hh"
89#include "ED_grease_pencil.hh"
90#include "ED_keyframes_edit.hh"
91#include "ED_keyframing.hh"
92#include "ED_node.hh"
93#include "ED_render.hh"
94#include "ED_screen.hh"
95#include "ED_space_api.hh"
96#include "ED_undo.hh"
97#include "ED_util.hh"
98
99#include "BLF_api.hh"
100#include "BLT_lang.hh"
101
102#include "UI_interface.hh"
103#include "UI_resources.hh"
104#include "UI_string_search.hh"
105
106#include "GPU_context.hh"
107#include "GPU_init_exit.hh"
108#include "GPU_shader.hh"
109
110#include "COM_compositor.hh"
111
112#include "DEG_depsgraph.hh"
113#include "DEG_depsgraph_query.hh"
114
115#include "ANIM_keyingsets.hh"
116
117#include "DRW_engine.hh"
118
126
128
129static bool wm_start_with_console = false;
130
132{
133 wm_start_with_console = value;
134}
135
143static bool gpu_is_init = false;
144
146{
147 /* Must be called only once. */
148 BLI_assert(gpu_is_init == false);
149
150 if (G.background) {
151 /* Ghost is still not initialized elsewhere in background mode. */
153 }
154
155 if (!GPU_backend_supported()) {
156 return;
157 }
158
159 /* Needs to be first to have an OpenGL context bound. */
161
162 GPU_init();
163
164 if (G.debug & G_DEBUG_GPU_COMPILE_SHADERS) {
166 }
167
168 gpu_is_init = true;
169}
170
171static void sound_jack_sync_callback(Main *bmain, int mode, double time)
172{
173 /* Ugly: Blender doesn't like it when the animation is played back during rendering. */
174 if (G.is_rendering) {
175 return;
176 }
177
178 wmWindowManager *wm = static_cast<wmWindowManager *>(bmain->wm.first);
179
180 LISTBASE_FOREACH (wmWindow *, window, &wm->windows) {
181 Scene *scene = WM_window_get_active_scene(window);
182 if ((scene->audio.flag & AUDIO_SYNC) == 0) {
183 continue;
184 }
185 ViewLayer *view_layer = WM_window_get_active_view_layer(window);
186 Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, view_layer);
187 if (depsgraph == nullptr) {
188 continue;
189 }
191 BKE_sound_jack_scene_update(scene_eval, mode, time);
192 }
193}
194
195void WM_init(bContext *C, int argc, const char **argv)
196{
197
198 if (!G.background) {
199 wm_ghost_init(C); /* NOTE: it assigns C to ghost! */
202 }
203
206
208
209 WM_paneltype_init(); /* Lookup table only. */
214
216
223
225
227
228 BLF_init();
229
231 /* Must call first before doing any `.blend` file reading,
232 * since versioning code may create new IDs. See #57066. */
233 BLT_lang_set(nullptr);
234
235 /* Init icons & previews before reading .blend files for preview icons, which can
236 * get triggered by the depsgraph. This is also done in background mode
237 * for scripts that do background processing with preview icons. */
240
242
243 /* Studio-lights needs to be init before we read the home-file,
244 * otherwise the versioning cannot find the default studio-light. */
246
247 BLI_assert((G.fileflags & G_FILE_NO_UI) == 0);
248
267 wmFileReadPost_Params *params_file_read_post = nullptr;
268 wmHomeFileRead_Params read_homefile_params{};
269 read_homefile_params.use_data = true;
270 read_homefile_params.use_userdef = true;
271 read_homefile_params.use_factory_settings = G.factory_startup;
272 read_homefile_params.use_empty_data = false;
273 read_homefile_params.filepath_startup_override = nullptr;
275 read_homefile_params.is_first_time = true;
276
277 wm_homefile_read_ex(C, &read_homefile_params, nullptr, &params_file_read_post);
278
279 /* NOTE: leave `G_MAIN->filepath` set to an empty string since this
280 * matches behavior after loading a new file. */
281 BLI_assert(G_MAIN->filepath[0] == '\0');
282
283 /* Call again to set from preferences. */
284 BLT_lang_set(nullptr);
285
286 /* For file-system. Called here so can include user preference paths if needed. */
287 ED_file_init();
288
289 if (!G.background) {
291
292#ifdef WITH_INPUT_NDOF
293 /* Sets 3D mouse dead-zone. */
294 WM_ndof_deadzone_set(U.ndof_deadzone);
295#endif
296 WM_init_gpu();
297
299 WM_exit(C, -1);
300 }
301
303 UI_init();
306 }
307
309
311
312#ifdef WITH_PYTHON
313 BPY_python_start(C, argc, argv);
315#else
316 UNUSED_VARS(argc, argv);
317#endif
318
319 if (!G.background) {
322 }
323 else {
325 }
326 }
327
329
331
332 if (!G.background) {
334 }
335
336 STRNCPY(G.filepath_last_library, BKE_main_blendfile_path_from_global());
337
338 CTX_py_init_set(C, true);
339
340 /* Postpone updating the key-configuration until after add-ons have been registered,
341 * needed to properly load user-configured add-on key-maps, see: #113603. */
343
345
346 /* Load add-ons after key-maps have been initialized (but before the blend file has been read),
347 * important to guarantee default key-maps have been declared & before post-read handlers run. */
349
351 WM_keyconfig_update_on_startup(static_cast<wmWindowManager *>(G_MAIN->wm.first));
352
353 wm_homefile_read_post(C, params_file_read_post);
354}
355
357{
358 if (U.uiflag & USER_SPLASH_DISABLE) {
359 return false;
360 }
361
362 bool use_splash = false;
363
364 const char *blendfile_path = BKE_main_blendfile_path_from_global();
365 if (blendfile_path[0] == '\0') {
366 /* Common case, no file is loaded, show the splash. */
367 use_splash = true;
368 }
369 else {
370 /* A less common case, if there is no user preferences, show the splash screen
371 * so the user has the opportunity to restore settings from a previous version. */
372 use_splash = !blender::bke::preferences::exists();
373 }
374
375 return use_splash;
376}
377
379{
381 return;
382 }
383
385}
386
388{
390 /* NOTE(@ideasman42): this should practically never happen. */
392 return;
393 }
394
395 wmWindow *prevwin = CTX_wm_window(C);
396 CTX_wm_window_set(C, static_cast<wmWindow *>(wm->windows.first));
397 WM_operator_name_call(C, "WM_OT_splash", WM_OP_INVOKE_DEFAULT, nullptr, nullptr);
398 CTX_wm_window_set(C, prevwin);
399}
400
403{
404#ifdef WITH_PYTHON
405 const char *imports[] = {"bpy", nullptr};
406 BPY_run_string_eval(C, imports, "bpy.utils.load_scripts_extensions()");
407#else
408 UNUSED_VARS(C);
409#endif
410}
411
412/* Free strings of open recent files. */
413static void free_openrecent()
414{
415 LISTBASE_FOREACH (RecentFile *, recent, &G.recent_files) {
416 MEM_freeN(recent->filepath);
417 }
418
419 BLI_freelistN(&(G.recent_files));
420}
421
422static int wm_exit_handler(bContext *C, const wmEvent *event, void *userdata)
423{
424 WM_exit(C, EXIT_SUCCESS);
425
426 UNUSED_VARS(event, userdata);
427 return WM_UI_HANDLER_BREAK;
428}
429
431{
432 /* What we do here is a little bit hacky, but quite simple and doesn't require bigger
433 * changes: Add a handler wrapping WM_exit() to cause a delayed call of it. */
434
435 wmWindow *win = CTX_wm_window(C);
436
437 /* Use modal UI handler for now.
438 * Could add separate WM handlers or so, but probably not worth it. */
440 C, &win->modalhandlers, wm_exit_handler, nullptr, nullptr, eWM_EventHandlerFlag(0));
441 WM_event_add_mousemove(win); /* Ensure handler actually gets called. */
442}
443
444void UV_clipboard_free();
445
446void WM_exit_ex(bContext *C, const bool do_python_exit, const bool do_user_exit_actions)
447{
448 using namespace blender;
449 wmWindowManager *wm = C ? CTX_wm_manager(C) : nullptr;
450
451 /* While nothing technically prevents saving user data in background mode,
452 * don't do this as not typically useful and more likely to cause problems
453 * if automated scripts happen to write changes to the preferences for example.
454 * Saving #BLENDER_QUIT_FILE is also not likely to be desired either. */
455 BLI_assert(G.background ? (do_user_exit_actions == false) : true);
456
457 /* First wrap up running stuff, we assume only the active WM is running. */
458 /* Modal handlers are on window level freed, others too? */
459 /* NOTE: same code copied in `wm_files.cc`. */
460 if (C && wm) {
461 if (do_user_exit_actions) {
462 /* Save quit.blend. */
463 Main *bmain = CTX_data_main(C);
464 char filepath[FILE_MAX];
465 const int fileflags = G.fileflags | G_FILE_COMPRESS | G_FILE_RECOVER_WRITE;
466
467 BLI_path_join(filepath, sizeof(filepath), BKE_tempdir_base(), BLENDER_QUIT_FILE);
468
470
471 BlendFileWriteParams blend_file_write_params{};
472 if (BLO_write_file(bmain, filepath, fileflags, &blend_file_write_params, nullptr)) {
473 if (!G.quiet) {
474 printf("Saved session recovery to \"%s\"\n", filepath);
475 }
476 }
477 }
478
480
481 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
482 CTX_wm_window_set(C, win); /* Needed by operator close callbacks. */
483 WM_event_remove_handlers(C, &win->handlers);
484 WM_event_remove_handlers(C, &win->modalhandlers);
486 }
487
488 if (!G.background) {
490 }
491
492 if (do_user_exit_actions) {
493 if ((U.pref_flag & USER_PREF_FLAG_SAVE) && ((G.f & G_FLAG_USERPREF_NO_SAVE_ON_EXIT) == 0)) {
494 if (U.runtime.is_dirty) {
496 }
497 }
498 /* Free the callback data used on file-open
499 * (will be set when a recover operation has run). */
500 wm_test_autorun_revert_action_set(nullptr, nullptr);
501 }
502 }
503
504#if defined(WITH_PYTHON) && !defined(WITH_PYTHON_MODULE)
505 /* Without this, we there isn't a good way to manage false-positive resource leaks
506 * where a #PyObject references memory allocated with guarded-alloc, #71362.
507 *
508 * This allows add-ons to free resources when unregistered (which is good practice anyway).
509 *
510 * Don't run this code when built as a Python module as this runs when Python is in the
511 * process of shutting down, where running a snippet like this will crash, see #82675.
512 * Instead use the `atexit` module, installed by #BPY_python_start.
513 *
514 * Don't run this code when `C` is null because #pyrna_unregister_class
515 * passes in `CTX_data_main(C)` to un-registration functions.
516 * Further: `addon_utils.disable_all()` may call into functions that expect a valid context,
517 * supporting all these code-paths with a null context is quite involved for such a corner-case.
518 *
519 * Check `CTX_py_init_get(C)` in case this function runs before Python has been initialized.
520 * Which can happen when the GPU backend fails to initialize.
521 */
522 if (C && CTX_py_init_get(C)) {
523 /* Calls `addon_utils.disable_all()` as well as unregistering all "startup" modules. */
524 const char *imports[] = {"bpy", "bpy.utils", nullptr};
525 BPY_run_string_eval(C, imports, "bpy.utils._on_exit()");
526 }
527#endif
528
529 /* Perform this early in case commands reference other data freed later in this function.
530 * This most run:
531 * - After add-ons are disabled because they may unregister commands.
532 * - Before Python exits so Python objects can be de-referenced.
533 * - Before #BKE_blender_atexit runs they free the `argv` on WIN32.
534 */
536
538
540
544
549
550 /* All non-screen and non-space stuff editors did, like edit-mode. */
551 if (C) {
552 Main *bmain = CTX_data_main(C);
553 ED_editors_exit(bmain, true);
554 }
555
557
559
560 /* Render code might still access databases. */
563
564 ED_preview_free_dbase(); /* Frees a Main dbase, before #BKE_blender_free! */
567
575
577
579
580 if (gpu_is_init) {
582 }
583
584 /* Frees the entire library (#G_MAIN) and space-types. */
586
587 /* Important this runs after #BKE_blender_free because the window manager may be allocated
588 * when `C` is null, holding references to undo steps which will fail to free if their types
589 * have been freed first. */
591
592 /* Free the GPU subdivision data after the database to ensure that subdivision structs used by
593 * the modifiers were garbage collected. */
594 if (gpu_is_init) {
596 }
597
604
605 /* Free gizmo-maps after freeing blender,
606 * so no deleted data get accessed during cleaning up of areas. */
610 /* Same for UI-list types. */
612
613 BLF_exit();
614
616
618
619 // free_txt_data();
620
621#ifdef WITH_PYTHON
622 /* Option not to exit Python so this function can be called from 'atexit'. */
623 if ((C == nullptr) || CTX_py_init_get(C)) {
624 /* NOTE: (old note)
625 * before BKE_blender_free so Python's garbage-collection happens while library still exists.
626 * Needed at least for a rare crash that can happen in python-drivers.
627 *
628 * Update for Blender 2.5, move after #BKE_blender_free because Blender now holds references
629 * to #PyObject's so #Py_DECREF'ing them after Python ends causes bad problems every time
630 * the python-driver bug can be fixed if it happens again we can deal with it then. */
631 BPY_python_end(do_python_exit);
632 }
633#else
634 (void)do_python_exit;
635#endif
636
637 ED_file_exit(); /* For file-selector menu data. */
638
639 /* Delete GPU resources and context. The UI also uses GPU resources and so
640 * is also deleted with the context active. */
641 if (gpu_is_init) {
643 UI_exit();
645 GPU_exit();
648 }
649 else {
650 UI_exit();
651 }
652
654
655 RNA_exit(); /* Should be after #BPY_python_end so struct python slots are cleared. */
656
658
659 if (C) {
660 CTX_free(C);
661 }
662
664
667
668 /* No need to call this early, rather do it late so that other
669 * pieces of Blender using sound may exit cleanly, see also #50676. */
671
673
675
677
679
680 /* Logging cannot be called after exiting (#CLOG_INFO, #CLOG_WARN etc will crash).
681 * So postpone exiting until other sub-systems that may use logging have shut down. */
682 CLG_exit();
683}
684
685void WM_exit(bContext *C, const int exit_code)
686{
687 const bool do_user_exit_actions = G.background ? false : (exit_code == EXIT_SUCCESS);
688 WM_exit_ex(C, true, do_user_exit_actions);
689
690 if (!G.quiet) {
691 printf("\nBlender quit\n");
692 }
693
694 exit(exit_code);
695}
696
698{
700
701 /* Any operators referenced by gizmos may now be a dangling pointer.
702 *
703 * While it is possible to inspect the gizmos it's simpler to re-create them,
704 * especially for script reloading - where we can accept slower logic
705 * for the sake of simplicity, see #126852. */
707}
Functionality to interact with keying sets.
void BKE_addon_pref_type_free(void)
Definition addon.cc:123
void BKE_addon_pref_type_init(void)
Definition addon.cc:117
void BKE_appdir_exit()
Definition appdir.cc:101
#define BLENDER_QUIT_FILE
const char * BKE_tempdir_base() ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
Definition appdir.cc:1249
void BKE_tempdir_session_purge()
Definition appdir.cc:1254
Blender util stuff.
void BKE_blender_atexit()
Definition blender.cc:512
void BKE_blender_userdef_data_free(UserDef *userdef, bool clear_fonts)
Definition blender.cc:356
void BKE_blender_free()
Definition blender.cc:60
Blender CLI Generic --command Support.
void BKE_blender_cli_command_free_all()
bool BKE_blendfile_userdef_write_all(ReportList *reports)
bool CTX_py_init_get(bContext *C)
void CTX_py_init_set(bContext *C, bool value)
wmWindow * CTX_wm_window(const bContext *C)
void CTX_free(bContext *C)
void CTX_wm_window_set(bContext *C, wmWindow *win)
Main * CTX_data_main(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
@ G_FLAG_USERPREF_NO_SAVE_ON_EXIT
#define G_MAIN
@ G_DEBUG_GPU_COMPILE_SHADERS
@ G_FILE_RECOVER_WRITE
@ G_FILE_NO_UI
@ G_FILE_COMPRESS
void BKE_icons_init(int first_dyn_id)
Definition icons.cc:165
void BKE_image_free_unused_gpu_textures()
Definition image_gpu.cc:536
void BKE_keyconfig_pref_type_init(void)
Definition keyconfig.cc:94
void BKE_keyconfig_pref_type_free(void)
Definition keyconfig.cc:100
void BKE_library_callback_remap_editor_id_reference_set(BKE_library_remap_editor_id_reference_cb func)
Definition lib_remap.cc:53
void BKE_library_callback_free_notifier_reference_set(BKE_library_free_notifier_reference_cb func)
Definition lib_remap.cc:46
const char * BKE_main_blendfile_path_from_global()
Definition main.cc:877
void BKE_mask_clipboard_free(void)
General operations, lookup, etc. for materials.
void BKE_materials_exit()
void BKE_mball_cubeTable_free()
void BKE_preview_images_init()
Depsgraph * BKE_scene_get_depsgraph(const Scene *scene, const ViewLayer *view_layer)
Definition scene.cc:3414
void BKE_region_callback_free_gizmomap_set(void(*callback)(wmGizmoMap *))
Definition screen.cc:509
void BKE_spacedata_callback_id_remap_set(void(*func)(ScrArea *area, SpaceLink *sl, ID *old_id, ID *new_id))
Definition screen.cc:459
void BKE_region_callback_refresh_tag_gizmomap_set(void(*callback)(wmGizmoMap *))
Definition screen.cc:476
void BKE_sound_jack_sync_callback_set(SoundJackSyncCallback callback)
void BKE_sound_jack_scene_update(struct Scene *scene, int mode, double time)
void BKE_sound_exit_once()
void BKE_studiolight_init(void)
void BKE_tracking_clipboard_free(void)
Definition tracking.cc:443
void BKE_vfont_clipboard_free()
Definition vfont.cc:467
void BLF_exit()
Definition blf.cc:70
int BLF_init()
Definition blf.cc:61
#define BLI_assert(a)
Definition BLI_assert.h:46
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
Definition listbase.cc:497
#define FILE_MAX
#define BLI_path_join(...)
char * STRNCPY(char(&dst)[N], const char *src)
Definition BLI_string.h:688
void BLI_task_scheduler_exit(void)
void BLI_threadapi_exit(void)
Definition threads.cc:119
void BLI_timer_free(void)
Definition BLI_timer.cc:126
#define UNUSED_VARS(...)
#define UNLIKELY(x)
external writefile.cc function prototypes.
bool BLO_write_file(Main *mainvar, const char *filepath, int write_flags, const BlendFileWriteParams *params, ReportList *reports)
void BLT_lang_set(const char *)
Definition blt_lang.cc:250
void BLT_lang_init()
Definition blt_lang.cc:192
void BLT_lang_free()
Definition blt_lang.cc:226
void BPY_python_end(bool do_python_exit)
void BPY_python_reset(bContext *C)
void BPY_python_start(bContext *C, int argc, const char **argv)
bool BPY_run_string_eval(bContext *C, const char *imports[], const char *expr)
void CLG_exit(void)
Definition clog.c:704
#define CLG_LOGREF_DECLARE_GLOBAL(var, id)
Definition CLG_log.h:145
void COM_deinitialize()
Deinitialize the compositor caches and allocated memory. Use COM_clear_caches to only free the caches...
void DEG_editors_set_update_cb(DEG_EditorUpdateIDCb id_func, DEG_EditorUpdateSceneCb scene_func)
Scene * DEG_get_evaluated_scene(const Depsgraph *graph)
blenloader genfile private function prototypes
void DNA_sdna_current_free(void)
@ AUDIO_SYNC
@ USER_SPLASH_DISABLE
@ USER_PREF_FLAG_SAVE
void DRW_gpu_context_destroy()
void DRW_gpu_context_disable_ex(bool restore)
void DRW_gpu_context_create()
void DRW_gpu_context_enable_ex(bool restore)
void ED_node_clipboard_free()
Definition clipboard.cc:549
void ED_node_init_butfuncs()
Definition drawnode.cc:930
void ED_render_clear_mtex_copybuf()
void ED_preview_free_dbase()
void ED_render_id_flush_update(const DEGEditorUpdateContext *update_ctx, ID *id)
void ED_preview_restart_queue_free()
void ED_render_scene_update(const DEGEditorUpdateContext *update_ctx, bool updated)
void ED_screen_exit(bContext *C, wmWindow *window, bScreen *screen)
void ED_spacetypes_init()
Definition spacetypes.cc:61
void ED_spacemacros_init()
void ED_file_init()
void ED_file_exit()
void ED_undosys_type_free()
void ED_undosys_type_init()
void ED_editors_exit(Main *bmain, bool do_undo_system)
Definition ed_util.cc:212
void ED_spacedata_id_remap_single(ScrArea *area, SpaceLink *sl, ID *old_id, ID *new_id)
Definition ed_util.cc:460
bool ED_editors_flush_edits(Main *bmain)
Definition ed_util.cc:324
GHOST C-API function and type declarations.
bool GHOST_setConsoleWindowState(GHOST_TConsoleWindowState action)
@ GHOST_kConsoleWindowStateShow
@ GHOST_kConsoleWindowStateHideForNonConsoleLaunch
void GPU_render_end()
bool GPU_backend_supported()
void GPU_context_begin_frame(GPUContext *ctx)
void GPU_render_begin()
GPUContext * GPU_context_active_get()
void GPU_context_end_frame(GPUContext *ctx)
void GPU_init()
void GPU_exit()
void GPU_shader_cache_dir_clear_old()
void GPU_shader_compile_static()
Read Guarded memory(de)allocation.
#define C
Definition RandGen.cpp:29
void UI_init()
void UI_interface_tag_script_reload()
void UI_exit()
@ BIFICONID_LAST_STATIC
eWM_EventHandlerFlag
Definition WM_api.hh:541
CLG_LogRef * WM_LOG_MSGBUS_PUB
CLG_LogRef * WM_LOG_OPERATORS
CLG_LogRef * WM_LOG_HANDLERS
CLG_LogRef * WM_LOG_EVENTS
CLG_LogRef * WM_LOG_TOOLS
@ WM_OP_INVOKE_DEFAULT
Definition WM_types.hh:238
CLG_LogRef * WM_LOG_MSGBUS_SUB
CLG_LogRef * WM_LOG_KEYMAPS
#define WM_UI_HANDLER_BREAK
Definition WM_types.hh:346
#define U
BPy_StructRNA * depsgraph
void ANIM_drivers_copybuf_free()
Definition drivers.cc:563
void ANIM_driver_vars_copybuf_free()
Definition drivers.cc:684
void ED_gpencil_anim_copybuf_free()
void ANIM_fmodifiers_copybuf_free()
void ED_gpencil_strokes_copybuf_free()
#define printf(...)
void RE_engines_exit()
void ANIM_fcurves_copybuf_free()
void MEM_freeN(void *vmemh)
Definition mallocn.cc:113
#define G(x, y, z)
void RNA_exit()
void * first
ListBase wm
Definition BKE_main.hh:276
struct AudioData audio
const char * app_template_override
Definition wm_files.hh:58
const char * filepath_startup_override
Definition wm_files.hh:53
unsigned int use_factory_settings
Definition wm_files.hh:37
unsigned int is_first_time
Definition wm_files.hh:49
unsigned int use_empty_data
Definition wm_files.hh:44
unsigned int use_data
Definition wm_files.hh:29
unsigned int use_userdef
Definition wm_files.hh:31
void WM_keyconfig_init(bContext *C)
Definition wm.cc:432
void wm_init_cursor_data()
void wm_dropbox_free()
wmEventHandler_UI * WM_event_add_ui_handler(const bContext *C, ListBase *handlers, wmUIHandlerFunc handle_fn, wmUIHandlerRemoveFunc remove_fn, void *user_data, const eWM_EventHandlerFlag flag)
void WM_main_remap_editor_id_reference(const blender::bke::id::IDRemapper &mappings)
wmOperatorStatus WM_operator_name_call(bContext *C, const char *opstring, wmOperatorCallContext context, PointerRNA *properties, const wmEvent *event)
void WM_main_remove_notifier_reference(const void *reference)
void WM_event_remove_handlers(bContext *C, ListBase *handlers)
void WM_event_add_mousemove(wmWindow *win)
void wm_test_autorun_revert_action_set(wmOperatorType *ot, PointerRNA *ptr)
Definition wm_files.cc:4229
const char * WM_init_state_app_template_get()
Definition wm_files.cc:1199
void wm_history_file_read()
Definition wm_files.cc:1610
void wm_autosave_delete()
Definition wm_files.cc:2413
void wm_homefile_read_ex(bContext *C, const wmHomeFileRead_Params *params_homefile, ReportList *reports, wmFileReadPost_Params **r_params_file_read_post)
Definition wm_files.cc:1210
void wm_homefile_read_post(bContext *C, const wmFileReadPost_Params *params_file_read_post)
Definition wm_files.cc:1590
void wm_gizmogrouptype_init()
void wm_gizmogrouptype_free()
void wm_gizmomaptypes_free()
void WM_gizmomap_tag_refresh(wmGizmoMap *gzmap)
void wm_gizmomap_remove(wmGizmoMap *gzmap)
void WM_gizmoconfig_update_tag_reinit_all()
void wm_gizmotype_init()
void wm_gizmotype_free()
static void free_openrecent()
void WM_script_tag_reload()
static bool gpu_is_init
void WM_init_splash(bContext *C)
void UV_clipboard_free()
void WM_init_splash_on_startup(bContext *C)
static int wm_exit_handler(bContext *C, const wmEvent *event, void *userdata)
void WM_exit(bContext *C, const int exit_code)
static bool wm_init_splash_show_on_startup_check()
void WM_exit_ex(bContext *C, const bool do_python_exit, const bool do_user_exit_actions)
void WM_init(bContext *C, int argc, const char **argv)
static bool wm_start_with_console
void wm_exit_schedule_delayed(const bContext *C)
void WM_init_state_start_with_console_set(bool value)
void WM_init_gpu()
static void sound_jack_sync_callback(Main *bmain, int mode, double time)
static void wm_init_scripts_extensions_once(bContext *C)
void WM_jobs_kill_all(wmWindowManager *wm)
Definition wm_jobs.cc:577
void WM_keyconfig_update_on_startup(wmWindowManager *wm)
void WM_keyconfig_update_postpone_end()
void WM_keyconfig_update_postpone_begin()
void WM_menutype_free()
void WM_menutype_init()
void WM_msgbus_types_init()
void wm_operatortype_free()
void wm_operatortypes_register()
void WM_paneltype_init()
void WM_paneltype_clear()
bool WM_platform_support_perform_checks()
void wm_surfaces_free()
void WM_uilisttype_free()
void WM_uilisttype_init()
void wm_ghost_exit()
void wm_ghost_init_background()
void wm_clipboard_free()
ViewLayer * WM_window_get_active_view_layer(const wmWindow *win)
Scene * WM_window_get_active_scene(const wmWindow *win)
void wm_ghost_init(bContext *C)
bScreen * WM_window_get_active_screen(const wmWindow *win)