Blender V5.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
13
14#include <optional>
15
16#include "DNA_listBase.h"
17
18namespace blender {
19
20struct Main;
21struct RecentFile;
22
30struct Global {
31
38 Main *main = nullptr;
39
44 Main *pr_main = nullptr;
45
47 char filepath_last_image[/*FILE_MAX*/ 1024] = "";
49 char filepath_last_library[/*FILE_MAX*/ 1024] = "";
55 char filepath_last_blend[/*FILE_MAX*/ 1024] = "";
56
61 ListBaseT<RecentFile> recent_files = {};
62
67 bool is_break = false;
68
76 bool background = false;
77
83 bool factory_startup = false;
84
89 short moving = 0;
90
92 bool is_rendering = false;
93
116 short debug_value = 0;
117
124 int f = 0;
125
133 std::optional<bool> autoexec_override;
134
135 struct {
140 int level = 0;
145 void *file = nullptr;
147
154
163
170 int fileflags = 0;
171
180 char autoexec_fail[200] = "";
181
186 char gpu_debug_scope_name[100] = "";
187
193
194 bool profile_gpu = false;
195};
196
197/* **************** GLOBAL ********************* */
198
200enum {
202 G_FLAG_PICKSEL = (1 << 2),
206
216
217 /* NOTE: storing both online/offline override is needed so changing the preference
218 * can be disabled when launching Blender with `--offline-mode`.
219 * This means that users in a controlled environment can launch
220 * in offline-mode and the option can't be changed afterwards. */
221
226
313
317
318};
319
320#define G_FLAG_INTERNET_OVERRIDE_PREF_ANY \
321 (G_FLAG_INTERNET_OVERRIDE_PREF_ONLINE | G_FLAG_INTERNET_OVERRIDE_PREF_OFFLINE)
322
324#define G_FLAG_ALL_RUNTIME \
325 (G_FLAG_SCRIPT_AUTOEXEC | G_FLAG_INTERNET_ALLOW | G_FLAG_INTERNET_OVERRIDE_PREF_ONLINE | \
326 G_FLAG_INTERNET_OVERRIDE_PREF_OFFLINE | G_FLAG_EVENT_SIMULATE | \
327 G_FLAG_USERPREF_NO_SAVE_ON_EXIT | G_FLAG_GPU_BACKEND_FALLBACK | \
328 G_FLAG_GPU_BACKEND_FALLBACK_QUIET | \
329\
330 /* #BPY_python_reset is responsible for resetting these flags on file load. */ \
331 G_FLAG_SCRIPT_AUTOEXEC_FAIL | G_FLAG_SCRIPT_AUTOEXEC_FAIL_QUIET)
332
334#define G_FLAG_ALL_READFILE 0
335
337enum : uint64_t {
339 G_DEBUG = (1ull << 0),
341 G_DEBUG_PYTHON = (1ull << 2),
343 G_DEBUG_EVENTS = (1ull << 3),
345 G_DEBUG_HANDLERS = (1ull << 4),
347 G_DEBUG_WM = (1ull << 5),
349 G_DEBUG_JOBS = (1ull << 6),
351 G_DEBUG_FREESTYLE = (1ull << 7),
357 G_DEBUG_DEPSGRAPH_TAG = (1ull << 10),
365 G_DEBUG_DEPSGRAPH_UID = (1ull << 14),
369 G_DEBUG_SIMDATA = (1ull << 15),
371 G_DEBUG_GPU = (1ull << 16),
373 G_DEBUG_IO = (1ull << 17),
381 G_DEBUG_GPU_RENDERDOC = (1ull << 21),
387 G_DEBUG_XR = (1ull << 24),
389 G_DEBUG_XR_TIME = (1ull << 25),
390
392 G_DEBUG_GHOST = (1ull << 26),
394 G_DEBUG_WINTAB = (1ull << 27),
395
406};
407
408#define G_DEBUG_ALL \
409 (G_DEBUG | G_DEBUG_PYTHON | G_DEBUG_EVENTS | G_DEBUG_WM | G_DEBUG_JOBS | G_DEBUG_FREESTYLE | \
410 G_DEBUG_DEPSGRAPH | G_DEBUG_IO | G_DEBUG_GHOST | G_DEBUG_WINTAB)
411
413enum {
414 G_FILE_AUTOPACK = (1 << 0),
415 G_FILE_COMPRESS = (1 << 1),
416
426
434
435 // G_FILE_DEPRECATED_9 = (1 << 9),
436 G_FILE_NO_UI = (1 << 10),
437
438 /* Bits 11 to 22 (inclusive) are deprecated & need to be cleared */
439
458 // #define G_FILE_MESH_COMPAT (1 << 26)
459 // #define G_FILE_GLSL_NO_ENV_LIGHTING (1 << 28) /* deprecated */
466};
467
472#define G_FILE_FLAG_ALL_RUNTIME \
473 (G_BACKGROUND_NO_DEPSGRAPH | G_LIBOVERRIDE_NO_AUTO_RESYNC | G_FILE_NO_UI | \
474 G_FILE_RECOVER_READ | G_FILE_RECOVER_WRITE)
475
477enum {
478 G_TRANSFORM_OBJ = (1 << 0),
480 G_TRANSFORM_SEQ = (1 << 2),
488 G_TRANSFORM_WM = (1 << 4),
495};
496
498extern Global G;
499
504#define G_MAIN (G).main
505
506} // namespace blender
These structs are the foundation for all linked lists in the library system.
unsigned long long int uint64_t
#define log
#define G(x, y, z)
BMesh Iterators.
unsigned __int64 uint64_t
Definition BKE_text.h:91
@ G_DEBUG_HANDLERS
@ G_DEBUG_GPU_SHADER_DEBUG_INFO
@ G_DEBUG_GPU_BACKEND_NO_FALLBACK
@ G_DEBUG_GPU_NO_HW_RAYTRACING
@ G_DEBUG_EVENTS
@ G_DEBUG_DEPSGRAPH_PRETTY
@ G_DEBUG_DEPSGRAPH_UID
@ G_DEBUG_GPU_DEVICE_NO_FALLBACK
@ G_DEBUG_GPU_SHADER_NO_DCE
@ G_DEBUG_FREESTYLE
@ G_DEBUG_XR_TIME
@ G_DEBUG_GPU_SHADER_NO_PREPROCESSOR
@ G_DEBUG_WINTAB
@ G_DEBUG_GPU_NO_TEXTURE_POOL
@ G_DEBUG_PYTHON
@ G_DEBUG_DEPSGRAPH_NO_THREADS
@ G_DEBUG_GPU_FORCE_VULKAN_LOCAL_READ
@ G_DEBUG_GPU_FORCE_WORKAROUNDS
@ G_DEBUG_DEPSGRAPH_BUILD
@ G_DEBUG_DEPSGRAPH_TAG
@ G_DEBUG_SIMDATA
@ G_DEBUG_DEPSGRAPH_EVAL
@ G_DEBUG_DEPSGRAPH
@ G_DEBUG_GPU_RENDERDOC
@ G_DEBUG_GHOST
@ G_DEBUG_GPU_COMPILE_SHADERS
@ G_DEBUG_DEPSGRAPH_TIME
@ G_BACKGROUND_NO_DEPSGRAPH
@ G_FILE_RECOVER_READ
@ G_FILE_RECOVER_WRITE
@ G_FILE_COMPRESS
@ G_FILE_ASSET_EDIT_FILE
@ G_FILE_AUTOPACK
@ G_LIBOVERRIDE_NO_AUTO_RESYNC
@ G_FLAG_GPU_BACKEND_FALLBACK_QUIET
@ G_FLAG_RENDER_VIEWPORT
@ G_FLAG_INTERNET_OVERRIDE_PREF_OFFLINE
@ G_FLAG_USERPREF_NO_SAVE_ON_EXIT
@ G_FLAG_INTERNET_ALLOW
@ G_FLAG_INTERNET_OVERRIDE_PREF_ONLINE
@ G_FLAG_SCRIPT_AUTOEXEC_FAIL_QUIET
@ G_FLAG_EVENT_SIMULATE
@ G_FLAG_SCRIPT_AUTOEXEC_FAIL
@ G_FLAG_SCRIPT_AUTOEXEC
@ G_FLAG_GPU_BACKEND_FALLBACK
@ G_FLAG_PICKSEL
@ G_TRANSFORM_SEQ
@ G_TRANSFORM_OBJ
@ G_TRANSFORM_WM
@ G_TRANSFORM_FCURVES
@ G_TRANSFORM_CURSOR
@ G_TRANSFORM_EDIT
char autoexec_fail[200]
char filepath_last_blend[1024]
Definition BKE_global.hh:55
char gpu_debug_scope_name[100]
bool randomize_geometry_element_order
ListBaseT< RecentFile > recent_files
Definition BKE_global.hh:61
char gpu_debug_shader_source_name[100]
char filepath_last_library[1024]
Definition BKE_global.hh:49
char filepath_last_image[1024]
Definition BKE_global.hh:47
std::optional< bool > autoexec_override