Blender V4.5
bpy_app.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
13#include <Python.h>
14
15#include "bpy_app.hh"
16
17#include "bpy_app_alembic.hh"
19#include "bpy_app_ffmpeg.hh"
20#include "bpy_app_ocio.hh"
21#include "bpy_app_oiio.hh"
22#include "bpy_app_opensubdiv.hh"
23#include "bpy_app_openvdb.hh"
24#include "bpy_app_sdl.hh"
25#include "bpy_app_usd.hh"
26
28
29#include "bpy_app_handlers.hh"
30#include "bpy_driver.hh"
31
32#include "BPY_extern_python.hh" /* For #BPY_python_app_help_text_fn. */
33
34/* modules */
35#include "bpy_app_icons.hh"
36#include "bpy_app_timers.hh"
37
38#include "BLI_utildefines.h"
39
40#include "BKE_appdir.hh"
41#include "BKE_blender_version.h"
42#include "BKE_global.hh"
43#include "BKE_main.hh"
44
45#include "GPU_shader.hh"
46
47#include "UI_interface_icons.hh"
48
49#include "MEM_guardedalloc.h"
50
51#include "RNA_enum_types.hh" /* For `rna_enum_wm_job_type_items`. */
52
53/* for notifiers */
54#include "WM_api.hh"
55#include "WM_types.hh"
56
59#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
60
61#ifdef BUILD_DATE
62extern "C" char build_date[];
63extern "C" char build_time[];
65extern "C" char build_commit_date[];
66extern "C" char build_commit_time[];
67extern "C" char build_hash[];
68extern "C" char build_branch[];
69extern "C" char build_platform[];
70extern "C" char build_type[];
71extern "C" char build_cflags[];
72extern "C" char build_cxxflags[];
73extern "C" char build_linkflags[];
74extern "C" char build_system[];
75#endif
76
77static PyTypeObject BlenderAppType;
78
79static PyStructSequence_Field app_info_fields[] = {
80 {"version",
81 "The Blender version as a tuple of 3 numbers (major, minor, micro). eg. (4, 3, 1)"},
82 {"version_file",
83 "The Blender File version, as a tuple of 3 numbers (major, minor, file sub-version), that "
84 "will be used to save a .blend file. The last item in this tuple indicates the file "
85 "sub-version, which is different from the release micro version (the last item of the "
86 "`bpy.app.version` tuple). The file sub-version can be incremented multiple times while a "
87 "Blender version is under development. This value is, and should be, used for handling "
88 "compatibility changes between Blender versions"},
89 {"version_string", "The Blender version formatted as a string"},
90 {"version_cycle", "The release status of this build alpha/beta/rc/release"},
91 {"background",
92 "Boolean, True when blender is running without a user interface (started with -b)"},
93 {"module", "Boolean, True when running Blender as a python module"},
94 {"factory_startup", "Boolean, True when blender is running with --factory-startup)"},
95 {"portable", "Boolean, True unless blender was built to reference absolute paths (on UNIX)."},
96
97 /* buildinfo */
98 {"build_date", "The date this blender instance was built"},
99 {"build_time", "The time this blender instance was built"},
100 {"build_commit_timestamp", "The unix timestamp of commit this blender instance was built"},
101 {"build_commit_date", "The date of commit this blender instance was built"},
102 {"build_commit_time", "The time of commit this blender instance was built"},
103 {"build_hash", "The commit hash this blender instance was built with"},
104 {"build_branch", "The branch this blender instance was built from"},
105 {"build_platform", "The platform this blender instance was built for"},
106 {"build_type", "The type of build (Release, Debug)"},
107 {"build_cflags", "C compiler flags"},
108 {"build_cxxflags", "C++ compiler flags"},
109 {"build_linkflags", "Binary linking flags"},
110 {"build_system", "Build system used"},
111
112 /* submodules */
113 {"alembic", "Alembic library information backend"},
114 {"usd", "USD library information backend"},
115 {"ffmpeg", "FFmpeg library information backend"},
116 {"ocio", "OpenColorIO library information backend"},
117 {"oiio", "OpenImageIO library information backend"},
118 {"opensubdiv", "OpenSubdiv library information backend"},
119 {"openvdb", "OpenVDB library information backend"},
120 {"sdl", "SDL library information backend"},
121 {"build_options", "A set containing most important enabled optional build features"},
122 {"handlers", "Application handler callbacks"},
123 {"translations", "Application and addons internationalization API"},
124
125 /* Modules (not struct sequence). */
126 {"icons", "Manage custom icons"},
127 {"timers", "Manage timers"},
128 {nullptr},
129};
130
132 /* Wrap. */
133 bpy_app_doc,
134 "This module contains application values that remain unchanged during runtime.");
135
136static PyStructSequence_Desc app_info_desc = {
137 /*name*/ "bpy.app",
138 /*doc*/ bpy_app_doc,
139 /*fields*/ app_info_fields,
140 /*n_in_sequence*/ ARRAY_SIZE(app_info_fields) - 1,
141};
142
143static PyObject *make_app_info()
144{
145 PyObject *app_info;
146 int pos = 0;
147
148 app_info = PyStructSequence_New(&BlenderAppType);
149 if (app_info == nullptr) {
150 return nullptr;
151 }
152#define SetIntItem(flag) PyStructSequence_SET_ITEM(app_info, pos++, PyLong_FromLong(flag))
153#define SetStrItem(str) PyStructSequence_SET_ITEM(app_info, pos++, PyUnicode_FromString(str))
154#define SetBytesItem(str) PyStructSequence_SET_ITEM(app_info, pos++, PyBytes_FromString(str))
155#define SetObjItem(obj) PyStructSequence_SET_ITEM(app_info, pos++, obj)
156
162
164 SetObjItem(PyBool_FromLong(G.background));
165#ifdef WITH_PYTHON_MODULE
166 SetObjItem(Py_NewRef(Py_True));
167#else
168 SetObjItem(Py_NewRef(Py_False));
169#endif
170 SetObjItem(PyBool_FromLong(G.factory_startup));
171
172#ifdef WITH_INSTALL_PORTABLE
173 SetObjItem(Py_NewRef(Py_True));
174#else
175 SetObjItem(Py_NewRef(Py_False));
176#endif
177
178/* build info, use bytes since we can't assume _any_ encoding:
179 * see patch #30154 for issue */
180#ifdef BUILD_DATE
194#else
195 SetBytesItem("Unknown");
196 SetBytesItem("Unknown");
197 SetIntItem(0);
198 SetBytesItem("Unknown");
199 SetBytesItem("Unknown");
200 SetBytesItem("Unknown");
201 SetBytesItem("Unknown");
202 SetBytesItem("Unknown");
203 SetBytesItem("Unknown");
204 SetBytesItem("Unknown");
205 SetBytesItem("Unknown");
206 SetBytesItem("Unknown");
207 SetBytesItem("Unknown");
208#endif
209
221
222 /* modules */
225
226#undef SetIntItem
227#undef SetStrItem
228#undef SetBytesItem
229#undef SetObjItem
230
231 if (PyErr_Occurred()) {
232 Py_DECREF(app_info);
233 return nullptr;
234 }
235 return app_info;
236}
237
238/* a few getsets because it makes sense for them to be in bpy.app even though
239 * they are not static */
240
242 /* Wrap. */
243 bpy_app_debug_doc,
244 "Boolean, for debug info "
245 "(started with ``--debug`` / ``--debug-*`` matching this attribute name)");
246static PyObject *bpy_app_debug_get(PyObject * /*self*/, void *closure)
247{
248 const int flag = POINTER_AS_INT(closure);
249 return PyBool_FromLong(G.debug & flag);
250}
251
252static int bpy_app_debug_set(PyObject * /*self*/, PyObject *value, void *closure)
253{
254 const int flag = POINTER_AS_INT(closure);
255 const int param = PyObject_IsTrue(value);
256
257 if (param == -1) {
258 PyErr_SetString(PyExc_TypeError, "bpy.app.debug can only be True/False");
259 return -1;
260 }
261
262 if (param) {
263 G.debug |= flag;
264 }
265 else {
266 G.debug &= ~flag;
267 }
268
269 return 0;
270}
271
273 /* Wrap. */
274 bpy_app_internet_offline_doc,
275 "Boolean, true when internet access is allowed by Blender & 3rd party scripts (read-only)");
277 /* Wrap. */
278 bpy_app_internet_offline_override_doc,
279 "Boolean, true when internet access preference is overridden by the command line (read-only)");
280
282 /* Wrap. */
283 bpy_app_global_flag_doc,
284 "Boolean, for application behavior "
285 "(started with ``--enable-*`` matching this attribute name)");
286
288 /* Wrap. */
289 bpy_app_autoexec_override_doc,
290 "Boolean or None, the auto-execution set by the command line, "
291 "None when the preference isn't overridden (read-only)");
292
293static PyObject *bpy_app_global_flag_get(PyObject * /*self*/, void *closure)
294{
295 const int flag = POINTER_AS_INT(closure);
296 return PyBool_FromLong(G.f & flag);
297}
298
299static PyObject *bpy_app_autoexec_override_get(PyObject * /*self*/, void * /*closure*/)
300{
301 if (!G.autoexec_override.has_value()) {
302 Py_RETURN_NONE;
303 }
304 return PyBool_FromLong(*G.autoexec_override);
305}
306
307static int bpy_app_global_flag_set(PyObject * /*self*/, PyObject *value, void *closure)
308{
309 const int flag = POINTER_AS_INT(closure);
310 const int param = PyObject_IsTrue(value);
311
312 if (param == -1) {
313 PyErr_SetString(PyExc_TypeError, "bpy.app.use_* can only be True/False");
314 return -1;
315 }
316
317 if (param) {
318 G.f |= flag;
319 }
320 else {
321 G.f &= ~flag;
322 }
323
324 return 0;
325}
326
327static int bpy_app_global_flag_set__only_disable(PyObject * /*self*/,
328 PyObject *value,
329 void *closure)
330{
331 const int param = PyObject_IsTrue(value);
332 if (param == 1) {
333 PyErr_SetString(PyExc_ValueError, "This bpy.app.use_* option can only be disabled");
334 return -1;
335 }
336 return bpy_app_global_flag_set(nullptr, value, closure);
337}
338
340 /* Wrap. */
341 bpy_app_debug_value_doc,
342 "Short, number which can be set to non-zero values for testing purposes");
343static PyObject *bpy_app_debug_value_get(PyObject * /*self*/, void * /*closure*/)
344{
345 return PyLong_FromLong(G.debug_value);
346}
347
348static int bpy_app_debug_value_set(PyObject * /*self*/, PyObject *value, void * /*closure*/)
349{
350 const short param = PyC_Long_AsI16(value);
351
352 if (param == -1 && PyErr_Occurred()) {
353 PyC_Err_SetString_Prefix(PyExc_TypeError,
354 "bpy.app.debug_value can only be set to a whole number");
355 return -1;
356 }
357
358 G.debug_value = param;
359
361
362 return 0;
363}
364
366 /* Wrap. */
367 bpy_app_tempdir_doc,
368 "String, the temp directory used by blender (read-only)");
369static PyObject *bpy_app_tempdir_get(PyObject * /*self*/, void * /*closure*/)
370{
372}
373
375 /* Wrap. */
376 bpy_app_driver_dict_doc,
377 "Dictionary for drivers namespace, editable in-place, reset on file load (read-only)");
378static PyObject *bpy_app_driver_dict_get(PyObject * /*self*/, void * /*closure*/)
379{
380 if (bpy_pydriver_Dict == nullptr) {
381 if (bpy_pydriver_create_dict() != 0) {
382 PyErr_SetString(PyExc_RuntimeError, "bpy.app.driver_namespace failed to create dictionary");
383 return nullptr;
384 }
385 }
386
387 return Py_NewRef(bpy_pydriver_Dict);
388}
389
391 /* Wrap. */
392 bpy_app_preview_render_size_doc,
393 "Reference size for icon/preview renders (read-only)");
394static PyObject *bpy_app_preview_render_size_get(PyObject * /*self*/, void *closure)
395{
396 return PyLong_FromLong(
398}
399
400static PyObject *bpy_app_autoexec_fail_message_get(PyObject * /*self*/, void * /*closure*/)
401{
402 return PyC_UnicodeFromBytes(G.autoexec_fail);
403}
404
406 /* Wrap. */
407 bpy_app_python_args_doc,
408 "Leading arguments to use when calling Python directly (via ``sys.executable``). "
409 "These arguments match settings Blender uses to "
410 "ensure Python runs with a compatible environment (read-only).");
411static PyObject *bpy_app_python_args_get(PyObject * /*self*/, void * /*closure*/)
412{
413 const char *args[1];
414 int args_num = 0;
416 /* Isolated Python environment. */
417 args[args_num++] = "-I";
418 }
419 return PyC_Tuple_PackArray_String(args, args_num);
420}
421
423 /* Wrap. */
424 bpy_app_binary_path_doc,
425 "The location of Blender's executable, useful for utilities that open new instances. "
426 "Read-only unless Blender is built as a Python module - in this case the value is "
427 "an empty string which script authors may point to a Blender binary.");
428static PyObject *bpy_app_binary_path_get(PyObject * /*self*/, void * /*closure*/)
429{
431}
432
433static int bpy_app_binary_path_set(PyObject * /*self*/, PyObject *value, void * /*closure*/)
434{
435#ifndef WITH_PYTHON_MODULE
436 PyErr_SetString(PyExc_AttributeError,
437 "bpy.app.binary_path is only writable when built as a Python module");
438 return -1;
439#endif
440 PyObject *value_coerce = nullptr;
441 const char *filepath = PyC_UnicodeAsBytes(value, &value_coerce);
442 if (filepath == nullptr) {
443 PyErr_Format(PyExc_ValueError, "expected a string or bytes, got %s", Py_TYPE(value)->tp_name);
444 return -1;
445 }
447 Py_XDECREF(value_coerce);
448 return 0;
449}
450
451static PyGetSetDef bpy_app_getsets[] = {
452 {"debug", bpy_app_debug_get, bpy_app_debug_set, bpy_app_debug_doc, (void *)G_DEBUG},
453 {"debug_ffmpeg",
456 bpy_app_debug_doc,
457 (void *)G_DEBUG_FFMPEG},
458 {"debug_freestyle",
461 bpy_app_debug_doc,
462 (void *)G_DEBUG_FREESTYLE},
463 {"debug_python",
466 bpy_app_debug_doc,
467 (void *)G_DEBUG_PYTHON},
468 {"debug_events",
471 bpy_app_debug_doc,
472 (void *)G_DEBUG_EVENTS},
473 {"debug_handlers",
476 bpy_app_debug_doc,
477 (void *)G_DEBUG_HANDLERS},
478 {"debug_wm", bpy_app_debug_get, bpy_app_debug_set, bpy_app_debug_doc, (void *)G_DEBUG_WM},
479 {"debug_depsgraph",
482 bpy_app_debug_doc,
483 (void *)G_DEBUG_DEPSGRAPH},
484 {"debug_depsgraph_build",
487 bpy_app_debug_doc,
489 {"debug_depsgraph_eval",
492 bpy_app_debug_doc,
493 (void *)G_DEBUG_DEPSGRAPH_EVAL},
494 {"debug_depsgraph_tag",
497 bpy_app_debug_doc,
498 (void *)G_DEBUG_DEPSGRAPH_TAG},
499 {"debug_depsgraph_time",
502 bpy_app_debug_doc,
503 (void *)G_DEBUG_DEPSGRAPH_TIME},
504 {"debug_depsgraph_pretty",
507 bpy_app_debug_doc,
509 {"debug_simdata",
512 bpy_app_debug_doc,
513 (void *)G_DEBUG_SIMDATA},
514 {"debug_io", bpy_app_debug_get, bpy_app_debug_set, bpy_app_debug_doc, (void *)G_DEBUG_IO},
515
516 {"use_event_simulate",
519 bpy_app_global_flag_doc,
520 (void *)G_FLAG_EVENT_SIMULATE},
521
522 {"use_userpref_skip_save_on_exit",
525 bpy_app_global_flag_doc,
527
528 {"debug_value",
531 bpy_app_debug_value_doc,
532 nullptr},
533 {"tempdir", bpy_app_tempdir_get, nullptr, bpy_app_tempdir_doc, nullptr},
534 {"driver_namespace", bpy_app_driver_dict_get, nullptr, bpy_app_driver_dict_doc, nullptr},
535
536 {"render_icon_size",
538 nullptr,
539 bpy_app_preview_render_size_doc,
540 (void *)ICON_SIZE_ICON},
541 {"render_preview_size",
543 nullptr,
544 bpy_app_preview_render_size_doc,
545 (void *)ICON_SIZE_PREVIEW},
546
547 {"online_access",
549 nullptr,
550 bpy_app_internet_offline_doc,
551 (void *)G_FLAG_INTERNET_ALLOW},
552 {"online_access_override",
554 nullptr,
555 bpy_app_internet_offline_override_doc,
557
558 /* security */
559 {"autoexec_override",
561 nullptr,
562 bpy_app_autoexec_override_doc,
563 nullptr},
564 {"autoexec_fail",
566 nullptr,
567 nullptr,
569 {"autoexec_fail_quiet",
571 nullptr,
572 nullptr,
574 {"autoexec_fail_message", bpy_app_autoexec_fail_message_get, nullptr, nullptr, nullptr},
575
576 {"python_args", bpy_app_python_args_get, nullptr, bpy_app_python_args_doc, nullptr},
577
578 /* Support script authors setting the Blender binary path to use, otherwise this value
579 * is not known when built as a Python module. */
580 {"binary_path",
583 bpy_app_binary_path_doc,
584 nullptr},
585
586 {nullptr, nullptr, nullptr, nullptr, nullptr},
587};
588
590 /* Wrap. */
591 bpy_app_is_job_running_doc,
592 ".. staticmethod:: is_job_running(job_type)\n"
593 "\n"
594 " Check whether a job of the given type is running.\n"
595 "\n"
596 " :arg job_type: job type in :ref:`rna_enum_wm_job_type_items`.\n"
597 " :type job_type: str\n"
598 " :return: Whether a job of the given type is currently running.\n"
599 " :rtype: bool.\n");
600static PyObject *bpy_app_is_job_running(PyObject * /*self*/, PyObject *args, PyObject *kwds)
601{
602 BPy_EnumProperty_Parse job_type_enum{};
603 job_type_enum.items = rna_enum_wm_job_type_items;
604 job_type_enum.value = 0;
605
606 static const char *_keywords[] = {"job_type", nullptr};
607 static _PyArg_Parser _parser = {
609 "O&" /* `job_type` */
610 ":is_job_running",
611 _keywords,
612 nullptr,
613 };
614 if (!_PyArg_ParseTupleAndKeywordsFast(
615 args, kwds, &_parser, pyrna_enum_value_parse_string, &job_type_enum))
616 {
617 return nullptr;
618 }
619 wmWindowManager *wm = static_cast<wmWindowManager *>(G_MAIN->wm.first);
620 if (job_type_enum.value == WM_JOB_TYPE_SHADER_COMPILATION) {
621 /* Shader compilation no longer uses the WM_job API, so we handle this as a special case
622 * to avoid breaking the Python API. */
623 return PyBool_FromLong(GPU_shader_batch_is_compiling());
624 }
625 return PyBool_FromLong(WM_jobs_has_running_type(wm, job_type_enum.value));
626}
627
628char *(*BPY_python_app_help_text_fn)(bool all) = nullptr;
629
631 /* Wrap. */
632 bpy_app_help_text_doc,
633 ".. staticmethod:: help_text(all=False)\n"
634 "\n"
635 " Return the help text as a string.\n"
636 "\n"
637 " :arg all: Return all arguments, "
638 "even those which aren't available for the current platform.\n"
639 " :type all: bool\n");
640static PyObject *bpy_app_help_text(PyObject * /*self*/, PyObject *args, PyObject *kwds)
641{
642 bool all = false;
643 static const char *_keywords[] = {"all", nullptr};
644 static _PyArg_Parser _parser = {
646 "|$" /* Optional keyword only arguments. */
647 "O&" /* `all` */
648 ":help_text",
649 _keywords,
650 nullptr,
651 };
652 if (!_PyArg_ParseTupleAndKeywordsFast(args, kwds, &_parser, PyC_ParseBool, &all)) {
653 return nullptr;
654 }
655
656 char *buf = BPY_python_app_help_text_fn(all);
657 PyObject *result = PyUnicode_FromString(buf);
658 MEM_freeN(buf);
659 return result;
660}
661
662#ifdef __GNUC__
663# ifdef __clang__
664# pragma clang diagnostic push
665# pragma clang diagnostic ignored "-Wcast-function-type"
666# else
667# pragma GCC diagnostic push
668# pragma GCC diagnostic ignored "-Wcast-function-type"
669# endif
670#endif
671
672static PyMethodDef bpy_app_methods[] = {
673 {"is_job_running",
674 (PyCFunction)bpy_app_is_job_running,
675 METH_VARARGS | METH_KEYWORDS | METH_STATIC,
676 bpy_app_is_job_running_doc},
677 {"help_text",
678 (PyCFunction)bpy_app_help_text,
679 METH_VARARGS | METH_KEYWORDS | METH_STATIC,
680 bpy_app_help_text_doc},
681 {nullptr, nullptr, 0, nullptr},
682};
683
684#ifdef __GNUC__
685# ifdef __clang__
686# pragma clang diagnostic pop
687# else
688# pragma GCC diagnostic pop
689# endif
690#endif
691
693{
694 /* tricky dynamic members, not to py-spec! */
695 for (PyGetSetDef *getset = bpy_app_getsets; getset->name; getset++) {
696 PyObject *item = PyDescr_NewGetSet(&BlenderAppType, getset);
697 PyDict_SetItem(BlenderAppType.tp_dict, PyDescr_NAME(item), item);
698 Py_DECREF(item);
699 }
700}
701
703{
704 for (PyMethodDef *method = bpy_app_methods; method->ml_name; method++) {
705 BLI_assert_msg(method->ml_flags & METH_STATIC, "Only static methods make sense for 'bpy.app'");
706 PyObject *item = PyCFunction_New(method, nullptr);
707 PyDict_SetItemString(BlenderAppType.tp_dict, method->ml_name, item);
708 Py_DECREF(item);
709 }
710}
711
712/* end dynamic bpy.app */
713
714PyObject *BPY_app_struct()
715{
716 PyObject *ret;
717
718 PyStructSequence_InitType(&BlenderAppType, &app_info_desc);
719
720 ret = make_app_info();
721
722 /* prevent user from creating new instances */
723 BlenderAppType.tp_init = nullptr;
724 BlenderAppType.tp_new = nullptr;
725 /* Without this we can't do `set(sys.modules)` #29635. */
726 BlenderAppType.tp_hash = (hashfunc)Py_HashPointer;
727
728 /* Kind of a hack on top of #PyStructSequence. */
731
732 return ret;
733}
const char * BKE_appdir_program_path() ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
Definition appdir.cc:952
void BKE_appdir_program_path_init(const char *argv0) ATTR_NONNULL(1)
Definition appdir.cc:929
#define BLENDER_VERSION_PATCH
const char * BKE_blender_version_string(void)
Definition blender.cc:143
#define BLENDER_VERSION_CYCLE
#define BLENDER_FILE_SUBVERSION
#define BLENDER_VERSION
#define BLENDER_FILE_VERSION
@ G_DEBUG
@ G_DEBUG_HANDLERS
@ G_DEBUG_FREESTYLE
@ G_DEBUG_IO
@ G_DEBUG_SIMDATA
@ G_DEBUG_FFMPEG
@ G_DEBUG_DEPSGRAPH_PRETTY
@ G_DEBUG_DEPSGRAPH_TIME
@ G_DEBUG_DEPSGRAPH
@ G_DEBUG_DEPSGRAPH_EVAL
@ G_DEBUG_DEPSGRAPH_TAG
@ G_DEBUG_WM
@ G_DEBUG_EVENTS
@ G_DEBUG_PYTHON
@ G_DEBUG_DEPSGRAPH_BUILD
#define G_MAIN
#define G_FLAG_INTERNET_OVERRIDE_PREF_ANY
@ G_FLAG_EVENT_SIMULATE
@ G_FLAG_SCRIPT_AUTOEXEC_FAIL_QUIET
@ G_FLAG_USERPREF_NO_SAVE_ON_EXIT
@ G_FLAG_SCRIPT_AUTOEXEC_FAIL
@ G_FLAG_INTERNET_ALLOW
#define BLI_assert_msg(a, msg)
Definition BLI_assert.h:53
unsigned long ulong
#define ARRAY_SIZE(arr)
#define STRINGIFY(x)
#define POINTER_AS_INT(i)
bool BPY_python_use_system_env_get()
eIconSizes
@ ICON_SIZE_PREVIEW
@ ICON_SIZE_ICON
bool GPU_shader_batch_is_compiling()
Read Guarded memory(de)allocation.
int UI_icon_preview_to_render_size(enum eIconSizes size)
@ WM_JOB_TYPE_SHADER_COMPILATION
Definition WM_api.hh:1750
#define NC_WINDOW
Definition WM_types.hh:372
static int bpy_app_binary_path_set(PyObject *, PyObject *value, void *)
Definition bpy_app.cc:433
static PyObject * bpy_app_debug_value_get(PyObject *, void *)
Definition bpy_app.cc:343
char build_type[]
Definition bpy_app.cc:70
static void py_struct_seq_getset_init()
Definition bpy_app.cc:692
char build_cflags[]
Definition bpy_app.cc:71
static PyObject * bpy_app_autoexec_fail_message_get(PyObject *, void *)
Definition bpy_app.cc:400
char build_hash[]
Definition bpy_app.cc:67
static PyStructSequence_Field app_info_fields[]
Definition bpy_app.cc:79
static PyObject * bpy_app_tempdir_get(PyObject *, void *)
Definition bpy_app.cc:369
static int bpy_app_debug_value_set(PyObject *, PyObject *value, void *)
Definition bpy_app.cc:348
static PyObject * make_app_info()
Definition bpy_app.cc:143
char build_commit_date[]
Definition bpy_app.cc:65
static PyObject * bpy_app_preview_render_size_get(PyObject *, void *closure)
Definition bpy_app.cc:394
static int bpy_app_global_flag_set(PyObject *, PyObject *value, void *closure)
Definition bpy_app.cc:307
static PyObject * bpy_app_autoexec_override_get(PyObject *, void *)
Definition bpy_app.cc:299
PyObject * BPY_app_struct()
Definition bpy_app.cc:714
#define SetBytesItem(str)
static PyGetSetDef bpy_app_getsets[]
Definition bpy_app.cc:451
static PyObject * bpy_app_global_flag_get(PyObject *, void *closure)
Definition bpy_app.cc:293
static int bpy_app_global_flag_set__only_disable(PyObject *, PyObject *value, void *closure)
Definition bpy_app.cc:327
ulong build_commit_timestamp
Definition bpy_app.cc:64
static int bpy_app_debug_set(PyObject *, PyObject *value, void *closure)
Definition bpy_app.cc:252
char build_commit_time[]
Definition bpy_app.cc:66
char build_linkflags[]
Definition bpy_app.cc:73
static PyObject * bpy_app_python_args_get(PyObject *, void *)
Definition bpy_app.cc:411
char build_system[]
Definition bpy_app.cc:74
char build_branch[]
Definition bpy_app.cc:68
#define SetIntItem(flag)
char build_date[]
Definition bpy_app.cc:62
PyDoc_STRVAR(bpy_app_doc, "This module contains application values that remain unchanged during runtime.")
char build_cxxflags[]
Definition bpy_app.cc:72
static PyObject * bpy_app_binary_path_get(PyObject *, void *)
Definition bpy_app.cc:428
#define SetStrItem(str)
char *(* BPY_python_app_help_text_fn)(bool all)
Definition bpy_app.cc:628
static void py_struct_seq_method_init()
Definition bpy_app.cc:702
static PyMethodDef bpy_app_methods[]
Definition bpy_app.cc:672
static PyStructSequence_Desc app_info_desc
Definition bpy_app.cc:136
static PyObject * bpy_app_driver_dict_get(PyObject *, void *)
Definition bpy_app.cc:378
static PyObject * bpy_app_debug_get(PyObject *, void *closure)
Definition bpy_app.cc:246
char build_time[]
Definition bpy_app.cc:63
static PyTypeObject BlenderAppType
Definition bpy_app.cc:77
char build_platform[]
Definition bpy_app.cc:69
static PyObject * bpy_app_help_text(PyObject *, PyObject *args, PyObject *kwds)
Definition bpy_app.cc:640
#define SetObjItem(obj)
static PyObject * bpy_app_is_job_running(PyObject *, PyObject *args, PyObject *kwds)
Definition bpy_app.cc:600
PyObject * BPY_app_alembic_struct()
PyObject * BPY_app_build_options_struct()
PyObject * BPY_app_ffmpeg_struct()
PyObject * BPY_app_handlers_struct()
PyObject * BPY_app_icons_module()
PyObject * BPY_app_ocio_struct()
PyObject * BPY_app_oiio_struct()
PyObject * BPY_app_opensubdiv_struct()
PyObject * BPY_app_openvdb_struct()
PyObject * BPY_app_sdl_struct()
PyObject * BPY_app_timers_module()
PyObject * BPY_app_translations_struct()
PyObject * BPY_app_usd_struct()
PyObject * bpy_pydriver_Dict
Definition bpy_driver.cc:52
int bpy_pydriver_create_dict()
Definition bpy_driver.cc:58
uint pos
bool all(VecOp< bool, D >) RET
void MEM_freeN(void *vmemh)
Definition mallocn.cc:113
#define G(x, y, z)
int pyrna_enum_value_parse_string(PyObject *o, void *p)
int16_t PyC_Long_AsI16(PyObject *value)
PyObject * PyC_Err_SetString_Prefix(PyObject *exception_type_prefix, const char *str)
PyObject * PyC_UnicodeFromBytes(const char *str)
PyObject * PyC_Tuple_PackArray_String(const char **array, uint len)
int PyC_ParseBool(PyObject *o, void *p)
const char * PyC_UnicodeAsBytes(PyObject *py_str, PyObject **r_coerce)
PyObject * PyC_Tuple_Pack_I32(const blender::Span< int > values)
header-only compatibility defines.
#define Py_HashPointer
#define PY_ARG_PARSER_HEAD_COMPAT()
return ret
const EnumPropertyItem rna_enum_wm_job_type_items[]
Definition rna_wm.cc:206
const EnumPropertyItem * items
void * BKE_tempdir_session
Definition stubs.c:38
void WM_main_add_notifier(uint type, void *reference)
bool WM_jobs_has_running_type(const wmWindowManager *wm, int job_type)
Definition wm_jobs.cc:757