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 "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 bool quiet;
80
87
92 short moving;
93
96
120
127 int f;
128
129 struct {
134 int level;
139 void *file;
141
147 int debug;
148
157
165
174 char autoexec_fail[200];
175
182
188
190};
191
192/* **************** GLOBAL ********************* */
193
195enum {
197 G_FLAG_PICKSEL = (1 << 2),
201
211
212 /* NOTE: storing both online/offline override is needed so changing the preference
213 * can be disabled when launching Blender with `--offline-mode`.
214 * This means that users in a controlled environment can launch
215 * in offline-mode and the option can't be changed afterwards. */
216
221
227
231
232};
233
234#define G_FLAG_INTERNET_OVERRIDE_PREF_ANY \
235 (G_FLAG_INTERNET_OVERRIDE_PREF_ONLINE | G_FLAG_INTERNET_OVERRIDE_PREF_OFFLINE)
236
238#define G_FLAG_ALL_RUNTIME \
239 (G_FLAG_SCRIPT_AUTOEXEC | G_FLAG_SCRIPT_OVERRIDE_PREF | G_FLAG_INTERNET_ALLOW | \
240 G_FLAG_INTERNET_OVERRIDE_PREF_ONLINE | G_FLAG_INTERNET_OVERRIDE_PREF_OFFLINE | \
241 G_FLAG_EVENT_SIMULATE | G_FLAG_USERPREF_NO_SAVE_ON_EXIT | G_FLAG_GPU_BACKEND_FALLBACK | \
242 G_FLAG_GPU_BACKEND_FALLBACK_QUIET | \
243\
244 /* #BPY_python_reset is responsible for resetting these flags on file load. */ \
245 G_FLAG_SCRIPT_AUTOEXEC_FAIL | G_FLAG_SCRIPT_AUTOEXEC_FAIL_QUIET)
246
248#define G_FLAG_ALL_READFILE 0
249
251enum {
252 G_DEBUG = (1 << 0), /* general debug flag, print more info in unexpected cases */
253 G_DEBUG_FFMPEG = (1 << 1),
254 G_DEBUG_PYTHON = (1 << 2), /* extra python info */
255 G_DEBUG_EVENTS = (1 << 3), /* input/window/screen events */
256 G_DEBUG_HANDLERS = (1 << 4), /* events handling */
257 G_DEBUG_WM = (1 << 5), /* operator, undo */
258 G_DEBUG_JOBS = (1 << 6), /* jobs time profiling */
259 G_DEBUG_FREESTYLE = (1 << 7), /* freestyle messages */
260 G_DEBUG_DEPSGRAPH_BUILD = (1 << 8), /* depsgraph construction messages */
261 G_DEBUG_DEPSGRAPH_EVAL = (1 << 9), /* depsgraph evaluation messages */
262 G_DEBUG_DEPSGRAPH_TAG = (1 << 10), /* depsgraph tagging messages */
263 G_DEBUG_DEPSGRAPH_TIME = (1 << 11), /* depsgraph timing statistics and messages */
264 G_DEBUG_DEPSGRAPH_NO_THREADS = (1 << 12), /* single threaded depsgraph */
265 G_DEBUG_DEPSGRAPH_PRETTY = (1 << 13), /* use pretty colors in depsgraph messages */
266 G_DEBUG_DEPSGRAPH_UID = (1 << 14), /* Verify validness of session-wide identifiers
267 * assigned to ID datablocks */
270 G_DEBUG_SIMDATA = (1 << 15), /* sim debug data display */
271 G_DEBUG_GPU = (1 << 16), /* gpu debug */
272 G_DEBUG_IO = (1 << 17), /* IO Debugging (for Collada, ...). */
273 G_DEBUG_GPU_FORCE_WORKAROUNDS = (1 << 18), /* Force GPU workarounds bypassing detection. */
274 G_DEBUG_GPU_FORCE_VULKAN_LOCAL_READ = (1 << 19), /* Force GPU dynamic rendering local read. */
275 G_DEBUG_GPU_COMPILE_SHADERS = (1 << 20), /* Compile all statically defined shaders. . */
276 G_DEBUG_GPU_RENDERDOC = (1 << 21), /* Enable RenderDoc integration. */
277 G_DEBUG_XR = (1 << 22), /* XR/OpenXR messages */
278 G_DEBUG_XR_TIME = (1 << 23), /* XR/OpenXR timing messages */
279
280 G_DEBUG_GHOST = (1 << 24), /* Debug GHOST module. */
281 G_DEBUG_WINTAB = (1 << 25), /* Debug Wintab. */
282};
283
284#define G_DEBUG_ALL \
285 (G_DEBUG | G_DEBUG_FFMPEG | G_DEBUG_PYTHON | G_DEBUG_EVENTS | G_DEBUG_WM | G_DEBUG_JOBS | \
286 G_DEBUG_FREESTYLE | G_DEBUG_DEPSGRAPH | G_DEBUG_IO | G_DEBUG_GHOST | G_DEBUG_WINTAB)
287
289enum {
290 G_FILE_AUTOPACK = (1 << 0),
291 G_FILE_COMPRESS = (1 << 1),
292
302
310
311 // G_FILE_DEPRECATED_9 = (1 << 9),
312 G_FILE_NO_UI = (1 << 10),
313
314 /* Bits 11 to 22 (inclusive) are deprecated & need to be cleared */
315
334 // #define G_FILE_MESH_COMPAT (1 << 26)
335 // #define G_FILE_GLSL_NO_ENV_LIGHTING (1 << 28) /* deprecated */
342};
343
348#define G_FILE_FLAG_ALL_RUNTIME \
349 (G_BACKGROUND_NO_DEPSGRAPH | G_LIBOVERRIDE_NO_AUTO_RESYNC | G_FILE_NO_UI | \
350 G_FILE_RECOVER_READ | G_FILE_RECOVER_WRITE)
351
353enum {
354 G_TRANSFORM_OBJ = (1 << 0),
356 G_TRANSFORM_SEQ = (1 << 2),
364 G_TRANSFORM_WM = (1 << 4),
371};
372
374extern Global G;
375
380#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_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_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
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:92
bool opengl_deprecation_usage_detected
bool profile_gpu
int opengl_deprecation_usage_lineno
int level
bool is_rendering
Definition BKE_global.hh:95
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
bool quiet
Definition BKE_global.hh:79
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:86
char autoexec_fail[200]
bool is_break
Definition BKE_global.hh:62
Main * pr_main
Definition BKE_global.hh:39