Blender V4.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
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.h"
25#include "BLI_listbase.h"
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_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.h" /* #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_message.hh"
75#include "WM_types.hh"
76
77#include "wm.hh"
78#include "wm_cursors.hh"
79#include "wm_event_system.hh"
80#include "wm_files.hh"
82#include "wm_surface.hh"
83#include "wm_window.hh"
84
85#include "ED_anim_api.hh"
86#include "ED_asset.hh"
87#include "ED_gpencil_legacy.hh"
88#include "ED_grease_pencil.hh"
89#include "ED_keyframes_edit.hh"
90#include "ED_keyframing.hh"
91#include "ED_node.hh"
92#include "ED_render.hh"
93#include "ED_screen.hh"
94#include "ED_space_api.hh"
95#include "ED_undo.hh"
96#include "ED_util.hh"
97
98#include "BLF_api.hh"
99#include "BLT_lang.hh"
100
101#include "UI_interface.hh"
102#include "UI_resources.hh"
103#include "UI_string_search.hh"
104
106#include "GPU_context.hh"
107#include "GPU_init_exit.hh"
108#include "GPU_material.hh"
109
110#include "COM_compositor.hh"
111
112#include "DEG_depsgraph.hh"
113#include "DEG_depsgraph_query.hh"
114
115#include "DRW_engine.hh"
116
124
126
127static bool wm_start_with_console = false;
128
130{
131 wm_start_with_console = value;
132}
133
141static bool gpu_is_init = false;
142
144{
145 /* Must be called only once. */
146 BLI_assert(gpu_is_init == false);
147
148 if (G.background) {
149 /* Ghost is still not initialized elsewhere in background mode. */
151 }
152
153 if (!GPU_backend_supported()) {
154 return;
155 }
156
157 /* Needs to be first to have an OpenGL context bound. */
159
160 GPU_init();
161
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 }
192 BKE_sound_jack_scene_update(scene_eval, mode, time);
194 }
195}
196
197void WM_init(bContext *C, int argc, const char **argv)
198{
199
200 if (!G.background) {
201 wm_ghost_init(C); /* NOTE: it assigns C to ghost! */
204 }
205
208
210
211 WM_paneltype_init(); /* Lookup table only. */
216
218
225
227
229
230 BLF_init();
231
233 /* Must call first before doing any `.blend` file reading,
234 * since versioning code may create new IDs. See #57066. */
235 BLT_lang_set(nullptr);
236
237 /* Init icons & previews before reading .blend files for preview icons, which can
238 * get triggered by the depsgraph. This is also done in background mode
239 * for scripts that do background processing with preview icons. */
242
244
245 /* Studio-lights needs to be init before we read the home-file,
246 * otherwise the versioning cannot find the default studio-light. */
248
249 BLI_assert((G.fileflags & G_FILE_NO_UI) == 0);
250
269 wmFileReadPost_Params *params_file_read_post = nullptr;
270 wmHomeFileRead_Params read_homefile_params{};
271 read_homefile_params.use_data = true;
272 read_homefile_params.use_userdef = true;
273 read_homefile_params.use_factory_settings = G.factory_startup;
274 read_homefile_params.use_empty_data = false;
275 read_homefile_params.filepath_startup_override = nullptr;
276 read_homefile_params.app_template_override = WM_init_state_app_template_get();
277 read_homefile_params.is_first_time = true;
278
279 wm_homefile_read_ex(C, &read_homefile_params, nullptr, &params_file_read_post);
280
281 /* NOTE: leave `G_MAIN->filepath` set to an empty string since this
282 * matches behavior after loading a new file. */
283 BLI_assert(G_MAIN->filepath[0] == '\0');
284
285 /* Call again to set from preferences. */
286 BLT_lang_set(nullptr);
287
288 /* For file-system. Called here so can include user preference paths if needed. */
289 ED_file_init();
290
291 if (!G.background) {
293
294#ifdef WITH_INPUT_NDOF
295 /* Sets 3D mouse dead-zone. */
296 WM_ndof_deadzone_set(U.ndof_deadzone);
297#endif
298 WM_init_gpu();
299
301 WM_exit(C, -1);
302 }
303
305 UI_init();
308 }
309
311
313
314#ifdef WITH_PYTHON
315 BPY_python_start(C, argc, argv);
317#else
318 UNUSED_VARS(argc, argv);
319#endif
320
321 if (!G.background) {
324 }
325 else {
327 }
328 }
329
331
333
334 if (!G.background) {
336 }
337
338 STRNCPY(G.filepath_last_library, BKE_main_blendfile_path_from_global());
339
340 CTX_py_init_set(C, true);
341
342 /* Postpone updating the key-configuration until after add-ons have been registered,
343 * needed to properly load user-configured add-on key-maps, see: #113603. */
345
347
348 /* Load add-ons after key-maps have been initialized (but before the blend file has been read),
349 * important to guarantee default key-maps have been declared & before post-read handlers run. */
351
353 WM_keyconfig_update(static_cast<wmWindowManager *>(G_MAIN->wm.first));
354
355 wm_homefile_read_post(C, params_file_read_post);
356}
357
359{
360 if (U.uiflag & USER_SPLASH_DISABLE) {
361 return false;
362 }
363
364 bool use_splash = false;
365
366 const char *blendfile_path = BKE_main_blendfile_path_from_global();
367 if (blendfile_path[0] == '\0') {
368 /* Common case, no file is loaded, show the splash. */
369 use_splash = true;
370 }
371 else {
372 /* A less common case, if there is no user preferences, show the splash screen
373 * so the user has the opportunity to restore settings from a previous version. */
374 const std::optional<std::string> cfgdir = BKE_appdir_folder_id(BLENDER_USER_CONFIG, nullptr);
375 if (cfgdir.has_value()) {
376 char userpref[FILE_MAX];
377 BLI_path_join(userpref, sizeof(userpref), cfgdir->c_str(), BLENDER_USERPREF_FILE);
378 if (!BLI_exists(userpref)) {
379 use_splash = true;
380 }
381 }
382 else {
383 use_splash = true;
384 }
385 }
386
387 return use_splash;
388}
389
391{
393 return;
394 }
395
397}
398
400{
402 /* NOTE(@ideasman42): this should practically never happen. */
404 return;
405 }
406
407 wmWindow *prevwin = CTX_wm_window(C);
408 CTX_wm_window_set(C, static_cast<wmWindow *>(wm->windows.first));
409 WM_operator_name_call(C, "WM_OT_splash", WM_OP_INVOKE_DEFAULT, nullptr, nullptr);
410 CTX_wm_window_set(C, prevwin);
411}
412
415{
416#ifdef WITH_PYTHON
417 const char *imports[] = {"bpy", nullptr};
418 BPY_run_string_eval(C, imports, "bpy.utils.load_scripts_extensions()");
419#else
420 UNUSED_VARS(C);
421#endif
422}
423
424/* Free strings of open recent files. */
425static void free_openrecent()
426{
427 LISTBASE_FOREACH (RecentFile *, recent, &G.recent_files) {
428 MEM_freeN(recent->filepath);
429 }
430
431 BLI_freelistN(&(G.recent_files));
432}
433
434static int wm_exit_handler(bContext *C, const wmEvent *event, void *userdata)
435{
436 WM_exit(C, EXIT_SUCCESS);
437
438 UNUSED_VARS(event, userdata);
439 return WM_UI_HANDLER_BREAK;
440}
441
443{
444 /* What we do here is a little bit hacky, but quite simple and doesn't require bigger
445 * changes: Add a handler wrapping WM_exit() to cause a delayed call of it. */
446
447 wmWindow *win = CTX_wm_window(C);
448
449 /* Use modal UI handler for now.
450 * Could add separate WM handlers or so, but probably not worth it. */
452 C, &win->modalhandlers, wm_exit_handler, nullptr, nullptr, eWM_EventHandlerFlag(0));
453 WM_event_add_mousemove(win); /* Ensure handler actually gets called. */
454}
455
456void UV_clipboard_free();
457
458void WM_exit_ex(bContext *C, const bool do_python_exit, const bool do_user_exit_actions)
459{
460 using namespace blender;
461 wmWindowManager *wm = C ? CTX_wm_manager(C) : nullptr;
462
463 /* While nothing technically prevents saving user data in background mode,
464 * don't do this as not typically useful and more likely to cause problems
465 * if automated scripts happen to write changes to the preferences for e.g.
466 * Saving #BLENDER_QUIT_FILE is also not likely to be desired either. */
467 BLI_assert(G.background ? (do_user_exit_actions == false) : true);
468
469 /* First wrap up running stuff, we assume only the active WM is running. */
470 /* Modal handlers are on window level freed, others too? */
471 /* NOTE: same code copied in `wm_files.cc`. */
472 if (C && wm) {
473 if (do_user_exit_actions) {
474 /* Save quit.blend. */
475 Main *bmain = CTX_data_main(C);
476 char filepath[FILE_MAX];
477 int fileflags = G.fileflags & ~G_FILE_COMPRESS;
478 fileflags |= G_FILE_RECOVER_WRITE;
479
480 BLI_path_join(filepath, sizeof(filepath), BKE_tempdir_base(), BLENDER_QUIT_FILE);
481
483
484 BlendFileWriteParams blend_file_write_params{};
485 if (BLO_write_file(bmain, filepath, fileflags, &blend_file_write_params, nullptr)) {
486 if (!G.quiet) {
487 printf("Saved session recovery to \"%s\"\n", filepath);
488 }
489 }
490 }
491
493
494 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
495 CTX_wm_window_set(C, win); /* Needed by operator close callbacks. */
496 WM_event_remove_handlers(C, &win->handlers);
497 WM_event_remove_handlers(C, &win->modalhandlers);
499 }
500
501 if (!G.background) {
503 }
504
505 if (do_user_exit_actions) {
506 if ((U.pref_flag & USER_PREF_FLAG_SAVE) && ((G.f & G_FLAG_USERPREF_NO_SAVE_ON_EXIT) == 0)) {
507 if (U.runtime.is_dirty) {
509 }
510 }
511 /* Free the callback data used on file-open
512 * (will be set when a recover operation has run). */
513 wm_test_autorun_revert_action_set(nullptr, nullptr);
514 }
515 }
516
517#if defined(WITH_PYTHON) && !defined(WITH_PYTHON_MODULE)
518 /* Without this, we there isn't a good way to manage false-positive resource leaks
519 * where a #PyObject references memory allocated with guarded-alloc, #71362.
520 *
521 * This allows add-ons to free resources when unregistered (which is good practice anyway).
522 *
523 * Don't run this code when built as a Python module as this runs when Python is in the
524 * process of shutting down, where running a snippet like this will crash, see #82675.
525 * Instead use the `atexit` module, installed by #BPY_python_start.
526 *
527 * Don't run this code when `C` is null because #pyrna_unregister_class
528 * passes in `CTX_data_main(C)` to un-registration functions.
529 * Further: `addon_utils.disable_all()` may call into functions that expect a valid context,
530 * supporting all these code-paths with a null context is quite involved for such a corner-case.
531 *
532 * Check `CTX_py_init_get(C)` in case this function runs before Python has been initialized.
533 * Which can happen when the GPU backend fails to initialize.
534 */
535 if (C && CTX_py_init_get(C)) {
536 const char *imports[2] = {"addon_utils", nullptr};
537 BPY_run_string_eval(C, imports, "addon_utils.disable_all()");
538 }
539#endif
540
541 /* Perform this early in case commands reference other data freed later in this function.
542 * This most run:
543 * - After add-ons are disabled because they may unregister commands.
544 * - Before Python exits so Python objects can be de-referenced.
545 * - Before #BKE_blender_atexit runs they free the `argv` on WIN32.
546 */
548
550
552
556
561
562 /* All non-screen and non-space stuff editors did, like edit-mode. */
563 if (C) {
564 Main *bmain = CTX_data_main(C);
565 ED_editors_exit(bmain, true);
566 }
567
569
571
572 /* Render code might still access databases. */
575
576 ED_preview_free_dbase(); /* Frees a Main dbase, before #BKE_blender_free! */
578 ed::asset::list::storage_exit();
579
584 ed::greasepencil::clipboard_free();
587
588#ifdef WITH_COMPOSITOR_CPU
590#endif
591
592 bke::subdiv::exit();
593
594 if (gpu_is_init) {
596 }
597
598 /* Frees the entire library (#G_MAIN) and space-types. */
600
601 /* Important this runs after #BKE_blender_free because the window manager may be allocated
602 * when `C` is null, holding references to undo steps which will fail to free if their types
603 * have been freed first. */
605
606 /* Free the GPU subdivision data after the database to ensure that subdivision structs used by
607 * the modifiers were garbage collected. */
608 if (gpu_is_init) {
610 }
611
618
619 /* Free gizmo-maps after freeing blender,
620 * so no deleted data get accessed during cleaning up of areas. */
624 /* Same for UI-list types. */
626
627 BLF_exit();
628
630
632
633 // free_txt_data();
634
635#ifdef WITH_PYTHON
636 /* Option not to exit Python so this function can be called from 'atexit'. */
637 if ((C == nullptr) || CTX_py_init_get(C)) {
638 /* NOTE: (old note)
639 * before BKE_blender_free so Python's garbage-collection happens while library still exists.
640 * Needed at least for a rare crash that can happen in python-drivers.
641 *
642 * Update for Blender 2.5, move after #BKE_blender_free because Blender now holds references
643 * to #PyObject's so #Py_DECREF'ing them after Python ends causes bad problems every time
644 * the python-driver bug can be fixed if it happens again we can deal with it then. */
645 BPY_python_end(do_python_exit);
646 }
647#else
648 (void)do_python_exit;
649#endif
650
651 ED_file_exit(); /* For file-selector menu data. */
652
653 /* Delete GPU resources and context. The UI also uses GPU resources and so
654 * is also deleted with the context active. */
655 if (gpu_is_init) {
657 UI_exit();
660 GPU_exit();
663 }
664 else {
665 UI_exit();
666 }
667
669
670 RNA_exit(); /* Should be after #BPY_python_end so struct python slots are cleared. */
671
673
674 if (C) {
675 CTX_free(C);
676 }
677
679
682
683 /* No need to call this early, rather do it late so that other
684 * pieces of Blender using sound may exit cleanly, see also #50676. */
686
688
690
692
694
695 /* Logging cannot be called after exiting (#CLOG_INFO, #CLOG_WARN etc will crash).
696 * So postpone exiting until other sub-systems that may use logging have shut down. */
697 CLG_exit();
698}
699
700void WM_exit(bContext *C, const int exit_code)
701{
702 const bool do_user_exit_actions = G.background ? false : (exit_code == EXIT_SUCCESS);
703 WM_exit_ex(C, true, do_user_exit_actions);
704
705 if (!G.quiet) {
706 printf("\nBlender quit\n");
707 }
708
709 exit(exit_code);
710}
711
713{
715
716 /* Any operators referenced by gizmos may now be a dangling pointer.
717 *
718 * While it is possible to inspect the gizmos it's simpler to re-create them,
719 * especially for script reloading - where we can accept slower logic
720 * for the sake of simplicity, see #126852. */
722}
void BKE_addon_pref_type_free(void)
Definition addon.cc:124
void BKE_addon_pref_type_init(void)
Definition addon.cc:118
#define BLENDER_USERPREF_FILE
void BKE_appdir_exit()
Definition appdir.cc:101
@ BLENDER_USER_CONFIG
std::optional< std::string > BKE_appdir_folder_id(int folder_id, const char *subfolder) ATTR_WARN_UNUSED_RESULT
Definition appdir.cc:704
#define BLENDER_QUIT_FILE
const char * BKE_tempdir_base() ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
Definition appdir.cc:1211
void BKE_tempdir_session_purge()
Definition appdir.cc:1216
Blender util stuff.
void BKE_blender_atexit()
Definition blender.cc:491
void BKE_blender_userdef_data_free(UserDef *userdef, bool clear_fonts)
Definition blender.cc:335
void BKE_blender_free()
Definition blender.cc:54
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
@ G_FILE_RECOVER_WRITE
@ G_FILE_NO_UI
#define G_MAIN
@ G_DEBUG_GPU_COMPILE_SHADERS
void BKE_icons_init(int first_dyn_id)
Definition icons.cc:166
void BKE_image_free_unused_gpu_textures(void)
Definition image_gpu.cc:521
void BKE_keyconfig_pref_type_init(void)
Definition keyconfig.cc:95
void BKE_keyconfig_pref_type_free(void)
Definition keyconfig.cc:101
void BKE_library_callback_remap_editor_id_reference_set(BKE_library_remap_editor_id_reference_cb func)
Definition lib_remap.cc:54
void BKE_library_callback_free_notifier_reference_set(BKE_library_free_notifier_reference_cb func)
Definition lib_remap.cc:47
const char * BKE_main_blendfile_path_from_global()
Definition main.cc:837
void BKE_mask_clipboard_free(void)
General operations, lookup, etc. for materials.
void BKE_materials_exit(void)
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:3364
void BKE_region_callback_free_gizmomap_set(void(*callback)(wmGizmoMap *))
Definition screen.cc:497
void BKE_spacedata_callback_id_remap_set(void(*func)(ScrArea *area, SpaceLink *sl, ID *old_id, ID *new_id))
Definition screen.cc:447
void BKE_region_callback_refresh_tag_gizmomap_set(void(*callback)(wmGizmoMap *))
Definition screen.cc:464
void BKE_sound_jack_sync_callback_set(SoundJackSyncCallback callback)
void BKE_sound_lock(void)
void BKE_sound_jack_scene_update(struct Scene *scene, int mode, double time)
void BKE_sound_unlock(void)
void BKE_sound_exit(void)
void BKE_studiolight_init(void)
void BKE_tracking_clipboard_free(void)
Definition tracking.cc:443
void BKE_vfont_clipboard_free()
Definition vfont.cc:2063
void BLF_exit()
Definition blf.cc:71
int BLF_init()
Definition blf.cc:62
#define BLI_assert(a)
Definition BLI_assert.h:50
File and directory operations.
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition storage.cc:350
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition listbase.cc:496
#define FILE_MAX
#define BLI_path_join(...)
#define STRNCPY(dst, src)
Definition BLI_string.h:593
void BLI_task_scheduler_exit(void)
void BLI_threadapi_exit(void)
Definition threads.cc:119
void BLI_timer_free(void)
Definition BLI_timer.c:124
#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:251
void BLT_lang_init()
Definition blt_lang.cc:182
void BLT_lang_free()
Definition blt_lang.cc:227
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:706
#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:523
void ED_node_init_butfuncs()
Definition drawnode.cc:1067
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:218
void ED_spacedata_id_remap_single(ScrArea *area, SpaceLink *sl, ID *old_id, ID *new_id)
Definition ed_util.cc:482
bool ED_editors_flush_edits(Main *bmain)
Definition ed_util.cc:331
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_pass_cache_init()
void GPU_pass_cache_free()
void GPU_shader_cache_dir_clear_old()
void GPU_shader_compile_static()
Read Guarded memory(de)allocation.
void UI_init()
void UI_interface_tag_script_reload()
void UI_exit()
@ BIFICONID_LAST_STATIC
eWM_EventHandlerFlag
Definition WM_api.hh:462
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:218
CLG_LogRef * WM_LOG_MSGBUS_SUB
CLG_LogRef * WM_LOG_KEYMAPS
#define WM_UI_HANDLER_BREAK
Definition WM_types.hh:316
unsigned int U
Definition btGjkEpa3.h:78
#define printf
const Depsgraph * depsgraph
void ANIM_drivers_copybuf_free()
Definition drivers.cc:564
void ANIM_driver_vars_copybuf_free()
Definition drivers.cc:685
void ED_gpencil_anim_copybuf_free()
void ANIM_fmodifiers_copybuf_free()
void ED_gpencil_strokes_copybuf_free()
void RE_engines_exit()
void ANIM_fcurves_copybuf_free()
void ANIM_keyingset_infos_exit()
void MEM_freeN(void *vmemh)
Definition mallocn.cc:105
#define G(x, y, z)
void RNA_exit()
Definition rna_access.cc:98
void * first
ListBase wm
Definition BKE_main.hh:239
unsigned int use_data
Definition wm_files.hh:29
void WM_keyconfig_init(bContext *C)
Definition wm.cc:440
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)
int WM_operator_name_call(bContext *C, const char *opstring, wmOperatorCallContext 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:4129
const char * WM_init_state_app_template_get()
Definition wm_files.cc:1182
void wm_history_file_read()
Definition wm_files.cc:1594
void wm_autosave_delete()
Definition wm_files.cc:2384
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:1193
void wm_homefile_read_post(bContext *C, const wmFileReadPost_Params *params_file_read_post)
Definition wm_files.cc:1574
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:576
void WM_keyconfig_update(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)