Blender V5.0
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_memory_cache.hh"
26#include "BLI_path_utils.hh"
27#include "BLI_string.h"
28#include "BLI_task.h"
29#include "BLI_threads.h"
30#include "BLI_timer.h"
31#include "BLI_utildefines.h"
32
33#include "BLO_undofile.hh"
34#include "BLO_writefile.hh"
35
36#include "BKE_blender.hh"
37#include "BKE_blendfile.hh"
38#include "BKE_context.hh"
39#include "BKE_global.hh"
40#include "BKE_icons.h"
41#include "BKE_image.hh"
42#include "BKE_keyconfig.h"
43#include "BKE_lib_remap.hh"
44#include "BKE_main.hh"
46#include "BKE_preferences.h"
47#include "BKE_preview_image.hh"
48#include "BKE_scene.hh"
49#include "BKE_screen.hh"
50#include "BKE_sound.h"
51#include "BKE_vfont.hh"
52
53#include "BKE_addon.h"
54#include "BKE_appdir.hh"
56#include "BKE_mask.h" /* Free mask clipboard. */
57#include "BKE_material.hh" /* #BKE_material_copybuf_clear. */
58#include "BKE_studiolight.h"
59#include "BKE_subdiv.hh"
60#include "BKE_tracking.h" /* Free tracking clipboard. */
61
62#include "RE_engine.h"
63#include "RE_pipeline.h" /* `RE_` free stuff. */
64
65#ifdef WITH_PYTHON
66# include "BPY_extern_python.hh"
67# include "BPY_extern_run.hh"
68#endif
69
70#include "GHOST_C-api.h"
71
72#include "RNA_define.hh"
73
74#include "WM_api.hh"
75#include "WM_keymap.hh"
76#include "WM_message.hh"
77#include "WM_types.hh"
78
79#include "wm.hh"
80#include "wm_cursors.hh"
81#include "wm_event_system.hh"
82#include "wm_files.hh"
84#include "wm_surface.hh"
85#include "wm_window.hh"
86
87#include "ED_anim_api.hh"
88#include "ED_asset.hh"
89#include "ED_gpencil_legacy.hh"
90#include "ED_grease_pencil.hh"
91#include "ED_keyframes_edit.hh"
92#include "ED_keyframing.hh"
93#include "ED_node.hh"
94#include "ED_render.hh"
95#include "ED_screen.hh"
96#include "ED_space_api.hh"
97#include "ED_undo.hh"
98#include "ED_util.hh"
99
100#include "BLF_api.hh"
101#include "BLT_lang.hh"
102
103#include "UI_interface.hh"
104#include "UI_resources.hh"
105#include "UI_string_search.hh"
106
107#include "GPU_context.hh"
108#include "GPU_init_exit.hh"
109#include "GPU_shader.hh"
110
111#include "COM_compositor.hh"
112
113#include "DEG_depsgraph.hh"
114#include "DEG_depsgraph_query.hh"
115
116#include "ANIM_keyingsets.hh"
117
118#include "DRW_engine.hh"
119
125
126static CLG_LogRef LOG_BLEND = {"blend"};
127
129
130static bool wm_start_with_console = false;
131
133{
134 wm_start_with_console = value;
135}
136
144static bool gpu_is_init = false;
145
147{
148 /* Must be called only once. */
149 BLI_assert(gpu_is_init == false);
150
151 if (G.background) {
152 /* Ghost is still not initialized elsewhere in background mode. */
154 }
155
156 if (!GPU_backend_supported()) {
157 return;
158 }
159
160 /* Needs to be first to have an OpenGL context bound. */
162
163 GPU_init();
164
165 if (G.debug & G_DEBUG_GPU_COMPILE_SHADERS) {
167 }
168
169 /* Some part of the code assumes no context is left bound. */
171
172 gpu_is_init = true;
173}
174
175static void sound_jack_sync_callback(Main *bmain, int mode, double time)
176{
177 /* Ugly: Blender doesn't like it when the animation is played back during rendering. */
178 if (G.is_rendering) {
179 return;
180 }
181
182 wmWindowManager *wm = static_cast<wmWindowManager *>(bmain->wm.first);
183
184 LISTBASE_FOREACH (wmWindow *, window, &wm->windows) {
185 Scene *scene = WM_window_get_active_scene(window);
186 if ((scene->audio.flag & AUDIO_SYNC) == 0) {
187 continue;
188 }
189 ViewLayer *view_layer = WM_window_get_active_view_layer(window);
190 Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, view_layer);
191 if (depsgraph == nullptr) {
192 continue;
193 }
195 BKE_sound_jack_scene_update(scene_eval, mode, time);
196 }
197}
198
199void WM_init(bContext *C, int argc, const char **argv)
200{
201
202 if (!G.background) {
203 wm_ghost_init(C); /* NOTE: it assigns C to ghost! */
206 }
207
210
212
213 WM_paneltype_init(); /* Lookup table only. */
218
220
227
229
231
232 BLF_init();
233
235 /* Must call first before doing any `.blend` file reading,
236 * since versioning code may create new IDs. See #57066. */
237 BLT_lang_set(nullptr);
238
239 /* Init icons & previews before reading .blend files for preview icons, which can
240 * get triggered by the depsgraph. This is also done in background mode
241 * for scripts that do background processing with preview icons. */
244
246
247 /* Studio-lights needs to be init before we read the home-file,
248 * otherwise the versioning cannot find the default studio-light. */
250
251 BLI_assert((G.fileflags & G_FILE_NO_UI) == 0);
252
271 wmFileReadPost_Params *params_file_read_post = nullptr;
272 wmHomeFileRead_Params read_homefile_params{};
273 read_homefile_params.use_data = true;
274 read_homefile_params.use_userdef = true;
275 read_homefile_params.use_factory_settings = G.factory_startup;
276 read_homefile_params.use_empty_data = false;
277 read_homefile_params.filepath_startup_override = nullptr;
279 read_homefile_params.is_first_time = true;
280
281 wm_homefile_read_ex(C, &read_homefile_params, nullptr, &params_file_read_post);
282
283 /* NOTE: leave `G_MAIN->filepath` set to an empty string since this
284 * matches behavior after loading a new file. */
285 BLI_assert(G_MAIN->filepath[0] == '\0');
286
287 /* Call again to set from preferences. */
288 BLT_lang_set(nullptr);
289
290 /* For file-system. Called here so can include user preference paths if needed. */
291 ED_file_init();
292
293 if (!G.background) {
295
296#ifdef WITH_INPUT_NDOF
297 /* Sets 3D mouse dead-zone. */
298 WM_ndof_deadzone_set(U.ndof_deadzone);
299#endif
300 WM_init_gpu();
301
303 WM_exit(C, -1);
304 }
305
307 UI_init();
310 }
311
313
315
316#ifdef WITH_PYTHON
317 BPY_python_start(C, argc, argv);
319#else
320 UNUSED_VARS(argc, argv);
321#endif
322
323 if (!G.background) {
326 }
327 else {
329 }
330 }
331
333
335
336 if (!G.background) {
338 }
339
340 STRNCPY(G.filepath_last_library, BKE_main_blendfile_path_from_global());
341
342 CTX_py_init_set(C, true);
343
344 /* Postpone updating the key-configuration until after add-ons have been registered,
345 * needed to properly load user-configured add-on key-maps, see: #113603. */
347
349
350 /* Load add-ons after key-maps have been initialized (but before the blend file has been read),
351 * important to guarantee default key-maps have been declared & before post-read handlers run. */
353
355 WM_keyconfig_update_on_startup(static_cast<wmWindowManager *>(G_MAIN->wm.first));
356
357 wm_homefile_read_post(C, params_file_read_post);
358}
359
361{
362 if (U.uiflag & USER_SPLASH_DISABLE) {
363 return false;
364 }
365
366 bool use_splash = false;
367
368 const char *blendfile_path = BKE_main_blendfile_path_from_global();
369 if (blendfile_path[0] == '\0') {
370 /* Common case, no file is loaded, show the splash. */
371 use_splash = true;
372 }
373 else {
374 /* A less common case, if there is no user preferences, show the splash screen
375 * so the user has the opportunity to restore settings from a previous version. */
376 use_splash = !blender::bke::preferences::exists();
377 }
378
379 return use_splash;
380}
381
383{
385 return;
386 }
387
389}
390
392{
394 /* NOTE(@ideasman42): this should practically never happen. */
396 return;
397 }
398
399 wmWindow *prevwin = CTX_wm_window(C);
400 CTX_wm_window_set(C, static_cast<wmWindow *>(wm->windows.first));
402 C, "WM_OT_splash", blender::wm::OpCallContext::InvokeDefault, nullptr, nullptr);
403 CTX_wm_window_set(C, prevwin);
404}
405
408{
409#ifdef WITH_PYTHON
410 const char *imports[] = {"bpy", nullptr};
411 BPY_run_string_eval(C, imports, "bpy.utils.load_scripts_extensions()");
412#else
413 UNUSED_VARS(C);
414#endif
415}
416
417/* Free strings of open recent files. */
418static void free_openrecent()
419{
420 LISTBASE_FOREACH (RecentFile *, recent, &G.recent_files) {
421 MEM_freeN(recent->filepath);
422 }
423
424 BLI_freelistN(&(G.recent_files));
425}
426
427static int wm_exit_handler(bContext *C, const wmEvent *event, void *userdata)
428{
429 WM_exit(C, EXIT_SUCCESS);
430
431 UNUSED_VARS(event, userdata);
432 return WM_UI_HANDLER_BREAK;
433}
434
436{
437 /* What we do here is a little bit hacky, but quite simple and doesn't require bigger
438 * changes: Add a handler wrapping WM_exit() to cause a delayed call of it. */
439
440 wmWindow *win = CTX_wm_window(C);
441
442 /* Use modal UI handler for now.
443 * Could add separate WM handlers or so, but probably not worth it. */
445 C, &win->modalhandlers, wm_exit_handler, nullptr, nullptr, eWM_EventHandlerFlag(0));
446 WM_event_add_mousemove(win); /* Ensure handler actually gets called. */
447}
448
449void UV_clipboard_free();
450
451void WM_exit_ex(bContext *C, const bool do_python_exit, const bool do_user_exit_actions)
452{
453 using namespace blender;
454 wmWindowManager *wm = C ? CTX_wm_manager(C) : nullptr;
455
456 /* While nothing technically prevents saving user data in background mode,
457 * don't do this as not typically useful and more likely to cause problems
458 * if automated scripts happen to write changes to the preferences for example.
459 * Saving #BLENDER_QUIT_FILE is also not likely to be desired either. */
460 BLI_assert(G.background ? (do_user_exit_actions == false) : true);
461
462 /* First wrap up running stuff, we assume only the active WM is running. */
463 /* Modal handlers are on window level freed, others too? */
464 /* NOTE: same code copied in `wm_files.cc`. */
465 if (C && wm) {
466 if (do_user_exit_actions) {
467 /* Save quit.blend. */
468 Main *bmain = CTX_data_main(C);
469 char filepath[FILE_MAX];
470 const int fileflags = G.fileflags | G_FILE_COMPRESS | G_FILE_RECOVER_WRITE;
471
472 BLI_path_join(filepath, sizeof(filepath), BKE_tempdir_base(), BLENDER_QUIT_FILE);
473
475
476 BlendFileWriteParams blend_file_write_params{};
477 if (BLO_write_file(bmain, filepath, fileflags, &blend_file_write_params, nullptr)) {
478 CLOG_INFO_NOCHECK(&LOG_BLEND, "Saved session recovery to \"%s\"", filepath);
479 }
480 }
481
483
484 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
485 CTX_wm_window_set(C, win); /* Needed by operator close callbacks. */
486 WM_event_remove_handlers(C, &win->handlers);
487 WM_event_remove_handlers(C, &win->modalhandlers);
489 }
490
491 if (!G.background) {
493 }
494
495 if (do_user_exit_actions) {
496 if ((U.pref_flag & USER_PREF_FLAG_SAVE) && ((G.f & G_FLAG_USERPREF_NO_SAVE_ON_EXIT) == 0)) {
497 if (U.runtime.is_dirty) {
499 }
500 }
501 /* Free the callback data used on file-open
502 * (will be set when a recover operation has run). */
503 wm_test_autorun_revert_action_set(nullptr, nullptr);
504 }
505 }
506
507#if defined(WITH_PYTHON) && !defined(WITH_PYTHON_MODULE)
508 /* Without this, we there isn't a good way to manage false-positive resource leaks
509 * where a #PyObject references memory allocated with guarded-alloc, #71362.
510 *
511 * This allows add-ons to free resources when unregistered (which is good practice anyway).
512 *
513 * Don't run this code when built as a Python module as this runs when Python is in the
514 * process of shutting down, where running a snippet like this will crash, see #82675.
515 * Instead use the `atexit` module, installed by #BPY_python_start.
516 *
517 * Don't run this code when `C` is null because #pyrna_unregister_class
518 * passes in `CTX_data_main(C)` to un-registration functions.
519 * Further: `addon_utils.disable_all()` may call into functions that expect a valid context,
520 * supporting all these code-paths with a null context is quite involved for such a corner-case.
521 *
522 * Check `CTX_py_init_get(C)` in case this function runs before Python has been initialized.
523 * Which can happen when the GPU backend fails to initialize.
524 */
525 if (C && CTX_py_init_get(C)) {
526 /* Calls `addon_utils.disable_all()` as well as unregistering all "startup" modules. */
527 const char *imports[] = {"bpy", "bpy.utils", nullptr};
528 BPY_run_string_eval(C, imports, "bpy.utils._on_exit()");
529 }
530#endif
531
532 /* Perform this early in case commands reference other data freed later in this function.
533 * This most run:
534 * - After add-ons are disabled because they may unregister commands.
535 * - Before Python exits so Python objects can be de-referenced.
536 * - Before #BKE_blender_atexit runs they free the `argv` on WIN32.
537 */
539
541
543
547
552
553 /* All non-screen and non-space stuff editors did, like edit-mode. */
554 if (C) {
555 Main *bmain = CTX_data_main(C);
556 ED_editors_exit(bmain, true);
557 }
558
560
562
563 /* Clear the cache which may (indirectly) contain e.g. GPU resources which need to be freed
564 * before the GPU backend is destroyed. */
566
567 /* Render code might still access databases. */
570
571 ED_preview_free_dbase(); /* Frees a Main dbase, before #BKE_blender_free! */
574
582
584
586
587 if (gpu_is_init) {
589 }
590
591 /* Frees the entire library (#G_MAIN) and space-types. */
593
594 /* Important this runs after #BKE_blender_free because the window manager may be allocated
595 * when `C` is null, holding references to undo steps which will fail to free if their types
596 * have been freed first. */
598
599 /* Free the GPU subdivision data after the database to ensure that subdivision structs used by
600 * the modifiers were garbage collected. */
601 if (gpu_is_init) {
603 }
604
610
611 /* Free gizmo-maps after freeing blender,
612 * so no deleted data get accessed during cleaning up of areas. */
616 /* Same for UI-list types. */
618
619 BLF_exit();
620
622
624
625 // free_txt_data();
626
627#ifdef WITH_PYTHON
628 /* Option not to exit Python so this function can be called from 'atexit'. */
629 if ((C == nullptr) || CTX_py_init_get(C)) {
630 /* NOTE: (old note)
631 * before BKE_blender_free so Python's garbage-collection happens while library still exists.
632 * Needed at least for a rare crash that can happen in python-drivers.
633 *
634 * Update for Blender 2.5, move after #BKE_blender_free because Blender now holds references
635 * to #PyObject's so #Py_DECREF'ing them after Python ends causes bad problems every time
636 * the python-driver bug can be fixed if it happens again we can deal with it then. */
637 BPY_python_end(do_python_exit);
638 }
639#else
640 (void)do_python_exit;
641#endif
642
643 ED_file_exit(); /* For file-selector menu data. */
644
645 /* Delete GPU resources and context. The UI also uses GPU resources and so
646 * is also deleted with the context active. */
647 if (gpu_is_init) {
649 UI_exit();
651 GPU_exit();
654 }
655 else {
656 UI_exit();
657 }
658
660
661 RNA_exit(); /* Should be after #BPY_python_end so struct python slots are cleared. */
662
664
665 if (C) {
666 CTX_free(C);
667 }
668
670
673
674 /* No need to call this early, rather do it late so that other
675 * pieces of Blender using sound may exit cleanly, see also #50676. */
677
679
681
683
685
686 /* Logging cannot be called after exiting (#CLOG_INFO, #CLOG_WARN etc will crash).
687 * So postpone exiting until other sub-systems that may use logging have shut down. */
688 CLG_exit();
689}
690
691void WM_exit(bContext *C, const int exit_code)
692{
693 const bool do_user_exit_actions = G.background ? false : (exit_code == EXIT_SUCCESS);
694 WM_exit_ex(C, true, do_user_exit_actions);
695
696 if (!CLG_quiet_get()) {
697 printf("\nBlender quit\n");
698 }
699
700 exit(exit_code);
701}
702
704{
706
707 /* Any operators referenced by gizmos may now be a dangling pointer.
708 *
709 * While it is possible to inspect the gizmos it's simpler to re-create them,
710 * especially for script reloading - where we can accept slower logic
711 * for the sake of simplicity, see #126852. */
713}
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:1243
void BKE_tempdir_session_purge()
Definition appdir.cc:1248
Blender util stuff.
void BKE_blender_atexit()
Definition blender.cc:515
void BKE_blender_userdef_data_free(UserDef *userdef, bool clear_fonts)
Definition blender.cc:359
void BKE_blender_free()
Definition blender.cc:63
Blender CLI Generic --command Support.
void BKE_blender_cli_command_free_all()
bool BKE_blendfile_userdef_write_all(ReportList *reports)
void CTX_py_init_set(bContext *C, bool value)
wmWindow * CTX_wm_window(const bContext *C)
void CTX_free(bContext *C)
bool CTX_py_init_get(const 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
@ G_DEBUG_GPU_COMPILE_SHADERS
#define G_MAIN
@ 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:547
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:892
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:3403
void BKE_region_callback_free_gizmomap_set(void(*callback)(wmGizmoMap *))
Definition screen.cc:515
void BKE_spacedata_callback_id_remap_set(void(*func)(ScrArea *area, SpaceLink *sl, ID *old_id, ID *new_id))
Definition screen.cc:465
void BKE_region_callback_refresh_tag_gizmomap_set(void(*callback)(wmGizmoMap *))
Definition screen.cc:482
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:444
void BKE_vfont_clipboard_free()
Definition vfont.cc:471
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:693
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)
bool CLG_quiet_get()
Definition clog.cc:945
void CLG_exit()
Definition clog.cc:880
#define CLOG_INFO_NOCHECK(clg_ref, format,...)
Definition CLG_log.h:204
#define CLG_LOGREF_DECLARE_GLOBAL(var, id)
Definition CLG_log.h:139
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:586
void ED_node_init_butfuncs()
Definition drawnode.cc:908
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:224
void ED_spacedata_id_remap_single(ScrArea *area, SpaceLink *sl, ID *old_id, ID *new_id)
Definition ed_util.cc:474
bool ED_editors_flush_edits(Main *bmain)
Definition ed_util.cc:336
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:577
CLG_LogRef * WM_LOG_MSGBUS_PUB
CLG_LogRef * WM_LOG_OPERATORS
CLG_LogRef * WM_LOG_EVENTS
CLG_LogRef * WM_LOG_TOOL_GIZMO
CLG_LogRef * WM_LOG_MSGBUS_SUB
#define WM_UI_HANDLER_BREAK
Definition WM_types.hh:349
#define U
static CLG_LogRef LOG_BLEND
BPy_StructRNA * depsgraph
void ANIM_drivers_copybuf_free()
Definition drivers.cc:546
void ANIM_driver_vars_copybuf_free()
Definition drivers.cc:667
void ED_gpencil_anim_copybuf_free()
void ANIM_fmodifiers_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:307
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:416
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)
void WM_main_remove_notifier_reference(const void *reference)
wmOperatorStatus WM_operator_name_call(bContext *C, const char *opstring, blender::wm::OpCallContext context, PointerRNA *properties, const wmEvent *event)
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:4241
const char * WM_init_state_app_template_get()
Definition wm_files.cc:1207
void wm_history_file_read()
Definition wm_files.cc:1618
void wm_autosave_delete()
Definition wm_files.cc:2425
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:1218
void wm_homefile_read_post(bContext *C, const wmFileReadPost_Params *params_file_read_post)
Definition wm_files.cc:1598
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:602
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)