Blender V4.5
BKE_global.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4#pragma once
5
13
14#include <optional>
15
16#include "DNA_listBase.h"
17
18struct Main;
19
27struct Global {
28
36
42
44 char filepath_last_image[/*FILE_MAX*/ 1024];
46 char filepath_last_library[/*FILE_MAX*/ 1024];
52 char filepath_last_blend[/*FILE_MAX*/ 1024];
53
59
65
74
81 bool quiet;
82
89
94 short moving;
95
98
122
129 int f;
130
138 std::optional<bool> autoexec_override;
139
140 struct {
145 int level;
150 void *file;
152
158 int debug;
159
168
176
185 char autoexec_fail[200];
186
193
199
201};
202
203/* **************** GLOBAL ********************* */
204
206enum {
208 G_FLAG_PICKSEL = (1 << 2),
212
222
223 /* NOTE: storing both online/offline override is needed so changing the preference
224 * can be disabled when launching Blender with `--offline-mode`.
225 * This means that users in a controlled environment can launch
226 * in offline-mode and the option can't be changed afterwards. */
227
232
236
240
241};
242
243#define G_FLAG_INTERNET_OVERRIDE_PREF_ANY \
244 (G_FLAG_INTERNET_OVERRIDE_PREF_ONLINE | G_FLAG_INTERNET_OVERRIDE_PREF_OFFLINE)
245
247#define G_FLAG_ALL_RUNTIME \
248 (G_FLAG_SCRIPT_AUTOEXEC | G_FLAG_INTERNET_ALLOW | G_FLAG_INTERNET_OVERRIDE_PREF_ONLINE | \
249 G_FLAG_INTERNET_OVERRIDE_PREF_OFFLINE | G_FLAG_EVENT_SIMULATE | \
250 G_FLAG_USERPREF_NO_SAVE_ON_EXIT | G_FLAG_GPU_BACKEND_FALLBACK | \
251 G_FLAG_GPU_BACKEND_FALLBACK_QUIET | \
252\
253 /* #BPY_python_reset is responsible for resetting these flags on file load. */ \
254 G_FLAG_SCRIPT_AUTOEXEC_FAIL | G_FLAG_SCRIPT_AUTOEXEC_FAIL_QUIET)
255
257#define G_FLAG_ALL_READFILE 0
258
260enum {
261 G_DEBUG = (1 << 0), /* general debug flag, print more info in unexpected cases */
262 G_DEBUG_FFMPEG = (1 << 1),
263 G_DEBUG_PYTHON = (1 << 2), /* extra python info */
264 G_DEBUG_EVENTS = (1 << 3), /* input/window/screen events */
265 G_DEBUG_HANDLERS = (1 << 4), /* events handling */
266 G_DEBUG_WM = (1 << 5), /* operator, undo */
267 G_DEBUG_JOBS = (1 << 6), /* jobs time profiling */
268 G_DEBUG_FREESTYLE = (1 << 7), /* freestyle messages */
269 G_DEBUG_DEPSGRAPH_BUILD = (1 << 8), /* depsgraph construction messages */
270 G_DEBUG_DEPSGRAPH_EVAL = (1 << 9), /* depsgraph evaluation messages */
271 G_DEBUG_DEPSGRAPH_TAG = (1 << 10), /* depsgraph tagging messages */
272 G_DEBUG_DEPSGRAPH_TIME = (1 << 11), /* depsgraph timing statistics and messages */
273 G_DEBUG_DEPSGRAPH_NO_THREADS = (1 << 12), /* single threaded depsgraph */
274 G_DEBUG_DEPSGRAPH_PRETTY = (1 << 13), /* use pretty colors in depsgraph messages */
275 G_DEBUG_DEPSGRAPH_UID = (1 << 14), /* Verify validness of session-wide identifiers
276 * assigned to ID datablocks */
279 G_DEBUG_SIMDATA = (1 << 15), /* sim debug data display */
280 G_DEBUG_GPU = (1 << 16), /* gpu debug */
281 G_DEBUG_IO = (1 << 17), /* IO Debugging (for Collada, ...). */
282 G_DEBUG_GPU_FORCE_WORKAROUNDS = (1 << 18), /* Force GPU workarounds bypassing detection. */
283 G_DEBUG_GPU_FORCE_VULKAN_LOCAL_READ = (1 << 19), /* Force GPU dynamic rendering local read. */
284 G_DEBUG_GPU_COMPILE_SHADERS = (1 << 20), /* Compile all statically defined shaders. . */
285 G_DEBUG_GPU_RENDERDOC = (1 << 21), /* Enable RenderDoc integration. */
286 G_DEBUG_XR = (1 << 22), /* XR/OpenXR messages */
287 G_DEBUG_XR_TIME = (1 << 23), /* XR/OpenXR timing messages */
288
289 G_DEBUG_GHOST = (1 << 24), /* Debug GHOST module. */
290 G_DEBUG_WINTAB = (1 << 25), /* Debug Wintab. */
291};
292
293#define G_DEBUG_ALL \
294 (G_DEBUG | G_DEBUG_FFMPEG | G_DEBUG_PYTHON | G_DEBUG_EVENTS | G_DEBUG_WM | G_DEBUG_JOBS | \
295 G_DEBUG_FREESTYLE | G_DEBUG_DEPSGRAPH | G_DEBUG_IO | G_DEBUG_GHOST | G_DEBUG_WINTAB)
296
298enum {
299 G_FILE_AUTOPACK = (1 << 0),
300 G_FILE_COMPRESS = (1 << 1),
301
311
319
320 // G_FILE_DEPRECATED_9 = (1 << 9),
321 G_FILE_NO_UI = (1 << 10),
322
323 /* Bits 11 to 22 (inclusive) are deprecated & need to be cleared */
324
343 // #define G_FILE_MESH_COMPAT (1 << 26)
344 // #define G_FILE_GLSL_NO_ENV_LIGHTING (1 << 28) /* deprecated */
351};
352
357#define G_FILE_FLAG_ALL_RUNTIME \
358 (G_BACKGROUND_NO_DEPSGRAPH | G_LIBOVERRIDE_NO_AUTO_RESYNC | G_FILE_NO_UI | \
359 G_FILE_RECOVER_READ | G_FILE_RECOVER_WRITE)
360
362enum {
363 G_TRANSFORM_OBJ = (1 << 0),
365 G_TRANSFORM_SEQ = (1 << 2),
373 G_TRANSFORM_WM = (1 << 4),
380};
381
383extern Global G;
384
389#define G_MAIN (G).main
@ G_FILE_ASSET_EDIT_FILE
@ G_BACKGROUND_NO_DEPSGRAPH
@ G_FILE_RECOVER_READ
@ G_LIBOVERRIDE_NO_AUTO_RESYNC
@ G_FILE_AUTOPACK
@ G_FILE_RECOVER_WRITE
@ G_FILE_NO_UI
@ G_FILE_COMPRESS
@ G_FLAG_INTERNET_OVERRIDE_PREF_ONLINE
@ G_FLAG_EVENT_SIMULATE
@ G_FLAG_SCRIPT_AUTOEXEC_FAIL_QUIET
@ G_FLAG_INTERNET_OVERRIDE_PREF_OFFLINE
@ G_FLAG_RENDER_VIEWPORT
@ G_FLAG_GPU_BACKEND_FALLBACK_QUIET
@ G_FLAG_USERPREF_NO_SAVE_ON_EXIT
@ G_FLAG_SCRIPT_AUTOEXEC_FAIL
@ G_FLAG_GPU_BACKEND_FALLBACK
@ G_FLAG_PICKSEL
@ G_FLAG_SCRIPT_AUTOEXEC
@ G_FLAG_INTERNET_ALLOW
@ G_DEBUG_DEPSGRAPH_UID
@ G_DEBUG
@ G_DEBUG_GPU
@ G_DEBUG_GHOST
@ G_DEBUG_XR
@ G_DEBUG_HANDLERS
@ G_DEBUG_FREESTYLE
@ G_DEBUG_IO
@ G_DEBUG_JOBS
@ G_DEBUG_GPU_FORCE_WORKAROUNDS
@ G_DEBUG_SIMDATA
@ G_DEBUG_FFMPEG
@ G_DEBUG_DEPSGRAPH_PRETTY
@ G_DEBUG_XR_TIME
@ G_DEBUG_WINTAB
@ G_DEBUG_DEPSGRAPH_TIME
@ G_DEBUG_DEPSGRAPH
@ G_DEBUG_DEPSGRAPH_EVAL
@ G_DEBUG_GPU_FORCE_VULKAN_LOCAL_READ
@ G_DEBUG_GPU_RENDERDOC
@ G_DEBUG_DEPSGRAPH_NO_THREADS
@ G_DEBUG_GPU_COMPILE_SHADERS
@ G_DEBUG_DEPSGRAPH_TAG
@ G_DEBUG_WM
@ G_DEBUG_EVENTS
@ G_DEBUG_PYTHON
@ G_DEBUG_DEPSGRAPH_BUILD
@ G_TRANSFORM_OBJ
@ G_TRANSFORM_CURSOR
@ G_TRANSFORM_SEQ
@ G_TRANSFORM_EDIT
@ G_TRANSFORM_FCURVES
@ G_TRANSFORM_WM
These structs are the foundation for all linked lists in the library system.
#define log
#define G(x, y, z)
char gpu_debug_scope_name[200]
const char * opengl_deprecation_usage_filename
char filepath_last_image[1024]
Definition BKE_global.hh:44
bool background
Definition BKE_global.hh:73
int debug
short moving
Definition BKE_global.hh:94
bool opengl_deprecation_usage_detected
bool profile_gpu
int opengl_deprecation_usage_lineno
bool is_rendering
Definition BKE_global.hh:97
Main * main
Definition BKE_global.hh:35
std::optional< bool > autoexec_override
char filepath_last_library[1024]
Definition BKE_global.hh:46
char filepath_last_blend[1024]
Definition BKE_global.hh:52
bool quiet
Definition BKE_global.hh:81
short debug_value
ListBase recent_files
Definition BKE_global.hh:58
bool randomize_geometry_element_order
int fileflags
bool factory_startup
Definition BKE_global.hh:88
char autoexec_fail[200]
bool is_break
Definition BKE_global.hh:64
Main * pr_main
Definition BKE_global.hh:41