Blender V4.3
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
14#include "BLI_utildefines.h"
15#include "DNA_listBase.h"
16
17struct Main;
18
26struct Global {
27
35
41
43 char filepath_last_image[/*FILE_MAX*/ 1024];
45 char filepath_last_library[/*FILE_MAX*/ 1024];
46
52
58
67
74 bool quiet;
75
82
87 short moving;
88
91
114
121 int f;
122
123 struct {
128 int level;
133 void *file;
135
141 int debug;
142
151
159
168 char autoexec_fail[200];
169
176
182};
183
184/* **************** GLOBAL ********************* */
185
187enum {
189 G_FLAG_PICKSEL = (1 << 2),
193
203
204 /* NOTE: storing both online/offline override is needed so changing the preference
205 * can be disabled when launching Blender with `--offline-mode`.
206 * This means that users in a controlled environment can launch
207 * in offline-mode and the option can't be changed afterwards. */
208
213
219
223
224};
225
226#define G_FLAG_INTERNET_OVERRIDE_PREF_ANY \
227 (G_FLAG_INTERNET_OVERRIDE_PREF_ONLINE | G_FLAG_INTERNET_OVERRIDE_PREF_OFFLINE)
228
230#define G_FLAG_ALL_RUNTIME \
231 (G_FLAG_SCRIPT_AUTOEXEC | G_FLAG_SCRIPT_OVERRIDE_PREF | G_FLAG_INTERNET_ALLOW | \
232 G_FLAG_INTERNET_OVERRIDE_PREF_ONLINE | G_FLAG_INTERNET_OVERRIDE_PREF_OFFLINE | \
233 G_FLAG_EVENT_SIMULATE | G_FLAG_USERPREF_NO_SAVE_ON_EXIT | G_FLAG_GPU_BACKEND_FALLBACK | \
234 G_FLAG_GPU_BACKEND_FALLBACK_QUIET | \
235\
236 /* #BPY_python_reset is responsible for resetting these flags on file load. */ \
237 G_FLAG_SCRIPT_AUTOEXEC_FAIL | G_FLAG_SCRIPT_AUTOEXEC_FAIL_QUIET)
238
240#define G_FLAG_ALL_READFILE 0
241
243enum {
244 G_DEBUG = (1 << 0), /* general debug flag, print more info in unexpected cases */
245 G_DEBUG_FFMPEG = (1 << 1),
246 G_DEBUG_PYTHON = (1 << 2), /* extra python info */
247 G_DEBUG_EVENTS = (1 << 3), /* input/window/screen events */
248 G_DEBUG_HANDLERS = (1 << 4), /* events handling */
249 G_DEBUG_WM = (1 << 5), /* operator, undo */
250 G_DEBUG_JOBS = (1 << 6), /* jobs time profiling */
251 G_DEBUG_FREESTYLE = (1 << 7), /* freestyle messages */
252 G_DEBUG_DEPSGRAPH_BUILD = (1 << 8), /* depsgraph construction messages */
253 G_DEBUG_DEPSGRAPH_EVAL = (1 << 9), /* depsgraph evaluation messages */
254 G_DEBUG_DEPSGRAPH_TAG = (1 << 10), /* depsgraph tagging messages */
255 G_DEBUG_DEPSGRAPH_TIME = (1 << 11), /* depsgraph timing statistics and messages */
256 G_DEBUG_DEPSGRAPH_NO_THREADS = (1 << 12), /* single threaded depsgraph */
257 G_DEBUG_DEPSGRAPH_PRETTY = (1 << 13), /* use pretty colors in depsgraph messages */
258 G_DEBUG_DEPSGRAPH_UID = (1 << 14), /* Verify validness of session-wide identifiers
259 * assigned to ID datablocks */
262 G_DEBUG_SIMDATA = (1 << 15), /* sim debug data display */
263 G_DEBUG_GPU = (1 << 16), /* gpu debug */
264 G_DEBUG_IO = (1 << 17), /* IO Debugging (for Collada, ...). */
265 G_DEBUG_GPU_FORCE_WORKAROUNDS = (1 << 18), /* force gpu workarounds bypassing detections. */
266 G_DEBUG_GPU_COMPILE_SHADERS = (1 << 19), /* Compile all statically defined shaders. . */
267 G_DEBUG_GPU_RENDERDOC = (1 << 20), /* Enable RenderDoc integration. */
268 G_DEBUG_XR = (1 << 21), /* XR/OpenXR messages */
269 G_DEBUG_XR_TIME = (1 << 22), /* XR/OpenXR timing messages */
270
271 G_DEBUG_GHOST = (1 << 23), /* Debug GHOST module. */
272 G_DEBUG_WINTAB = (1 << 24), /* Debug Wintab. */
273};
274
275#define G_DEBUG_ALL \
276 (G_DEBUG | G_DEBUG_FFMPEG | G_DEBUG_PYTHON | G_DEBUG_EVENTS | G_DEBUG_WM | G_DEBUG_JOBS | \
277 G_DEBUG_FREESTYLE | G_DEBUG_DEPSGRAPH | G_DEBUG_IO | G_DEBUG_GHOST | G_DEBUG_WINTAB)
278
280enum {
281 G_FILE_AUTOPACK = (1 << 0),
282 G_FILE_COMPRESS = (1 << 1),
283
284 // G_FILE_DEPRECATED_9 = (1 << 9),
285 G_FILE_NO_UI = (1 << 10),
286
287 /* Bits 11 to 22 (inclusive) are deprecated & need to be cleared */
288
307 // #define G_FILE_MESH_COMPAT (1 << 26)
308 // #define G_FILE_GLSL_NO_ENV_LIGHTING (1 << 28) /* deprecated */
315};
316
321#define G_FILE_FLAG_ALL_RUNTIME (G_FILE_NO_UI | G_FILE_RECOVER_READ | G_FILE_RECOVER_WRITE)
322
324enum {
325 G_TRANSFORM_OBJ = (1 << 0),
327 G_TRANSFORM_SEQ = (1 << 2),
335 G_TRANSFORM_WM = (1 << 4),
342};
343
345extern Global G;
346
351#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_FILE_ASSET_EDIT_FILE
@ G_FILE_RECOVER_READ
@ G_FILE_AUTOPACK
@ G_FILE_RECOVER_WRITE
@ G_FILE_NO_UI
@ G_FILE_COMPRESS
@ 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_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
Global G
Definition blender.cc:47
@ 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.
char gpu_debug_scope_name[200]
struct Global::@26 log
const char * opengl_deprecation_usage_filename
void * file
char filepath_last_image[1024]
Definition BKE_global.hh:43
bool background
Definition BKE_global.hh:66
int debug
short moving
Definition BKE_global.hh:87
bool opengl_deprecation_usage_detected
int opengl_deprecation_usage_lineno
int level
bool is_rendering
Definition BKE_global.hh:90
Main * main
Definition BKE_global.hh:34
char filepath_last_library[1024]
Definition BKE_global.hh:45
bool quiet
Definition BKE_global.hh:74
short debug_value
ListBase recent_files
Definition BKE_global.hh:51
bool randomize_geometry_element_order
int fileflags
bool factory_startup
Definition BKE_global.hh:81
char autoexec_fail[200]
bool is_break
Definition BKE_global.hh:57
Main * pr_main
Definition BKE_global.hh:40