51 #include "../generic/py_capi_rna.h"
52 #include "../generic/py_capi_utils.h"
53 #include "../generic/python_utildefines.h"
74 {
"version",
"The Blender version as a tuple of 3 numbers. eg. (2, 83, 1)"},
76 "The Blender version, as a tuple, last used to save a .blend file, compatible with "
77 "``bpy.data.version``. This value should be used for handling compatibility changes between "
79 {
"version_string",
"The Blender version formatted as a string"},
80 {
"version_cycle",
"The release status of this build alpha/beta/rc/release"},
81 {
"version_char",
"Deprecated, always an empty string"},
83 "The location of Blender's executable, useful for utilities that open new instances"},
85 "Boolean, True when blender is running without a user interface (started with -b)"},
86 {
"factory_startup",
"Boolean, True when blender is running with --factory-startup)"},
89 {
"build_date",
"The date this blender instance was built"},
90 {
"build_time",
"The time this blender instance was built"},
91 {
"build_commit_timestamp",
"The unix timestamp of commit this blender instance was built"},
92 {
"build_commit_date",
"The date of commit this blender instance was built"},
93 {
"build_commit_time",
"The time of commit this blender instance was built"},
94 {
"build_hash",
"The commit hash this blender instance was built with"},
95 {
"build_branch",
"The branch this blender instance was built from"},
96 {
"build_platform",
"The platform this blender instance was built for"},
97 {
"build_type",
"The type of build (Release, Debug)"},
98 {
"build_cflags",
"C compiler flags"},
99 {
"build_cxxflags",
"C++ compiler flags"},
100 {
"build_linkflags",
"Binary linking flags"},
101 {
"build_system",
"Build system used"},
104 {
"alembic",
"Alembic library information backend"},
105 {
"usd",
"USD library information backend"},
106 {
"ffmpeg",
"FFmpeg library information backend"},
107 {
"ocio",
"OpenColorIO library information backend"},
108 {
"oiio",
"OpenImageIO library information backend"},
109 {
"opensubdiv",
"OpenSubdiv library information backend"},
110 {
"openvdb",
"OpenVDB library information backend"},
111 {
"sdl",
"SDL library information backend"},
112 {
"build_options",
"A set containing most important enabled optional build features"},
113 {
"handlers",
"Application handler callbacks"},
114 {
"translations",
"Application and addons internationalization API"},
117 {
"icons",
"Manage custom icons"},
118 {
"timers",
"Manage timers"},
123 "This module contains application values that remain unchanged during runtime.");
138 if (app_info ==
NULL) {
141 #define SetIntItem(flag) PyStructSequence_SET_ITEM(app_info, pos++, PyLong_FromLong(flag))
142 #define SetStrItem(str) PyStructSequence_SET_ITEM(app_info, pos++, PyUnicode_FromString(str))
143 #define SetBytesItem(str) PyStructSequence_SET_ITEM(app_info, pos++, PyBytes_FromString(str))
144 #define SetObjItem(obj) PyStructSequence_SET_ITEM(app_info, pos++, obj)
211 if (PyErr_Occurred()) {
223 "Boolean, for debug info (started with --debug / --debug_* matching this attribute name)");
227 return PyBool_FromLong(
G.debug & flag);
233 const int param = PyObject_IsTrue(value);
236 PyErr_SetString(PyExc_TypeError,
"bpy.app.debug can only be True/False");
251 bpy_app_global_flag_doc,
252 "Boolean, for application behavior (started with --enable-* matching this attribute name)");
256 return PyBool_FromLong(
G.f & flag);
262 const int param = PyObject_IsTrue(value);
265 PyErr_SetString(PyExc_TypeError,
"bpy.app.use_* can only be True/False");
283 const int param = PyObject_IsTrue(value);
285 PyErr_SetString(PyExc_ValueError,
"This bpy.app.use_* option can only be disabled");
292 "Short, number which can be set to non-zero values for testing purposes");
295 return PyLong_FromLong(
G.debug_value);
302 if (param == -1 && PyErr_Occurred()) {
304 "bpy.app.debug_value can only be set to a whole number");
308 G.debug_value = param;
315 PyDoc_STRVAR(bpy_app_tempdir_doc,
"String, the temp directory used by blender (read-only)");
322 bpy_app_driver_dict_doc,
323 "Dictionary for drivers namespace, editable in-place, reset on file load (read-only)");
328 PyErr_SetString(PyExc_RuntimeError,
"bpy.app.driver_namespace failed to create dictionary");
337 "Reference size for icon/preview renders (read-only)");
381 {
"debug_depsgraph_build",
386 {
"debug_depsgraph_eval",
391 {
"debug_depsgraph_tag",
396 {
"debug_depsgraph_time",
401 {
"debug_depsgraph_pretty",
413 {
"use_event_simulate",
416 bpy_app_global_flag_doc,
419 {
"use_userpref_skip_save_on_exit",
422 bpy_app_global_flag_doc,
428 bpy_app_debug_value_doc,
436 bpy_app_preview_render_size_doc,
438 {
"render_preview_size",
441 bpy_app_preview_render_size_doc,
446 {
"autoexec_fail_quiet",
458 ".. staticmethod:: is_job_running(job_type)\n"
460 " Check whether a job of the given type is running.\n"
462 " :arg job_type: job type in :ref:`rna_enum_wm_job_type_items`.\n"
463 " :type job_type: str\n"
464 " :return: Whether a job of the given type is currently running.\n"
472 static const char *_keywords[] = {
"job_type",
NULL};
473 static _PyArg_Parser _parser = {
479 if (!_PyArg_ParseTupleAndKeywordsFast(
490 METH_VARARGS | METH_KEYWORDS | METH_STATIC,
491 bpy_app_is_job_running_doc},
507 for (PyMethodDef *method =
bpy_app_methods; method->ml_name; method++) {
508 BLI_assert_msg(method->ml_flags & METH_STATIC,
"Only static methods make sense for 'bpy.app'");
509 PyObject *item = PyCFunction_New(method,
NULL);
510 PyDict_SetItemString(
BlenderAppType.tp_dict, method->ml_name, item);
const char * BKE_appdir_program_path(void)
#define BLENDER_VERSION_PATCH
#define BLENDER_VERSION_CYCLE
#define BLENDER_FILE_SUBVERSION
#define BLENDER_FILE_VERSION
const char * BKE_blender_version_string(void)
@ G_DEBUG_DEPSGRAPH_PRETTY
@ G_DEBUG_DEPSGRAPH_BUILD
@ G_FLAG_SCRIPT_AUTOEXEC_FAIL_QUIET
@ G_FLAG_USERPREF_NO_SAVE_ON_EXIT
@ G_FLAG_SCRIPT_AUTOEXEC_FAIL
#define BLI_assert_msg(a, msg)
#define POINTER_AS_INT(i)
ID and Library types, which are fundamental for sdna.
int UI_icon_preview_to_render_size(enum eIconSizes size)
static void py_struct_seq_getset_init(void)
static PyStructSequence_Field app_info_fields[]
static PyObject * make_app_info(void)
static PyObject * bpy_app_is_job_running(PyObject *UNUSED(self), PyObject *args, PyObject *kwds)
static PyObject * bpy_app_global_flag_get(PyObject *UNUSED(self), void *closure)
static PyObject * bpy_app_driver_dict_get(PyObject *UNUSED(self), void *UNUSED(closure))
static PyObject * bpy_app_tempdir_get(PyObject *UNUSED(self), void *UNUSED(closure))
#define SetBytesItem(str)
static PyGetSetDef bpy_app_getsets[]
static PyObject * bpy_app_debug_value_get(PyObject *UNUSED(self), void *UNUSED(closure))
static struct PyMethodDef bpy_app_methods[]
static int bpy_app_debug_set(PyObject *UNUSED(self), PyObject *value, void *closure)
static int bpy_app_global_flag_set__only_disable(PyObject *UNUSED(self), PyObject *value, void *closure)
static void py_struct_seq_method_init(void)
static PyObject * bpy_app_preview_render_size_get(PyObject *UNUSED(self), void *closure)
static PyObject * bpy_app_debug_get(PyObject *UNUSED(self), void *closure)
static int bpy_app_debug_value_set(PyObject *UNUSED(self), PyObject *value, void *UNUSED(closure))
PyDoc_STRVAR(bpy_app_doc, "This module contains application values that remain unchanged during runtime.")
PyObject * BPY_app_struct(void)
ulong build_commit_timestamp
static PyStructSequence_Desc app_info_desc
static int bpy_app_global_flag_set(PyObject *UNUSED(self), PyObject *value, void *closure)
static PyTypeObject BlenderAppType
static PyObject * bpy_app_autoexec_fail_message_get(PyObject *UNUSED(self), void *UNUSED(closure))
PyObject * BPY_app_alembic_struct(void)
PyObject * BPY_app_build_options_struct(void)
PyObject * BPY_app_ffmpeg_struct(void)
PyObject * BPY_app_handlers_struct(void)
PyObject * BPY_app_icons_module(void)
PyObject * BPY_app_ocio_struct(void)
PyObject * BPY_app_oiio_struct(void)
PyObject * BPY_app_opensubdiv_struct(void)
PyObject * BPY_app_openvdb_struct(void)
PyObject * BPY_app_sdl_struct(void)
PyObject * BPY_app_timers_module(void)
PyObject * BPY_app_translations_struct(void)
PyObject * BPY_app_usd_struct(void)
PyObject * bpy_pydriver_Dict
int bpy_pydriver_create_dict(void)
void * BKE_tempdir_session
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_UnicodeFromByte(const char *str)
#define PyC_Tuple_Pack_I32(...)
const EnumPropertyItem rna_enum_wm_job_type_items[]
const struct EnumPropertyItem * items
void WM_main_add_notifier(unsigned int type, void *reference)
bool WM_jobs_has_running_type(const struct wmWindowManager *wm, int job_type)