Blender V5.3
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_fileops.hh"
25#include "BLI_listbase.hh"
26#include "BLI_memory_cache.hh"
27#include "BLI_path_utils.hh"
28#include "BLI_string.hh"
29#include "BLI_task_c.hh"
30#include "BLI_threads.hh"
31#include "BLI_timer.hh"
32#include "BLI_utildefines.hh"
33
34#include "BLO_undofile.hh"
35#include "BLO_writefile.hh"
36
37#include "BKE_blender.hh"
39#include "BKE_blendfile.hh"
40#include "BKE_callbacks.hh"
41#include "BKE_context.hh"
42#include "BKE_global.hh"
43#include "BKE_icons.hh"
44#include "BKE_image.hh"
45#include "BKE_image_gpu.hh"
46#include "BKE_keyconfig.h"
47#include "BKE_lib_remap.hh"
48#include "BKE_main.hh"
50#include "BKE_preferences.h"
51#include "BKE_preview_image.hh"
52#include "BKE_recents.hh"
53#include "BKE_report.hh"
54#include "BKE_scene.hh"
55#include "BKE_screen.hh"
56#include "BKE_sound.hh"
57#include "BKE_vfont.hh"
58
59#include "BKE_addon.h"
60#include "BKE_appdir.hh"
62#include "BKE_mask.hh" /* Free mask clipboard. */
63#include "BKE_material.hh" /* #BKE_material_copybuf_clear. */
64#include "BKE_studiolight.h"
65#include "BKE_subdiv.hh"
66#include "BKE_tracking.hh" /* Free tracking clipboard. */
67
68#include "RE_engine.h"
69#include "RE_pipeline.h" /* `RE_` free stuff. */
70
71#ifdef WITH_PYTHON
72# include "BPY_extern_python.hh"
73# include "BPY_extern_run.hh"
74#endif
75
76#include "GHOST_ISystem.hh"
77
78#include "RNA_define.hh"
79
80#include "WM_api.hh"
81#include "WM_keymap.hh"
82#include "WM_message.hh"
83#include "WM_types.hh"
84
85#include "wm.hh"
86#include "wm_cursors.hh"
87#include "wm_event_system.hh"
88#include "wm_files.hh"
90#include "wm_surface.hh"
91#include "wm_window.hh"
92
93#include "ED_anim_api.hh"
94#include "ED_asset.hh"
95#include "ED_gpencil_legacy.hh"
96#include "ED_grease_pencil.hh"
97#include "ED_image.hh"
98#include "ED_keyframes_edit.hh"
99#include "ED_keyframing.hh"
100#include "ED_node.hh"
101#include "ED_render.hh"
102#include "ED_screen.hh"
103#include "ED_space_api.hh"
104#include "ED_undo.hh"
105#include "ED_util.hh"
106
107#include "BLF_api.hh"
108#include "BLT_lang.hh"
109
110#include "UI_interface.hh"
111#include "UI_resources.hh"
112#include "UI_string_search.hh"
113
114#include "GPU_context.hh"
115#include "GPU_init_exit.hh"
116#include "GPU_shader.hh"
117
118#include "DEG_depsgraph.hh"
119#include "DEG_depsgraph_query.hh"
120
121#include "ANIM_keyingsets.hh"
122
123#include "DRW_engine.hh"
124
125namespace blender {
126
132
133static CLG_LogRef LOG_BLEND = {"blend"};
134
135static void wm_init_scripts_extensions_once(bContext *C);
136
137static bool wm_start_with_console = false;
138
140{
141 wm_start_with_console = value;
142}
143
151static bool gpu_is_init = false;
152
157
159{
160 /* Must be called only once. */
161 BLI_assert(gpu_is_init == false);
162
163 if (G.background) {
164 /* Init on demand for background mode, already done for foreground mode. */
166
167 /* Ghost is still not initialized elsewhere in background mode. */
169 }
170
171 if (!GPU_backend_supported()) {
172 return;
173 }
174
175 /* Needs to be first to have an OpenGL context bound. */
177
178 GPU_init();
179
180 if (G.debug & G_DEBUG_GPU_COMPILE_SHADERS) {
182 }
183
184 /* Some part of the code assumes no context is left bound. */
186
187 gpu_is_init = true;
188}
189
190static void sound_jack_sync_callback(Main *bmain, int mode, double time)
191{
192 /* Ugly: Blender doesn't like it when the animation is played back during rendering. */
193 if (G.is_rendering) {
194 return;
195 }
196
197 wmWindowManager *wm = bmain->wm.first();
198
199 for (wmWindow &window : wm->windows) {
200 Scene *scene = WM_window_get_active_scene(&window);
201 if ((scene->audio.flag & AUDIO_SYNC) == 0) {
202 continue;
203 }
204 ViewLayer *view_layer = WM_window_get_active_view_layer(&window);
205 Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, view_layer);
206 if (depsgraph == nullptr) {
207 continue;
208 }
209 Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
210 BKE_sound_jack_scene_update(scene_eval, mode, time);
211 }
212}
213
214void WM_init(bContext *C, int argc, const char **argv)
215{
216
217 if (!G.background) {
218 wm_ghost_init(C); /* NOTE: it assigns C to ghost! */
221 }
222
225
227
228 WM_paneltype_init(); /* Lookup table only. */
233
235
242
244
246
247 BLF_init();
248
249 if (!G.background) {
251 }
252
254 /* Must call first before doing any `.blend` file reading,
255 * since versioning code may create new IDs. See #57066. */
256 BLT_lang_set(nullptr);
257
258 /* Init icons & previews before reading .blend files for preview icons, which can
259 * get triggered by the depsgraph. This is also done in background mode
260 * for scripts that do background processing with preview icons. */
263
265
266 /* Studio-lights needs to be init before we read the home-file,
267 * otherwise the versioning cannot find the default studio-light. */
269
270 BLI_assert((G.fileflags & G_FILE_NO_UI) == 0);
271
290 wmFileReadPost_Params *params_file_read_post = nullptr;
291 wmHomeFileRead_Params read_homefile_params{};
292 read_homefile_params.use_data = true;
293 read_homefile_params.use_userdef = true;
294 read_homefile_params.use_factory_settings = G.factory_startup;
295 read_homefile_params.use_empty_data = false;
296 read_homefile_params.filepath_startup_override = nullptr;
298 read_homefile_params.is_first_time = true;
299
300 wm_homefile_read_ex(C, &read_homefile_params, nullptr, &params_file_read_post);
301
302 /* NOTE: leave `G_MAIN->filepath` set to an empty string since this
303 * matches behavior after loading a new file. */
304 BLI_assert(G_MAIN->filepath[0] == '\0');
305
306 /* Call again to set from preferences. */
307 BLT_lang_set(nullptr);
308
309 /* For file-system. Called here so can include user preference paths if needed. */
310 ED_file_init();
311
312 if (!G.background) {
314 if (wm != nullptr) {
316 }
317 if (wm == nullptr || wm->windows.is_empty()) {
318 if (params_file_read_post != nullptr) {
319 MEM_delete_void(static_cast<void *>(params_file_read_post));
320 params_file_read_post = nullptr;
321 }
322 WM_exit(C, EXIT_FAILURE);
323 }
324
326
327#ifdef WITH_INPUT_NDOF
328 /* Sets 3D mouse dead-zone. */
329 WM_ndof_deadzone_set(U.ndof_deadzone);
330#endif
332
334 WM_exit(C, -1);
335 }
336
338 ui::init();
341 }
342
344
346
347#ifdef WITH_PYTHON
348 BPY_python_start(C, argc, argv);
350#else
351 UNUSED_VARS(argc, argv);
352#endif
353
354 if (!G.background) {
355 GHOST_ISystem *ghost_system = GHOST_ISystem::getSystem();
358 }
359 else {
361 }
362 }
363
365
367
368 if (!G.background) {
370 }
371
372 STRNCPY(G.filepath_last_library, BKE_main_blendfile_path_from_global());
373
374 CTX_py_init_set(C, true);
375
376 /* Postpone updating the key-configuration until after add-ons have been registered,
377 * needed to properly load user-configured add-on key-maps, see: #113603. */
379
381
382 /* Load add-ons after key-maps have been initialized (but before the blend file has been read),
383 * important to guarantee default key-maps have been declared & before post-read handlers run. */
385
388
389 wm_homefile_read_post(C, params_file_read_post);
390}
391
393{
394 if (U.uiflag & USER_SPLASH_DISABLE) {
395 return false;
396 }
397
398 bool use_splash = false;
399
400 const char *blendfile_path = BKE_main_blendfile_path_from_global();
401 if (blendfile_path[0] == '\0') {
402 /* Common case, no file is loaded, show the splash. */
403 use_splash = true;
404 }
405 else {
406 /* A less common case, if there is no user preferences, show the splash screen
407 * so the user has the opportunity to restore settings from a previous version. */
408 use_splash = !bke::preferences::exists();
409 }
410
411 return use_splash;
412}
413
415{
417 return;
418 }
419
421}
422
424{
425 if (G.background || !(U.pref_flag & USER_PREF_FLAG_PROJECT_REMEMBER)) {
426 return false;
427 }
428
429 const std::string root_path = recents::Section("project").get<std::string>("last");
430 if (root_path.empty() || !BLI_is_dir(root_path.c_str())) {
431 return false;
432 }
433
434 return BKE_blender_project_init_from_root_path(bmain, root_path);
435}
436
438{
440
441 const std::string root_path = BKE_blender_project_read_callback(
442 bmain, [](const bke::BlenderProject *project) {
443 return project ? std::string(project->get_root_path()) : std::string();
444 });
445 recents::Section("project").set("last", root_path);
446}
447
449{
451 /* NOTE(@ideasman42): this should practically never happen. */
452 if (wm->windows.is_empty()) [[unlikely]] {
453 return;
454 }
455
456 wmWindow *prevwin = CTX_wm_window(C);
457 CTX_wm_window_set(C, wm->windows.first());
458 WM_operator_name_call(C, "WM_OT_splash", wm::OpCallContext::InvokeDefault, nullptr, nullptr);
459 CTX_wm_window_set(C, prevwin);
460}
461
464{
465#ifdef WITH_PYTHON
466 const char *imports[] = {"bpy", nullptr};
467 BPY_run_string_eval(C, imports, "bpy.utils.load_scripts_extensions()");
468#else
469 UNUSED_VARS(C);
470#endif
471}
472
473/* Free strings of open recent files. */
474static void free_openrecent()
475{
476 for (RecentFile &recent : G.recent_files) {
477 MEM_delete(recent.filepath);
478 }
479
480 BLI_freelistN(&(G.recent_files));
481}
482
483static int wm_exit_handler(bContext *C, const wmEvent *event, void *userdata)
484{
485 WM_exit(C, EXIT_SUCCESS);
486
487 UNUSED_VARS(event, userdata);
488 return WM_UI_HANDLER_BREAK;
489}
490
492{
493 /* Use modal UI handler for now.
494 * Could add separate WM handlers or so, but probably not worth it. */
496 C, &win.runtime->modalhandlers, wm_exit_handler, nullptr, nullptr, eWM_EventHandlerFlag(0));
497 WM_event_add_mousemove(&win); /* Ensure handler actually gets called. */
498}
499
501{
502 /* What we do here is a little bit hacky, but quite simple and doesn't require bigger
503 * changes: Add a handler wrapping WM_exit() to cause a delayed call of it. */
504
505 if (wmWindow *win = CTX_wm_window(C)) {
507 }
508 else {
509 /* Unlikely but possible, in this case just ensure exit runs as it's not interactive. */
510 wmWindowManager *wm = G_MAIN->wm.first();
511 for (wmWindow &win : wm->windows) {
513 }
514 }
515}
516
517void UV_clipboard_free();
518
519void WM_exit_ex(bContext *C, const bool do_python_exit, const bool do_user_exit_actions)
520{
521 wmWindowManager *wm = C ? CTX_wm_manager(C) : nullptr;
522
523 /* While nothing technically prevents saving user data in background mode,
524 * don't do this as not typically useful and more likely to cause problems
525 * if automated scripts happen to write changes to the preferences for example.
526 * Saving #BLENDER_QUIT_FILE is also not likely to be desired either. */
527 BLI_assert(G.background ? (do_user_exit_actions == false) : true);
528
529 if (C) {
530 /* Run `exit_pre` Python handlers. */
532 }
533
534 /* First wrap up running stuff, we assume only the active WM is running. */
535 /* Modal handlers are on window level freed, others too? */
536 /* NOTE: same code copied in `wm_files.cc`. */
537 if (C && wm) {
538 if (do_user_exit_actions) {
540
541 /* Save quit.blend. */
542 Main *bmain = CTX_data_main(C);
543 char filepath[FILE_MAX];
544 const int fileflags = G.fileflags | G_FILE_COMPRESS | G_FILE_RECOVER_WRITE;
545
546 BLI_path_join(filepath, sizeof(filepath), BKE_tempdir_base(), BLENDER_QUIT_FILE);
547
550
551 BlendFileWriteParams blend_file_write_params{};
552 if (BLO_write_file(bmain, filepath, fileflags, &blend_file_write_params, nullptr)) {
553 CLOG_INFO_NOCHECK(&LOG_BLEND, "Saved session recovery to \"%s\"", filepath);
554 }
555 }
556
558
559 for (wmWindow &win : wm->windows) {
560 CTX_wm_window_set(C, &win); /* Needed by operator close callbacks. */
564 }
565
566 if (!G.background) {
568 }
569
570 if (do_user_exit_actions) {
571 if ((U.pref_flag & USER_PREF_FLAG_SAVE) && ((G.f & G_FLAG_USERPREF_NO_SAVE_ON_EXIT) == 0)) {
572 if (U.runtime.is_dirty) {
574 }
575 }
576 /* Free the callback data used on file-open
577 * (will be set when a recover operation has run). */
578 wm_test_autorun_revert_action_set(nullptr, nullptr);
579 }
580 }
581
582#if defined(WITH_PYTHON) && !defined(WITH_PYTHON_MODULE)
583 /* Without this, we there isn't a good way to manage false-positive resource leaks
584 * where a #PyObject references memory allocated with guarded-alloc, #71362.
585 *
586 * This allows add-ons to free resources when unregistered (which is good practice anyway).
587 *
588 * Don't run this code when built as a Python module as this runs when Python is in the
589 * process of shutting down, where running a snippet like this will crash, see #82675.
590 * Instead use the `atexit` module, installed by #BPY_python_start.
591 *
592 * Don't run this code when `C` is null because #pyrna_unregister_class
593 * passes in `CTX_data_main(C)` to un-registration functions.
594 * Further: `addon_utils.disable_all()` may call into functions that expect a valid context,
595 * supporting all these code-paths with a null context is quite involved for such a corner-case.
596 *
597 * Check `CTX_py_init_get(C)` in case this function runs before Python has been initialized.
598 * Which can happen when the GPU backend fails to initialize.
599 */
600 if (C && CTX_py_init_get(C)) {
601 /* Calls `addon_utils.disable_all()` as well as unregistering all "startup" modules. */
602 const char *imports[] = {"bpy", "bpy.utils", nullptr};
603 BPY_run_string_eval(C, imports, "bpy.utils._on_exit()");
604 }
605#endif
606
607 /* Perform this early in case commands reference other data freed later in this function.
608 * This most run:
609 * - After add-ons are disabled because they may unregister commands.
610 * - Before Python exits so Python objects can be de-referenced.
611 * - Before #BKE_blender_atexit runs they free the `argv` on WIN32.
612 */
614
616
618
622
627
628 /* All non-screen and non-space stuff editors did, like edit-mode. */
629 if (C) {
630 Main *bmain = CTX_data_main(C);
631 ED_editors_exit(bmain, true);
632 }
633
635
637
638 /* Clear the cache which may (indirectly) contain e.g. GPU resources which need to be freed
639 * before the GPU backend is destroyed. */
641
642 /* Render code might still access databases. */
645
646 ED_preview_free_dbase(); /* Frees a Main dbase, before #BKE_blender_free! */
648
655
657
658 /* Frees the entire library (#G_MAIN) and space-types. */
660
661 /* Important this runs after #BKE_blender_free because the window manager may be allocated
662 * when `C` is null, holding references to undo steps which will fail to free if their types
663 * have been freed first. */
665
666 /* Free the GPU subdivision data after the database to ensure that subdivision structs used by
667 * the modifiers were garbage collected. */
668 if (gpu_is_init) {
670 }
671
677
678 /* Free gizmo-maps after freeing blender,
679 * so no deleted data get accessed during cleaning up of areas. */
683 /* Same for UI-list types. */
685
686 BLF_exit();
687
688 if (!G.background && do_user_exit_actions) {
690 }
691
693
695
696 // free_txt_data();
697
698#ifdef WITH_PYTHON
699 /* Option not to exit Python so this function can be called from 'atexit'. */
700 if ((C == nullptr) || CTX_py_init_get(C)) {
701 /* NOTE: (old note)
702 * before BKE_blender_free so Python's garbage-collection happens while library still exists.
703 * Needed at least for a rare crash that can happen in python-drivers.
704 *
705 * Update for Blender 2.5, move after #BKE_blender_free because Blender now holds references
706 * to #PyObject's so #Py_DECREF'ing them after Python ends causes bad problems every time
707 * the python-driver bug can be fixed if it happens again we can deal with it then. */
708 BPY_python_end(do_python_exit);
709 }
710#else
711 (void)do_python_exit;
712#endif
713
714 ED_file_exit(); /* For file-selector menu data. */
715
716 /* Delete GPU resources and context. The UI also uses GPU resources and so
717 * is also deleted with the context active. */
718 if (gpu_is_init) {
720 ui::exit();
723 GPU_exit();
726 }
727 else {
728 ui::exit();
729 }
730
732
733 RNA_exit(); /* Should be after #BPY_python_end so struct python slots are cleared. */
734
736
737 if (C) {
738 CTX_free(C);
739 }
740
743
744 /* No need to call this early, rather do it late so that other
745 * pieces of Blender using sound may exit cleanly, see also #50676. */
747
749
751
753
755
756 /* Logging cannot be called after exiting (#CLOG_INFO, #CLOG_WARN etc will crash).
757 * So postpone exiting until other sub-systems that may use logging have shut down. */
758 CLG_exit();
759}
760
761void WM_exit(bContext *C, const int exit_code)
762{
763 const bool do_user_exit_actions = G.background ? false : (exit_code == EXIT_SUCCESS);
764 WM_exit_ex(C, true, do_user_exit_actions);
765
766 if (!CLG_quiet_get()) {
767 printf("\nBlender quit\n");
768 }
769
770 exit(exit_code);
771}
772
774{
776
777 /* Any operators referenced by gizmos may now be a dangling pointer.
778 *
779 * While it is possible to inspect the gizmos it's simpler to re-create them,
780 * especially for script reloading - where we can accept slower logic
781 * for the sake of simplicity, see #126852. */
783}
784
785} // namespace blender
Functionality to interact with keying sets.
#define BLENDER_QUIT_FILE
Blender util stuff.
Blender CLI Generic --command Support.
#define G_MAIN
General operations, lookup, etc. for materials.
File and directory operations.
#define FILE_MAX
#define BLI_path_join(...)
external writefile.cc function prototypes.
bool CLG_quiet_get()
Definition clog.cc:942
void CLG_exit()
Definition clog.cc:877
#define CLOG_INFO_NOCHECK(clg_ref, format,...)
Definition CLG_log.h:204
blenloader genfile private function prototypes
@ GHOST_kConsoleWindowStateShow
@ GHOST_kConsoleWindowStateHideForNonConsoleLaunch
Read Blender memory allocation and freeing.
#define C
Definition RandGen.cpp:29
#define WM_UI_HANDLER_BREAK
Definition WM_types.hh:362
#define UNUSED_VARS(...)
static GHOST_ISystem * getSystem()
virtual bool setConsoleWindowState(GHOST_TConsoleWindowState action)=0
T get(const std::string &item_key) const
Definition recents.cc:224
void set(const std::string &item_key, const T &value)
Definition recents.cc:285
void init_async()
Definition recents.cc:124
void interface_tag_script_reload()
BMesh Iterators.
void ANIM_driver_vars_copybuf_free()
Definition drivers.cc:661
void BKE_blender_free()
Definition blender.cc:64
UserDef U
Definition blender.cc:58
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void wm_operatortypes_register()
CLG_LogRef * WM_LOG_MSGBUS_SUB
void BKE_tempdir_session_purge()
Definition appdir.cc:1293
void GPU_exit()
void ANIM_fcurves_copybuf_free()
char * STRNCPY(char(&dst)[N], const char *src)
void BKE_preview_images_init()
void WM_main_remove_notifier_reference(const void *reference)
void ED_render_scene_update(const DEGEditorUpdateContext *update_ctx, bool updated)
void wm_init_cursor_data()
bool ED_editors_flush_edits(Main *bmain)
Definition ed_util.cc:335
void wm_history_file_read()
Definition wm_files.cc:1638
void BKE_studiolight_init()
void BKE_blender_cli_command_free_all()
bool CTX_py_init_get(const bContext *C)
void WM_keyconfig_update_postpone_begin()
void BLI_threadapi_exit()
Definition threads.cc:121
const char * WM_init_state_app_template_get()
Definition wm_files.cc:1222
static void wm_exit_project_data_store(Main *bmain)
void BKE_blender_project_config_autosave(Main *bmain)
@ BKE_CB_EVT_EXIT_PRE
void BKE_sound_jack_scene_update(Scene *scene, int mode, double time)
void BLT_lang_set(const char *)
Definition blt_lang.cc:253
Depsgraph * BKE_scene_get_depsgraph(const Scene *scene, const ViewLayer *view_layer)
Definition scene.cc:3631
void wm_gizmotype_free()
void ED_spacetypes_init()
Definition spacetypes.cc:63
bool BLO_write_file(Main *mainvar, const char *filepath, int write_flags, const BlendFileWriteParams *params, ReportList *reports)
wmEventHandler_UI * WM_event_add_ui_handler(const bContext *C, ListBaseT< wmEventHandler > *handlers, wmUIHandlerFunc handle_fn, wmUIHandlerRemoveFunc remove_fn, void *user_data, const eWM_EventHandlerFlag flag)
void ED_spacemacros_init()
void BKE_callback_exec_boolean(Main *bmain, bool value, eCbEvent evt)
Definition callbacks.cc:65
void BKE_blender_userdef_data_free(UserDef *userdef, bool clear_fonts)
Definition blender.cc:349
void wm_ghost_exit()
void GPU_shader_compile_static()
void BLI_timer_free()
Definition BLI_timer.cc:126
bool wm_init_last_project_on_startup(Main *bmain)
void WM_exit_ex(bContext *C, const bool do_python_exit, const bool do_user_exit_actions)
void wm_window_ghostwindows_remove_invalid(bContext *C, wmWindowManager *wm)
void WM_exit(bContext *C, const int exit_code)
void CTX_wm_window_set(bContext *C, wmWindow *win)
void BKE_image_free_gpu_fallback()
Definition image_gpu.cc:439
void ED_spacedata_id_remap_single(ScrArea *area, SpaceLink *sl, ID *old_id, ID *new_id)
Definition ed_util.cc:460
void wm_ghost_init(bContext *C)
void GPU_context_end_frame(GPUContext *ctx)
void WM_paneltype_clear()
bool GPU_backend_supported()
void ED_undosys_type_free()
void WM_msgbus_types_init()
bool GPU_backend_type_selection_detect()
void BLI_task_scheduler_exit()
CLG_LogRef * WM_LOG_EVENTS
void DRW_gpu_context_disable_ex(bool restore)
bool WM_platform_support_perform_checks()
void WM_init(bContext *C, int argc, const char **argv)
wmWindow * CTX_wm_window(const bContext *C)
void WM_init_splash_on_startup(bContext *C)
void CTX_py_init_set(bContext *C, bool value)
void wm_clipboard_free()
const char * BKE_main_blendfile_path_from_global()
Definition main.cc:1063
void BKE_addon_pref_type_init()
Definition addon.cc:119
void GPU_render_begin()
auto BKE_blender_project_read_callback(const Main *bmain, Fn lambda)
void BKE_addon_pref_type_free()
Definition addon.cc:125
void RE_engines_exit()
void WM_gizmomap_tag_refresh(wmGizmoMap *gzmap)
ViewLayer * WM_window_get_active_view_layer(const wmWindow *win)
void WM_keyconfig_init(bContext *C)
Definition wm.cc:454
void BPY_python_start(bContext *C, int argc, const char **argv)
void ED_file_exit()
void wm_dropbox_free()
void MEM_delete_void(void *vmemh)
void DRW_gpu_context_enable_ex(bool restore)
void GPU_context_begin_frame(GPUContext *ctx)
void ED_screen_exit(bContext *C, wmWindow *window, bScreen *screen)
void WM_init_splash(bContext *C)
@ G_DEBUG_GPU_COMPILE_SHADERS
Global G
Definition blender.cc:57
void WM_init_gpu_offscreen()
void ED_node_init_butfuncs()
Definition drawnode.cc:978
void wm_gizmogrouptype_init()
@ G_FILE_RECOVER_WRITE
@ G_FILE_COMPRESS
void GPU_init()
void WM_event_remove_handlers(bContext *C, ListBaseT< wmEventHandler > *handlers)
Scene * WM_window_get_active_scene(const wmWindow *win)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
Definition listbase.cc:504
void ED_file_init()
@ USER_PREF_FLAG_PROJECT_REMEMBER
void GPU_render_end()
void WM_main_remap_editor_id_reference(const bke::id::IDRemapper &mappings)
eWM_EventHandlerFlag
Definition WM_api.hh:707
void BKE_mball_cubeTable_free()
static bool gpu_is_init
CLG_LogRef * WM_LOG_TOOL_GIZMO
void RNA_exit()
void BKE_tracking_clipboard_free()
Definition tracking.cc:445
void WM_init_state_start_with_console_set(bool value)
void wm_homefile_read_post(bContext *C, const wmFileReadPost_Params *params_file_read_post)
Definition wm_files.cc:1618
void WM_uilisttype_free()
wmWindowManager * CTX_wm_manager(const bContext *C)
static void sound_jack_sync_callback(Main *bmain, int mode, double time)
static int wm_exit_handler(bContext *C, const wmEvent *event, void *userdata)
void ED_image_internal_autosave_flush(const Main *bmain)
void BKE_keyconfig_pref_type_init()
Definition keyconfig.cc:96
void wm_test_autorun_revert_action_set(wmOperatorType *ot, PointerRNA *ptr)
Definition wm_files.cc:4692
void ED_editors_exit(Main *bmain, bool do_undo_system)
Definition ed_util.cc:230
void CTX_free(bContext *C)
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:1233
void WM_keyconfig_update_on_startup(wmWindowManager *wm)
void BPY_python_reset(bContext *C)
bool BPY_run_string_eval(bContext *C, const char *imports[], const char *expr)
void BLT_lang_init()
Definition blt_lang.cc:195
void GPU_shader_cache_dir_clear_old()
void BLT_lang_free()
Definition blt_lang.cc:229
void BKE_blender_atexit()
Definition blender.cc:509
wmOperatorStatus WM_operator_name_call(bContext *C, const char *opstring, wm::OpCallContext context, PointerRNA *properties, const wmEvent *event)
void BKE_region_callback_refresh_tag_gizmomap_set(void(*callback)(wmGizmoMap *))
Definition screen.cc:618
const char * BKE_tempdir_base() ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
Definition appdir.cc:1288
CLG_LogRef * WM_LOG_OPERATORS
void ED_render_clear_mtex_copybuf()
void wm_gizmotype_init()
void ED_preview_free_dbase()
void wm_gizmomap_remove(wmGizmoMap *gzmap)
void wm_gizmomaptypes_free()
void wm_exit_schedule_delayed(const bContext *C)
void WM_menutype_free()
bool BLI_is_dir(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition storage.cc:457
static void free_openrecent()
static void wm_init_scripts_extensions_once(bContext *C)
void WM_uilisttype_init()
void WM_script_tag_reload()
void DRW_gpu_context_destroy()
void ED_render_id_flush_update(const DEGEditorUpdateContext *update_ctx, ID *id)
void WM_menutype_init()
int BLF_init()
Definition blf.cc:63
void wm_autosave_delete()
Definition wm_files.cc:2503
static bool wm_start_with_console
@ G_FLAG_USERPREF_NO_SAVE_ON_EXIT
Main * CTX_data_main(const bContext *C)
void ANIM_fmodifiers_copybuf_free()
void BKE_region_callback_free_gizmomap_set(void(*callback)(wmGizmoMap *))
Definition screen.cc:651
void ANIM_drivers_copybuf_free()
Definition drivers.cc:552
void BKE_vfont_clipboard_free()
Definition vfont.cc:487
bool BKE_blendfile_userdef_write_all(ReportList *reports)
void ED_undosys_type_init()
void BPY_python_end(bool do_python_exit)
void BKE_icons_init(int first_dyn_id)
Definition icons.cc:175
void DEG_editors_set_update_cb(DEG_EditorUpdateIDCb id_func, DEG_EditorUpdateSceneCb scene_func)
void ED_gpencil_anim_copybuf_free()
void BKE_library_callback_remap_editor_id_reference_set(BKE_library_remap_editor_id_reference_cb func)
Definition lib_remap.cc:55
void BKE_spacedata_callback_id_remap_set(void(*func)(ScrArea *area, SpaceLink *sl, ID *old_id, ID *new_id))
Definition screen.cc:601
void WM_jobs_kill_all(wmWindowManager *wm)
Definition wm_jobs.cc:621
void WM_keyconfig_update_postpone_end()
void wm_operatortype_free()
static void wm_exit_schedule_delayed_for_window(const bContext *C, wmWindow &win)
void wm_surfaces_free()
void WM_event_add_mousemove(wmWindow *win)
static CLG_LogRef LOG_BLEND
void WM_gizmoconfig_update_tag_reinit_all()
Scene * DEG_get_evaluated_scene(const Depsgraph *graph)
CLG_LogRef * WM_LOG_MSGBUS_PUB
void UV_clipboard_free()
bScreen * WM_window_get_active_screen(const wmWindow *win)
void wm_gizmogrouptype_free()
void BKE_keyconfig_pref_type_free()
Definition keyconfig.cc:102
bool BKE_blender_project_init_from_root_path(Main *bmain, std::string project_root_path)
void BKE_appdir_exit()
Definition appdir.cc:103
CLG_LOGREF_DECLARE_GLOBAL(BKE_LOG_CONTEXT, "context")
void DRW_gpu_context_create()
void BKE_library_callback_free_notifier_reference_set(BKE_library_free_notifier_reference_cb func)
Definition lib_remap.cc:48
@ BIFICONID_LAST_STATIC
GPUContext * GPU_context_active_get()
void WM_init_gpu_backend()
void BKE_sound_jack_sync_callback_set(SoundJackSyncCallback callback)
void wm_ghost_init_background()
void WM_paneltype_init()
static bool wm_init_splash_show_on_startup_check()
void BLF_exit()
Definition blf.cc:72
ListBaseT< wmWindowManager > wm
Definition BKE_main.hh:415
struct AudioData audio
ListBaseT< wmEventHandler > handlers
ListBaseT< wmEventHandler > modalhandlers
unsigned int use_factory_settings
Definition wm_files.hh:39
const char * filepath_startup_override
Definition wm_files.hh:55
const char * app_template_override
Definition wm_files.hh:60
bke::WindowRuntime * runtime