Blender V5.0
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 "DNA_listBase.h"
15
16struct Main;
17
25struct Global {
26
34
40
42 char filepath_last_image[/*FILE_MAX*/ 1024];
44 char filepath_last_library[/*FILE_MAX*/ 1024];
50 char filepath_last_blend[/*FILE_MAX*/ 1024];
51
57
63
72
79
84 short moving;
85
88
113
120 int f;
121
122 struct {
127 int level;
132 void *file;
134
140 int debug;
141
150
158
167 char autoexec_fail[200];
168
174
176};
177
178/* **************** GLOBAL ********************* */
179
181enum {
183 G_FLAG_PICKSEL = (1 << 2),
187
197
198 /* NOTE: storing both online/offline override is needed so changing the preference
199 * can be disabled when launching Blender with `--offline-mode`.
200 * This means that users in a controlled environment can launch
201 * in offline-mode and the option can't be changed afterwards. */
202
207
213
217
218};
219
220#define G_FLAG_INTERNET_OVERRIDE_PREF_ANY \
221 (G_FLAG_INTERNET_OVERRIDE_PREF_ONLINE | G_FLAG_INTERNET_OVERRIDE_PREF_OFFLINE)
222
224#define G_FLAG_ALL_RUNTIME \
225 (G_FLAG_SCRIPT_AUTOEXEC | G_FLAG_SCRIPT_OVERRIDE_PREF | G_FLAG_INTERNET_ALLOW | \
226 G_FLAG_INTERNET_OVERRIDE_PREF_ONLINE | G_FLAG_INTERNET_OVERRIDE_PREF_OFFLINE | \
227 G_FLAG_EVENT_SIMULATE | G_FLAG_USERPREF_NO_SAVE_ON_EXIT | G_FLAG_GPU_BACKEND_FALLBACK | \
228 G_FLAG_GPU_BACKEND_FALLBACK_QUIET | \
229\
230 /* #BPY_python_reset is responsible for resetting these flags on file load. */ \
231 G_FLAG_SCRIPT_AUTOEXEC_FAIL | G_FLAG_SCRIPT_AUTOEXEC_FAIL_QUIET)
232
234#define G_FLAG_ALL_READFILE 0
235
237enum {
238 G_DEBUG = (1 << 0), /* general debug flag, print more info in unexpected cases */
239 G_DEBUG_PYTHON = (1 << 2), /* extra python info */
240 G_DEBUG_EVENTS = (1 << 3), /* input/window/screen events */
241 G_DEBUG_HANDLERS = (1 << 4), /* events handling */
242 G_DEBUG_WM = (1 << 5), /* operator, undo */
243 G_DEBUG_JOBS = (1 << 6), /* jobs time profiling */
244 G_DEBUG_FREESTYLE = (1 << 7), /* freestyle messages */
245 G_DEBUG_DEPSGRAPH_BUILD = (1 << 8), /* depsgraph construction messages */
246 G_DEBUG_DEPSGRAPH_EVAL = (1 << 9), /* depsgraph evaluation messages */
247 G_DEBUG_DEPSGRAPH_TAG = (1 << 10), /* depsgraph tagging messages */
248 G_DEBUG_DEPSGRAPH_TIME = (1 << 11), /* depsgraph timing statistics and messages */
249 G_DEBUG_DEPSGRAPH_NO_THREADS = (1 << 12), /* single threaded depsgraph */
250 G_DEBUG_DEPSGRAPH_PRETTY = (1 << 13), /* use pretty colors in depsgraph messages */
251 G_DEBUG_DEPSGRAPH_UID = (1 << 14), /* Verify validness of session-wide identifiers
252 * assigned to ID datablocks */
255 G_DEBUG_SIMDATA = (1 << 15), /* sim debug data display */
256 G_DEBUG_GPU = (1 << 16), /* gpu debug */
257 G_DEBUG_IO = (1 << 17), /* IO Debugging. */
258 G_DEBUG_GPU_FORCE_WORKAROUNDS = (1 << 18), /* Force GPU workarounds bypassing detection. */
259 G_DEBUG_GPU_FORCE_VULKAN_LOCAL_READ = (1 << 19), /* Force GPU dynamic rendering local read. */
260 G_DEBUG_GPU_COMPILE_SHADERS = (1 << 20), /* Compile all statically defined shaders. . */
261 G_DEBUG_GPU_RENDERDOC = (1 << 21), /* Enable RenderDoc integration. */
262 G_DEBUG_GPU_SHADER_DEBUG_INFO = (1 << 22), /* Enable the generation of shader debug info. */
263 G_DEBUG_XR = (1 << 23), /* XR/OpenXR messages */
264 G_DEBUG_XR_TIME = (1 << 24), /* XR/OpenXR timing messages */
265
266 G_DEBUG_GHOST = (1 << 25), /* Debug GHOST module. */
267 G_DEBUG_WINTAB = (1 << 26), /* Debug Wintab. */
268};
269
270#define G_DEBUG_ALL \
271 (G_DEBUG | G_DEBUG_PYTHON | G_DEBUG_EVENTS | G_DEBUG_WM | G_DEBUG_JOBS | G_DEBUG_FREESTYLE | \
272 G_DEBUG_DEPSGRAPH | G_DEBUG_IO | G_DEBUG_GHOST | G_DEBUG_WINTAB)
273
275enum {
276 G_FILE_AUTOPACK = (1 << 0),
277 G_FILE_COMPRESS = (1 << 1),
278
288
296
297 // G_FILE_DEPRECATED_9 = (1 << 9),
298 G_FILE_NO_UI = (1 << 10),
299
300 /* Bits 11 to 22 (inclusive) are deprecated & need to be cleared */
301
320 // #define G_FILE_MESH_COMPAT (1 << 26)
321 // #define G_FILE_GLSL_NO_ENV_LIGHTING (1 << 28) /* deprecated */
328};
329
334#define G_FILE_FLAG_ALL_RUNTIME \
335 (G_BACKGROUND_NO_DEPSGRAPH | G_LIBOVERRIDE_NO_AUTO_RESYNC | G_FILE_NO_UI | \
336 G_FILE_RECOVER_READ | G_FILE_RECOVER_WRITE)
337
339enum {
340 G_TRANSFORM_OBJ = (1 << 0),
342 G_TRANSFORM_SEQ = (1 << 2),
350 G_TRANSFORM_WM = (1 << 4),
357};
358
360extern Global G;
361
366#define G_MAIN (G).main
@ G_FLAG_INTERNET_OVERRIDE_PREF_ONLINE
@ G_FLAG_SCRIPT_OVERRIDE_PREF
@ 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_GPU_SHADER_DEBUG_INFO
@ G_DEBUG_SIMDATA
@ 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
@ 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
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]
void * file
char filepath_last_image[1024]
Definition BKE_global.hh:42
bool background
Definition BKE_global.hh:71
int debug
short moving
Definition BKE_global.hh:84
bool profile_gpu
int level
bool is_rendering
Definition BKE_global.hh:87
Main * main
Definition BKE_global.hh:33
char filepath_last_library[1024]
Definition BKE_global.hh:44
char filepath_last_blend[1024]
Definition BKE_global.hh:50
short debug_value
ListBase recent_files
Definition BKE_global.hh:56
bool randomize_geometry_element_order
int fileflags
bool factory_startup
Definition BKE_global.hh:78
char autoexec_fail[200]
bool is_break
Definition BKE_global.hh:62
Main * pr_main
Definition BKE_global.hh:39