Blender  V3.3
wm_init_exit.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2007 Blender Foundation. All rights reserved. */
3 
10 #include <stdio.h>
11 #include <stdlib.h>
12 #include <string.h>
13 
14 #ifdef _WIN32
15 # define WIN32_LEAN_AND_MEAN
16 # include <windows.h>
17 #endif
18 
19 #include "MEM_guardedalloc.h"
20 
21 #include "CLG_log.h"
22 
23 #include "DNA_genfile.h"
24 #include "DNA_scene_types.h"
25 #include "DNA_userdef_types.h"
27 
28 #include "BLI_listbase.h"
29 #include "BLI_path_util.h"
30 #include "BLI_string.h"
31 #include "BLI_task.h"
32 #include "BLI_threads.h"
33 #include "BLI_timer.h"
34 #include "BLI_utildefines.h"
35 
36 #include "BLO_undofile.h"
37 #include "BLO_writefile.h"
38 
39 #include "BKE_blender.h"
40 #include "BKE_blendfile.h"
41 #include "BKE_callbacks.h"
42 #include "BKE_context.h"
43 #include "BKE_global.h"
44 #include "BKE_icons.h"
45 #include "BKE_image.h"
46 #include "BKE_keyconfig.h"
47 #include "BKE_lib_remap.h"
48 #include "BKE_main.h"
49 #include "BKE_mball_tessellate.h"
50 #include "BKE_node.h"
51 #include "BKE_report.h"
52 #include "BKE_scene.h"
53 #include "BKE_screen.h"
54 #include "BKE_sound.h"
55 #include "BKE_vfont.h"
56 
57 #include "BKE_addon.h"
58 #include "BKE_appdir.h"
59 #include "BKE_mask.h" /* free mask clipboard */
60 #include "BKE_material.h" /* BKE_material_copybuf_clear */
61 #include "BKE_studiolight.h"
62 #include "BKE_subdiv.h"
63 #include "BKE_tracking.h" /* free tracking clipboard */
64 
65 #include "RE_engine.h"
66 #include "RE_pipeline.h" /* RE_ free stuff */
67 
68 #include "SEQ_clipboard.h" /* free seq clipboard */
69 
70 #include "IMB_thumbs.h"
71 
72 #ifdef WITH_PYTHON
73 # include "BPY_extern.h"
74 # include "BPY_extern_python.h"
75 # include "BPY_extern_run.h"
76 #endif
77 
78 #include "GHOST_C-api.h"
79 #include "GHOST_Path-api.h"
80 
81 #include "RNA_define.h"
82 
83 #include "WM_api.h"
84 #include "WM_message.h"
85 #include "WM_types.h"
86 
87 #include "wm.h"
88 #include "wm_cursors.h"
89 #include "wm_event_system.h"
90 #include "wm_files.h"
91 #include "wm_platform_support.h"
92 #include "wm_surface.h"
93 #include "wm_window.h"
94 
95 #include "ED_anim_api.h"
96 #include "ED_armature.h"
97 #include "ED_asset.h"
98 #include "ED_gpencil.h"
99 #include "ED_keyframes_edit.h"
100 #include "ED_keyframing.h"
101 #include "ED_node.h"
102 #include "ED_render.h"
103 #include "ED_screen.h"
104 #include "ED_space_api.h"
105 #include "ED_undo.h"
106 #include "ED_util.h"
107 #include "ED_view3d.h"
108 
109 #include "BLF_api.h"
110 #include "BLT_lang.h"
111 #include "UI_interface.h"
112 #include "UI_resources.h"
113 
114 #include "GPU_context.h"
115 #include "GPU_init_exit.h"
116 #include "GPU_material.h"
117 
118 #include "COM_compositor.h"
119 
120 #include "DEG_depsgraph.h"
121 #include "DEG_depsgraph_query.h"
122 
123 #include "DRW_engine.h"
124 
132 
134 {
135  ReportList *reports = CTX_wm_reports(C);
136 
137  BLI_assert(!reports || BLI_listbase_is_empty(&reports->list));
138 
139  BKE_reports_init(reports, RPT_STORE);
140 }
142 {
144 }
145 
146 static bool wm_start_with_console = false;
147 
149 {
150  wm_start_with_console = value;
151 }
152 
160 static bool opengl_is_init = false;
161 
162 void WM_init_opengl(void)
163 {
164  /* Must be called only once. */
165  BLI_assert(opengl_is_init == false);
166 
167  if (G.background) {
168  /* Ghost is still not initialized elsewhere in background mode. */
170  }
171 
172  if (!GPU_backend_supported()) {
173  return;
174  }
175 
176  /* Needs to be first to have an OpenGL context bound. */
178 
179  GPU_init();
180 
182 
183  opengl_is_init = true;
184 }
185 
186 static void sound_jack_sync_callback(Main *bmain, int mode, double time)
187 {
188  /* Ugly: Blender doesn't like it when the animation is played back during rendering. */
189  if (G.is_rendering) {
190  return;
191  }
192 
193  wmWindowManager *wm = bmain->wm.first;
194 
195  LISTBASE_FOREACH (wmWindow *, window, &wm->windows) {
197  if ((scene->audio.flag & AUDIO_SYNC) == 0) {
198  continue;
199  }
200  ViewLayer *view_layer = WM_window_get_active_view_layer(window);
202  if (depsgraph == NULL) {
203  continue;
204  }
205  BKE_sound_lock();
206  Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
207  BKE_sound_jack_scene_update(scene_eval, mode, time);
209  }
210 }
211 
212 void WM_init(bContext *C, int argc, const char **argv)
213 {
214 
215  if (!G.background) {
216  wm_ghost_init(C); /* NOTE: it assigns C to ghost! */
219  }
220 
222 
225 
228 
229  WM_paneltype_init(); /* Lookup table only. */
234 
236 
243 
245 
247 
248  BLF_init();
249 
250  BLT_lang_init();
251  /* Must call first before doing any `.blend` file reading,
252  * since versioning code may create new IDs. See T57066. */
254 
255  /* Init icons before reading .blend files for preview icons, which can
256  * get triggered by the depsgraph. This is also done in background mode
257  * for scripts that do background processing with preview icons. */
259 
260  /* Reports can't be initialized before the window-manager,
261  * but keep before file reading, since that may report errors */
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  struct wmFileReadPost_Params *params_file_read_post = NULL;
292  &(const struct wmHomeFileRead_Params){
293  .use_data = true,
294  .use_userdef = true,
295  .use_factory_settings = G.factory_startup,
296  .use_empty_data = false,
297  .filepath_startup_override = NULL,
298  .app_template_override = WM_init_state_app_template_get(),
299  },
300  NULL,
301  &params_file_read_post);
302 
303  /* NOTE: leave `G_MAIN->filepath` set to an empty string since this
304  * matches behavior after loading a new file. */
305  BLI_assert(G_MAIN->filepath[0] == '\0');
306 
307  /* Call again to set from preferences. */
309 
310  /* For file-system. Called here so can include user preference paths if needed. */
311  ED_file_init();
312 
313  /* That one is generated on demand, we need to be sure it's clear on init. */
315 
316  if (!G.background) {
318 
319 #ifdef WITH_INPUT_NDOF
320  /* Sets 3D mouse dead-zone. */
321  WM_ndof_deadzone_set(U.ndof_deadzone);
322 #endif
323  WM_init_opengl();
324 
326  /* No attempt to avoid memory leaks here. */
327  exit(-1);
328  }
329 
331  UI_init();
333  GPU_render_end();
334  }
335 
336  BKE_subdiv_init();
337 
339 
340 #ifdef WITH_PYTHON
341  BPY_python_start(C, argc, argv);
343 #else
344  UNUSED_VARS(argc, argv);
345 #endif
346 
347  if (!G.background) {
348  if (wm_start_with_console) {
350  }
351  else {
353  }
354  }
355 
358 
360 
361  BLI_strncpy(G.lib, BKE_main_blendfile_path_from_global(), sizeof(G.lib));
362 
363  wm_homefile_read_post(C, params_file_read_post);
364 }
365 
367 {
368  if ((U.uiflag & USER_SPLASH_DISABLE) == 0) {
370  wmWindow *prevwin = CTX_wm_window(C);
371 
372  if (wm->windows.first) {
375  CTX_wm_window_set(C, prevwin);
376  }
377  }
378 }
379 
380 /* free strings of open recent files */
381 static void free_openrecent(void)
382 {
383  LISTBASE_FOREACH (RecentFile *, recent, &G.recent_files) {
384  MEM_freeN(recent->filepath);
385  }
386 
387  BLI_freelistN(&(G.recent_files));
388 }
389 
390 #ifdef WIN32
391 /* Read console events until there is a key event. Also returns on any error. */
392 static void wait_for_console_key(void)
393 {
394  HANDLE hConsoleInput = GetStdHandle(STD_INPUT_HANDLE);
395 
396  if (!ELEM(hConsoleInput, NULL, INVALID_HANDLE_VALUE) && FlushConsoleInputBuffer(hConsoleInput)) {
397  for (;;) {
398  INPUT_RECORD buffer;
399  DWORD ignored;
400 
401  if (!ReadConsoleInput(hConsoleInput, &buffer, 1, &ignored)) {
402  break;
403  }
404 
405  if (buffer.EventType == KEY_EVENT) {
406  break;
407  }
408  }
409  }
410 }
411 #endif
412 
413 static int wm_exit_handler(bContext *C, const wmEvent *event, void *userdata)
414 {
415  WM_exit(C);
416 
417  UNUSED_VARS(event, userdata);
418  return WM_UI_HANDLER_BREAK;
419 }
420 
422 {
423  /* What we do here is a little bit hacky, but quite simple and doesn't require bigger
424  * changes: Add a handler wrapping WM_exit() to cause a delayed call of it. */
425 
426  wmWindow *win = CTX_wm_window(C);
427 
428  /* Use modal UI handler for now.
429  * Could add separate WM handlers or so, but probably not worth it. */
431  WM_event_add_mousemove(win); /* ensure handler actually gets called */
432 }
433 
434 void WM_exit_ex(bContext *C, const bool do_python)
435 {
437 
438  /* first wrap up running stuff, we assume only the active WM is running */
439  /* modal handlers are on window level freed, others too? */
440  /* NOTE: same code copied in `wm_files.c`. */
441  if (C && wm) {
442  if (!G.background) {
443  struct MemFile *undo_memfile = wm->undo_stack ?
445  NULL;
446  if (undo_memfile != NULL) {
447  /* save the undo state as quit.blend */
448  Main *bmain = CTX_data_main(C);
449  char filepath[FILE_MAX];
450  bool has_edited;
451  const int fileflags = G.fileflags & ~G_FILE_COMPRESS;
452 
453  BLI_join_dirfile(filepath, sizeof(filepath), BKE_tempdir_base(), BLENDER_QUIT_FILE);
454 
455  has_edited = ED_editors_flush_edits(bmain);
456 
457  if ((has_edited &&
459  bmain, filepath, fileflags, &(const struct BlendFileWriteParams){0}, NULL)) ||
460  (BLO_memfile_write_file(undo_memfile, filepath))) {
461  printf("Saved session recovery to '%s'\n", filepath);
462  }
463  }
464  }
465 
466  WM_jobs_kill_all(wm);
467 
468  LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
469  CTX_wm_window_set(C, win); /* needed by operator close callbacks */
470  WM_event_remove_handlers(C, &win->handlers);
471  WM_event_remove_handlers(C, &win->modalhandlers);
473  }
474 
475  if (!G.background) {
476  if ((U.pref_flag & USER_PREF_FLAG_SAVE) && ((G.f & G_FLAG_USERPREF_NO_SAVE_ON_EXIT) == 0)) {
477  if (U.runtime.is_dirty) {
479  }
480  }
481  /* Free the callback data used on file-open
482  * (will be set when a recover operation has run). */
484  }
485  }
486 
487 #if defined(WITH_PYTHON) && !defined(WITH_PYTHON_MODULE)
488  /* Without this, we there isn't a good way to manage false-positive resource leaks
489  * where a #PyObject references memory allocated with guarded-alloc, T71362.
490  *
491  * This allows add-ons to free resources when unregistered (which is good practice anyway).
492  *
493  * Don't run this code when built as a Python module as this runs when Python is in the
494  * process of shutting down, where running a snippet like this will crash, see T82675.
495  * Instead use the `atexit` module, installed by #BPY_python_start */
496  BPY_run_string_eval(C, (const char *[]){"addon_utils", NULL}, "addon_utils.disable_all()");
497 #endif
498 
499  BLI_timer_free();
500 
502 
506 
509  wm_dropbox_free();
511 
512  /* all non-screen and non-space stuff editors did, like editmode */
513  if (C) {
514  Main *bmain = CTX_data_main(C);
515  ED_editors_exit(bmain, true);
516  }
517 
519 
520  free_openrecent();
521 
523 
524  /* render code might still access databases */
526  RE_engines_exit();
527 
528  ED_preview_free_dbase(); /* frees a Main dbase, before BKE_blender_free! */
531 
532  if (wm) {
533  /* Before BKE_blender_free! - since the ListBases get freed there. */
534  wm_free_reports(wm);
535  }
536 
537  SEQ_clipboard_free(); /* sequencer.c */
542 
543 #ifdef WITH_COMPOSITOR
545 #endif
546 
547  BKE_subdiv_exit();
548 
549  if (opengl_is_init) {
551  }
552 
553  BKE_blender_free(); /* blender.c, does entire library and spacetypes */
554  // BKE_material_copybuf_free();
555 
556  /* Free the GPU subdivision data after the database to ensure that subdivision structs used by
557  * the modifiers were garbage collected. */
558  if (opengl_is_init) {
559  DRW_subdiv_free();
560  }
561 
568 
569  /* free gizmo-maps after freeing blender,
570  * so no deleted data get accessed during cleaning up of areas. */
574  /* Same for UI-list types. */
576 
577  BLF_exit();
578 
579  BLT_lang_free();
580 
582 
583  // free_txt_data();
584 
585 #ifdef WITH_PYTHON
586  /* option not to close python so we can use 'atexit' */
587  if (do_python && ((C == NULL) || CTX_py_init_get(C))) {
588  /* NOTE: (old note)
589  * before BKE_blender_free so Python's garbage-collection happens while library still exists.
590  * Needed at least for a rare crash that can happen in python-drivers.
591  *
592  * Update for Blender 2.5, move after #BKE_blender_free because Blender now holds references
593  * to #PyObject's so #Py_DECREF'ing them after Python ends causes bad problems every time
594  * the python-driver bug can be fixed if it happens again we can deal with it then. */
595  BPY_python_end();
596  }
597 #else
598  (void)do_python;
599 #endif
600 
601  ED_file_exit(); /* for fsmenu */
602 
603  /* Delete GPU resources and context. The UI also uses GPU resources and so
604  * is also deleted with the context active. */
605  if (opengl_is_init) {
607  UI_exit();
609  GPU_exit();
612  }
613  else {
614  UI_exit();
615  }
616 
618 
619  RNA_exit(); /* should be after BPY_python_end so struct python slots are cleared */
620 
621  wm_ghost_exit();
622 
623  CTX_free(C);
624 
626 
628 
631 
632  /* No need to call this early, rather do it late so that other
633  * pieces of Blender using sound may exit cleanly, see also T50676. */
634  BKE_sound_exit();
635 
636  BKE_appdir_exit();
637  CLG_exit();
638 
640 
642 
644 }
645 
647 {
648  WM_exit_ex(C, true);
649 
650  printf("\nBlender quit\n");
651 
652 #ifdef WIN32
653  /* ask user to press a key when in debug mode */
654  if (G.debug & G_DEBUG) {
655  printf("Press any key to exit . . .\n\n");
656  wait_for_console_key();
657  }
658 #endif
659 
660  exit(G.is_break == true);
661 }
662 
664 {
666 }
void BKE_addon_pref_type_free(void)
Definition: addon.c:121
void BKE_addon_pref_type_init(void)
Definition: addon.c:115
void BKE_appdir_exit(void)
Definition: appdir.c:96
void BKE_tempdir_session_purge(void)
Definition: appdir.c:1159
#define BLENDER_QUIT_FILE
Definition: BKE_appdir.h:177
const char * BKE_tempdir_base(void)
Definition: appdir.c:1154
Blender util stuff.
void BKE_blender_userdef_data_free(struct UserDef *userdef, bool clear_fonts)
Definition: blender.c:278
void BKE_blender_atexit(void)
Definition: blender.c:421
void BKE_blender_free(void)
Definition: blender.c:58
bool BKE_blendfile_userdef_write_all(struct ReportList *reports)
Definition: blendfile.c:748
bool CTX_py_init_get(bContext *C)
Definition: context.c:233
struct wmWindowManager * CTX_wm_manager(const bContext *C)
Definition: context.c:713
void CTX_free(bContext *C)
Definition: context.c:118
void CTX_wm_window_set(bContext *C, struct wmWindow *win)
Definition: context.c:966
struct ReportList * CTX_wm_reports(const bContext *C)
Definition: context.c:775
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1074
struct wmWindow * CTX_wm_window(const bContext *C)
Definition: context.c:723
@ G_FILE_NO_UI
Definition: BKE_global.h:213
@ G_FILE_COMPRESS
Definition: BKE_global.h:210
#define G_MAIN
Definition: BKE_global.h:267
@ G_DEBUG
Definition: BKE_global.h:174
@ G_FLAG_USERPREF_NO_SAVE_ON_EXIT
Definition: BKE_global.h:152
void BKE_icons_init(int first_dyn_id)
Definition: icons.cc:183
void BKE_image_free_unused_gpu_textures(void)
Definition: image_gpu.cc:481
void BKE_keyconfig_pref_type_init(void)
Definition: keyconfig.c:92
void BKE_keyconfig_pref_type_free(void)
Definition: keyconfig.c:98
void BKE_library_callback_remap_editor_id_reference_set(BKE_library_remap_editor_id_reference_cb func)
Definition: lib_remap.c:48
void BKE_library_callback_free_notifier_reference_set(BKE_library_free_notifier_reference_cb func)
Definition: lib_remap.c:41
const char * BKE_main_blendfile_path_from_global(void)
Definition: main.c:562
void BKE_mask_clipboard_free(void)
Definition: mask.c:2049
General operations, lookup, etc. for materials.
void BKE_materials_exit(void)
Definition: material.c:2090
void BKE_material_copybuf_clear(void)
Definition: material.c:1871
void BKE_mball_cubeTable_free(void)
void BKE_node_clipboard_free(void)
Definition: node.cc:3888
void BKE_reports_clear(ReportList *reports)
Definition: report.c:63
void BKE_reports_init(ReportList *reports, int flag)
Definition: report.c:50
struct Depsgraph * BKE_scene_get_depsgraph(const struct Scene *scene, const struct ViewLayer *view_layer)
void BKE_spacedata_callback_id_remap_set(void(*func)(struct ScrArea *area, struct SpaceLink *sl, struct ID *old_id, struct ID *new_id))
void BKE_region_callback_refresh_tag_gizmomap_set(void(*callback)(struct wmGizmoMap *))
Definition: screen.c:575
void BKE_region_callback_free_gizmomap_set(void(*callback)(struct wmGizmoMap *))
Definition: screen.c:600
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)
Definition: studiolight.c:1388
void BKE_subdiv_init(void)
Definition: subdiv.c:32
void BKE_subdiv_exit(void)
Definition: subdiv.c:37
void BKE_tracking_clipboard_free(void)
Definition: tracking.c:448
void BKE_vfont_clipboard_free(void)
Definition: vfont.c:1762
int BLF_init(void)
Definition: blf.c:59
void BLF_exit(void)
Definition: blf.c:70
#define BLI_assert(a)
Definition: BLI_assert.h:46
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
Definition: BLI_listbase.h:269
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:336
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition: listbase.c:466
#define FILE_MAX
void BLI_join_dirfile(char *__restrict dst, size_t maxlen, const char *__restrict dir, const char *__restrict file) ATTR_NONNULL()
Definition: path_util.c:1531
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
Definition: string.c:64
void BLI_task_scheduler_exit(void)
void BLI_threadapi_exit(void)
Definition: threads.cc:130
void BLI_timer_free(void)
Definition: BLI_timer.c:123
#define UNUSED_VARS(...)
#define ELEM(...)
bool BLO_memfile_write_file(struct MemFile *memfile, const char *filepath)
Definition: undofile.c:198
external writefile.c function prototypes.
bool BLO_write_file(struct Main *mainvar, const char *filepath, int write_flags, const struct BlendFileWriteParams *params, struct ReportList *reports)
Definition: writefile.c:1315
void BLT_lang_free(void)
Definition: blt_lang.c:224
void BLT_lang_init(void)
Definition: blt_lang.c:179
void BLT_lang_set(const char *)
Definition: blt_lang.c:238
void BPY_python_reset(struct bContext *C)
void BPY_python_start(struct bContext *C, int argc, const char **argv)
void BPY_python_end(void)
bool BPY_run_string_eval(struct bContext *C, const char *imports[], const char *expr)
void CLG_exit(void)
Definition: clog.c:703
void COM_deinitialize(void)
Deinitialize the compositor caches and allocated memory. Use COM_clear_caches to only free the caches...
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
void DEG_editors_set_update_cb(DEG_EditorUpdateIDCb id_func, DEG_EditorUpdateSceneCb scene_func)
struct Scene * DEG_get_evaluated_scene(const struct Depsgraph *graph)
blenloader genfile private function prototypes
void DNA_sdna_current_free(void)
Definition: dna_genfile.c:572
#define AUDIO_SYNC
@ USER_SPLASH_DISABLE
@ USER_PREF_FLAG_SAVE
void DRW_opengl_context_create(void)
void DRW_subdiv_free(void)
void DRW_opengl_context_disable_ex(bool restore)
void DRW_opengl_context_enable_ex(bool restore)
void DRW_opengl_context_destroy(void)
void ED_assetlist_storage_exit(void)
Definition: asset_list.cc:543
void ED_node_init_butfuncs(void)
Definition: drawnode.cc:1145
void ED_preview_free_dbase(void)
void ED_render_id_flush_update(const struct DEGEditorUpdateContext *update_ctx, struct ID *id)
void ED_render_clear_mtex_copybuf(void)
void ED_preview_restart_queue_free(void)
void ED_render_scene_update(const struct DEGEditorUpdateContext *update_ctx, bool updated)
void ED_screen_exit(struct bContext *C, struct wmWindow *window, struct bScreen *screen)
Definition: screen_edit.c:736
void ED_file_exit(void)
Definition: space_file.c:1099
void ED_spacetypes_init(void)
Definition: spacetypes.c:60
void ED_spacemacros_init(void)
Definition: spacetypes.c:147
void ED_file_init(void)
Definition: space_file.c:1088
struct MemFile * ED_undosys_stack_memfile_get_active(struct UndoStack *ustack)
Definition: memfile_undo.c:343
void ED_undosys_type_free(void)
void ED_undosys_type_init(void)
void ED_editors_exit(struct Main *bmain, bool do_undo_system)
Definition: ed_util.c:213
bool ED_editors_flush_edits(struct Main *bmain)
Definition: ed_util.c:325
void ED_spacedata_id_remap_single(struct ScrArea *area, struct SpaceLink *sl, struct ID *old_id, struct ID *new_id)
Definition: ed_util.c:462
GHOST C-API function and type declarations.
bool GHOST_setConsoleWindowState(GHOST_TConsoleWindowState action)
GHOST_TSuccess GHOST_DisposeSystemPaths(void)
GHOST_TSuccess GHOST_CreateSystemPaths(void)
@ GHOST_kConsoleWindowStateShow
Definition: GHOST_Types.h:141
@ GHOST_kConsoleWindowStateHideForNonConsoleLaunch
Definition: GHOST_Types.h:143
void GPU_render_begin(void)
Definition: gpu_context.cc:190
void GPU_context_begin_frame(GPUContext *ctx)
Definition: gpu_context.cc:147
GPUContext * GPU_context_active_get(void)
Definition: gpu_context.cc:142
void GPU_context_end_frame(GPUContext *ctx)
Definition: gpu_context.cc:155
bool GPU_backend_supported(void)
Definition: gpu_context.cc:218
void GPU_render_end(void)
Definition: gpu_context.cc:196
void GPU_init(void)
Definition: gpu_init_exit.c:24
void GPU_exit(void)
Definition: gpu_init_exit.c:45
void GPU_pass_cache_free(void)
Definition: gpu_codegen.cc:789
void GPU_pass_cache_init(void)
Definition: gpu_codegen.cc:784
void IMB_thumb_clear_translations(void)
Definition: thumbs_font.c:30
Read Guarded memory(de)allocation.
#define C
Definition: RandGen.cpp:25
void UI_init(void)
Definition: interface.cc:6771
void UI_interface_tag_script_reload(void)
Definition: interface.cc:6793
void UI_exit(void)
Definition: interface.cc:6787
@ BIFICONID_LAST
Definition: UI_resources.h:21
struct CLG_LogRef * WM_LOG_TOOLS
struct CLG_LogRef * WM_LOG_MSGBUS_SUB
struct CLG_LogRef * WM_LOG_EVENTS
struct CLG_LogRef * WM_LOG_HANDLERS
struct CLG_LogRef * WM_LOG_KEYMAPS
struct CLG_LogRef * WM_LOG_MSGBUS_PUB
@ WM_OP_INVOKE_DEFAULT
Definition: WM_types.h:201
struct CLG_LogRef * WM_LOG_OPERATORS
#define WM_UI_HANDLER_BREAK
Definition: WM_types.h:299
unsigned int U
Definition: btGjkEpa3.h:78
void SEQ_clipboard_free(void)
Definition: clipboard.c:52
double time
Scene scene
const Depsgraph * depsgraph
SyclQueue void void size_t num_bytes void
void ANIM_driver_vars_copybuf_free(void)
Definition: drivers.c:692
void ANIM_drivers_copybuf_free(void)
Definition: drivers.c:571
void ED_gpencil_anim_copybuf_free(void)
void RE_engines_exit(void)
Definition: engine.c:69
void ANIM_fmodifiers_copybuf_free(void)
Definition: fmodifier_ui.c:954
void ED_gpencil_strokes_copybuf_free(void)
ccl_global float * buffer
void ANIM_fcurves_copybuf_free(void)
void ANIM_keyingset_infos_exit(void)
Definition: keyingsets.c:613
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
#define G(x, y, z)
void RE_FreeAllRender(void)
Definition: pipeline.c:614
void RNA_exit(void)
Definition: rna_access.c:89
void * first
Definition: DNA_listBase.h:31
Definition: BKE_main.h:121
ListBase wm
Definition: BKE_main.h:197
struct AudioData audio
struct ReportList reports
struct UndoStack * undo_stack
void wm_init_cursor_data(void)
Definition: wm_cursors.c:396
void wm_dropbox_free(void)
Definition: wm_dragdrop.cc:121
wmEventHandler_UI * WM_event_add_ui_handler(const bContext *C, ListBase *handlers, wmUIHandlerFunc handle_fn, wmUIHandlerRemoveFunc remove_fn, void *user_data, const char flag)
void WM_main_remap_editor_id_reference(const 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.c:3486
void wm_homefile_read_ex(bContext *C, const struct wmHomeFileRead_Params *params_homefile, ReportList *reports, struct wmFileReadPost_Params **r_params_file_read_post)
Definition: wm_files.c:1048
void wm_autosave_delete(void)
Definition: wm_files.c:2013
const char * WM_init_state_app_template_get(void)
Definition: wm_files.c:1037
void wm_homefile_read_post(struct bContext *C, const struct wmFileReadPost_Params *params_file_read_post)
Definition: wm_files.c:1378
void wm_history_file_read(void)
Definition: wm_files.c:1391
void wm_gizmogrouptype_free(void)
void wm_gizmogrouptype_init(void)
void wm_gizmomaptypes_free(void)
void WM_gizmomap_tag_refresh(wmGizmoMap *gzmap)
Definition: wm_gizmo_map.c:308
void wm_gizmomap_remove(wmGizmoMap *gzmap)
Definition: wm_gizmo_map.c:188
void wm_gizmotype_init(void)
void wm_gizmotype_free(void)
static void wm_init_reports(bContext *C)
Definition: wm_init_exit.c:133
void WM_init_splash(bContext *C)
Definition: wm_init_exit.c:366
void WM_exit_ex(bContext *C, const bool do_python)
Definition: wm_init_exit.c:434
CLG_LOGREF_DECLARE_GLOBAL(WM_LOG_OPERATORS, "wm.operator")
static void wm_free_reports(wmWindowManager *wm)
Definition: wm_init_exit.c:141
static int wm_exit_handler(bContext *C, const wmEvent *event, void *userdata)
Definition: wm_init_exit.c:413
static bool opengl_is_init
Definition: wm_init_exit.c:160
void WM_exit(bContext *C)
Main exit function to close Blender ordinarily.
Definition: wm_init_exit.c:646
static void free_openrecent(void)
Definition: wm_init_exit.c:381
void WM_script_tag_reload(void)
Definition: wm_init_exit.c:663
void WM_init_opengl(void)
Definition: wm_init_exit.c:162
void WM_init(bContext *C, int argc, const char **argv)
Definition: wm_init_exit.c:212
static bool wm_start_with_console
Definition: wm_init_exit.c:146
void wm_exit_schedule_delayed(const bContext *C)
Definition: wm_init_exit.c:421
void WM_init_state_start_with_console_set(bool value)
Definition: wm_init_exit.c:148
static void sound_jack_sync_callback(Main *bmain, int mode, double time)
Definition: wm_init_exit.c:186
void WM_jobs_kill_all(wmWindowManager *wm)
Definition: wm_jobs.c:551
void WM_menutype_free(void)
Definition: wm_menu_type.c:72
void WM_menutype_init(void)
Definition: wm_menu_type.c:66
void WM_msgbus_types_init(void)
void wm_operatortype_free(void)
void wm_operatortype_init(void)
void wm_operatortypes_register(void)
void WM_paneltype_init(void)
Definition: wm_panel_type.c:58
void WM_paneltype_clear(void)
Definition: wm_panel_type.c:64
bool WM_platform_support_perform_checks()
void wm_surfaces_free(void)
Definition: wm_surface.c:117
void WM_uilisttype_free(void)
void WM_uilisttype_init(void)
void wm_ghost_exit(void)
Definition: wm_window.c:1600
bScreen * WM_window_get_active_screen(const wmWindow *win)
Definition: wm_window.c:2300
ViewLayer * WM_window_get_active_view_layer(const wmWindow *win)
Definition: wm_window.c:2217
void wm_ghost_init(bContext *C)
Definition: wm_window.c:1566
Scene * WM_window_get_active_scene(const wmWindow *win)
Definition: wm_window.c:2183