Blender  V3.3
BKE_global.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 #pragma once
4 
13 #include "BLI_utildefines.h"
14 #include "DNA_listBase.h"
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 struct Main;
21 
22 typedef struct Global {
23 
30  struct Main *main;
31 
33  char ima[1024]; /* 1024 = FILE_MAX */
35  char lib[1024];
36 
41  struct ListBase recent_files;
42 
47  bool is_break;
48 
56  bool background;
57 
64 
69  short moving;
70 
73 
95  short debug_value;
96 
103  int f;
104 
105  struct {
110  int level;
115  void *file;
116  } log;
117 
123  int debug;
124 
132 
141  char autoexec_fail[200];
143 
144 /* **************** GLOBAL ********************* */
145 
147 enum {
149  G_FLAG_PICKSEL = (1 << 2),
153 
159 };
160 
162 #define G_FLAG_ALL_RUNTIME \
163  (G_FLAG_SCRIPT_AUTOEXEC | G_FLAG_SCRIPT_OVERRIDE_PREF | G_FLAG_EVENT_SIMULATE | \
164  G_FLAG_USERPREF_NO_SAVE_ON_EXIT | \
165 \
166  /* #BPY_python_reset is responsible for resetting these flags on file load. */ \
167  G_FLAG_SCRIPT_AUTOEXEC_FAIL | G_FLAG_SCRIPT_AUTOEXEC_FAIL_QUIET)
168 
170 #define G_FLAG_ALL_READFILE 0
171 
173 enum {
174  G_DEBUG = (1 << 0), /* general debug flag, print more info in unexpected cases */
175  G_DEBUG_FFMPEG = (1 << 1),
176  G_DEBUG_PYTHON = (1 << 2), /* extra python info */
177  G_DEBUG_EVENTS = (1 << 3), /* input/window/screen events */
178  G_DEBUG_HANDLERS = (1 << 4), /* events handling */
179  G_DEBUG_WM = (1 << 5), /* operator, undo */
180  G_DEBUG_JOBS = (1 << 6), /* jobs time profiling */
181  G_DEBUG_FREESTYLE = (1 << 7), /* freestyle messages */
182  G_DEBUG_DEPSGRAPH_BUILD = (1 << 8), /* depsgraph construction messages */
183  G_DEBUG_DEPSGRAPH_EVAL = (1 << 9), /* depsgraph evaluation messages */
184  G_DEBUG_DEPSGRAPH_TAG = (1 << 10), /* depsgraph tagging messages */
185  G_DEBUG_DEPSGRAPH_TIME = (1 << 11), /* depsgraph timing statistics and messages */
186  G_DEBUG_DEPSGRAPH_NO_THREADS = (1 << 12), /* single threaded depsgraph */
187  G_DEBUG_DEPSGRAPH_PRETTY = (1 << 13), /* use pretty colors in depsgraph messages */
188  G_DEBUG_DEPSGRAPH_UUID = (1 << 14), /* Verify validness of session-wide identifiers
189  * assigned to ID datablocks */
192  G_DEBUG_SIMDATA = (1 << 15), /* sim debug data display */
193  G_DEBUG_GPU = (1 << 16), /* gpu debug */
194  G_DEBUG_IO = (1 << 17), /* IO Debugging (for Collada, ...). */
195  G_DEBUG_GPU_FORCE_WORKAROUNDS = (1 << 18), /* force gpu workarounds bypassing detections. */
196  G_DEBUG_XR = (1 << 19), /* XR/OpenXR messages */
197  G_DEBUG_XR_TIME = (1 << 20), /* XR/OpenXR timing messages */
198 
199  G_DEBUG_GHOST = (1 << 21), /* Debug GHOST module. */
200  G_DEBUG_WINTAB = (1 << 22), /* Debug Wintab. */
201 };
202 
203 #define G_DEBUG_ALL \
204  (G_DEBUG | G_DEBUG_FFMPEG | G_DEBUG_PYTHON | G_DEBUG_EVENTS | G_DEBUG_WM | G_DEBUG_JOBS | \
205  G_DEBUG_FREESTYLE | G_DEBUG_DEPSGRAPH | G_DEBUG_IO | G_DEBUG_GHOST | G_DEBUG_WINTAB)
206 
208 enum {
209  G_FILE_AUTOPACK = (1 << 0),
210  G_FILE_COMPRESS = (1 << 1),
211 
212  // G_FILE_DEPRECATED_9 = (1 << 9),
213  G_FILE_NO_UI = (1 << 10),
214 
215  /* Bits 11 to 22 (inclusive) are deprecated & need to be cleared */
216 
225  G_FILE_RECOVER_READ = (1 << 23),
233  G_FILE_RECOVER_WRITE = (1 << 24),
235  /* #define G_FILE_MESH_COMPAT (1 << 26) */
236  /* #define G_FILE_GLSL_NO_ENV_LIGHTING (1 << 28) */ /* deprecated */
237 };
238 
243 #define G_FILE_FLAG_ALL_RUNTIME (G_FILE_NO_UI | G_FILE_RECOVER_READ | G_FILE_RECOVER_WRITE)
244 
246 enum {
247  G_TRANSFORM_OBJ = (1 << 0),
248  G_TRANSFORM_EDIT = (1 << 1),
249  G_TRANSFORM_SEQ = (1 << 2),
251  G_TRANSFORM_WM = (1 << 4),
257  G_TRANSFORM_CURSOR = (1 << 5),
258 };
259 
261 extern Global G;
262 
267 #define G_MAIN (G).main
268 
269 #ifdef __cplusplus
270 }
271 #endif
struct Global Global
@ G_FILE_RECOVER_READ
Definition: BKE_global.h:225
@ G_FILE_AUTOPACK
Definition: BKE_global.h:209
@ G_FILE_RECOVER_WRITE
Definition: BKE_global.h:233
@ G_FILE_NO_UI
Definition: BKE_global.h:213
@ G_FILE_COMPRESS
Definition: BKE_global.h:210
@ G_DEBUG
Definition: BKE_global.h:174
@ G_DEBUG_GPU
Definition: BKE_global.h:193
@ G_DEBUG_GHOST
Definition: BKE_global.h:199
@ G_DEBUG_XR
Definition: BKE_global.h:196
@ G_DEBUG_HANDLERS
Definition: BKE_global.h:178
@ G_DEBUG_FREESTYLE
Definition: BKE_global.h:181
@ G_DEBUG_IO
Definition: BKE_global.h:194
@ G_DEBUG_JOBS
Definition: BKE_global.h:180
@ G_DEBUG_GPU_FORCE_WORKAROUNDS
Definition: BKE_global.h:195
@ G_DEBUG_SIMDATA
Definition: BKE_global.h:192
@ G_DEBUG_FFMPEG
Definition: BKE_global.h:175
@ G_DEBUG_DEPSGRAPH_PRETTY
Definition: BKE_global.h:187
@ G_DEBUG_XR_TIME
Definition: BKE_global.h:197
@ G_DEBUG_WINTAB
Definition: BKE_global.h:200
@ G_DEBUG_DEPSGRAPH_TIME
Definition: BKE_global.h:185
@ G_DEBUG_DEPSGRAPH
Definition: BKE_global.h:190
@ G_DEBUG_DEPSGRAPH_EVAL
Definition: BKE_global.h:183
@ G_DEBUG_DEPSGRAPH_NO_THREADS
Definition: BKE_global.h:186
@ G_DEBUG_DEPSGRAPH_TAG
Definition: BKE_global.h:184
@ G_DEBUG_WM
Definition: BKE_global.h:179
@ G_DEBUG_EVENTS
Definition: BKE_global.h:177
@ G_DEBUG_PYTHON
Definition: BKE_global.h:176
@ G_DEBUG_DEPSGRAPH_BUILD
Definition: BKE_global.h:182
@ G_DEBUG_DEPSGRAPH_UUID
Definition: BKE_global.h:188
@ G_TRANSFORM_OBJ
Definition: BKE_global.h:247
@ G_TRANSFORM_CURSOR
Definition: BKE_global.h:257
@ G_TRANSFORM_SEQ
Definition: BKE_global.h:249
@ G_TRANSFORM_EDIT
Definition: BKE_global.h:248
@ G_TRANSFORM_FCURVES
Definition: BKE_global.h:250
@ G_TRANSFORM_WM
Definition: BKE_global.h:251
Global G
Definition: blender.c:51
@ G_FLAG_SCRIPT_OVERRIDE_PREF
Definition: BKE_global.h:156
@ G_FLAG_EVENT_SIMULATE
Definition: BKE_global.h:151
@ G_FLAG_SCRIPT_AUTOEXEC_FAIL_QUIET
Definition: BKE_global.h:158
@ G_FLAG_RENDER_VIEWPORT
Definition: BKE_global.h:148
@ G_FLAG_USERPREF_NO_SAVE_ON_EXIT
Definition: BKE_global.h:152
@ G_FLAG_SCRIPT_AUTOEXEC_FAIL
Definition: BKE_global.h:157
@ G_FLAG_PICKSEL
Definition: BKE_global.h:149
@ G_FLAG_SCRIPT_AUTOEXEC
Definition: BKE_global.h:154
These structs are the foundation for all linked lists in the library system.
int f
Definition: BKE_global.h:103
struct Global::@24 log
void * file
Definition: BKE_global.h:115
char lib[1024]
Definition: BKE_global.h:35
bool background
Definition: BKE_global.h:56
int debug
Definition: BKE_global.h:123
short moving
Definition: BKE_global.h:69
struct Main * main
Definition: BKE_global.h:30
int level
Definition: BKE_global.h:110
bool is_rendering
Definition: BKE_global.h:72
short debug_value
Definition: BKE_global.h:95
char ima[1024]
Definition: BKE_global.h:33
int fileflags
Definition: BKE_global.h:131
bool factory_startup
Definition: BKE_global.h:63
char autoexec_fail[200]
Definition: BKE_global.h:141
struct ListBase recent_files
Definition: BKE_global.h:41
bool is_break
Definition: BKE_global.h:47
Definition: BKE_main.h:121