Blender  V3.3
Macros | Functions | Variables
bpy_app.c File Reference
#include <Python.h>
#include "bpy_app.h"
#include "bpy_app_alembic.h"
#include "bpy_app_build_options.h"
#include "bpy_app_ffmpeg.h"
#include "bpy_app_ocio.h"
#include "bpy_app_oiio.h"
#include "bpy_app_opensubdiv.h"
#include "bpy_app_openvdb.h"
#include "bpy_app_sdl.h"
#include "bpy_app_usd.h"
#include "bpy_app_translations.h"
#include "bpy_app_handlers.h"
#include "bpy_driver.h"
#include "bpy_app_icons.h"
#include "bpy_app_timers.h"
#include "BLI_utildefines.h"
#include "BKE_appdir.h"
#include "BKE_blender_version.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "DNA_ID.h"
#include "UI_interface_icons.h"
#include "RNA_enum_types.h"
#include "WM_api.h"
#include "WM_types.h"
#include "../generic/py_capi_rna.h"
#include "../generic/py_capi_utils.h"
#include "../generic/python_utildefines.h"

Go to the source code of this file.

Macros

#define SetIntItem(flag)   PyStructSequence_SET_ITEM(app_info, pos++, PyLong_FromLong(flag))
 
#define SetStrItem(str)   PyStructSequence_SET_ITEM(app_info, pos++, PyUnicode_FromString(str))
 
#define SetBytesItem(str)   PyStructSequence_SET_ITEM(app_info, pos++, PyBytes_FromString(str))
 
#define SetObjItem(obj)   PyStructSequence_SET_ITEM(app_info, pos++, obj)
 

Functions

 PyDoc_STRVAR (bpy_app_doc, "This module contains application values that remain unchanged during runtime.")
 
static PyObject * make_app_info (void)
 
 PyDoc_STRVAR (bpy_app_debug_doc, "Boolean, for debug info (started with --debug / --debug_* matching this attribute name)")
 
static PyObject * bpy_app_debug_get (PyObject *UNUSED(self), void *closure)
 
static int bpy_app_debug_set (PyObject *UNUSED(self), PyObject *value, void *closure)
 
 PyDoc_STRVAR (bpy_app_global_flag_doc, "Boolean, for application behavior (started with --enable-* matching this attribute name)")
 
static PyObject * bpy_app_global_flag_get (PyObject *UNUSED(self), void *closure)
 
static int bpy_app_global_flag_set (PyObject *UNUSED(self), PyObject *value, void *closure)
 
static int bpy_app_global_flag_set__only_disable (PyObject *UNUSED(self), PyObject *value, void *closure)
 
 PyDoc_STRVAR (bpy_app_debug_value_doc, "Short, number which can be set to non-zero values for testing purposes")
 
static PyObject * bpy_app_debug_value_get (PyObject *UNUSED(self), void *UNUSED(closure))
 
static int bpy_app_debug_value_set (PyObject *UNUSED(self), PyObject *value, void *UNUSED(closure))
 
 PyDoc_STRVAR (bpy_app_tempdir_doc, "String, the temp directory used by blender (read-only)")
 
static PyObject * bpy_app_tempdir_get (PyObject *UNUSED(self), void *UNUSED(closure))
 
 PyDoc_STRVAR (bpy_app_driver_dict_doc, "Dictionary for drivers namespace, editable in-place, reset on file load (read-only)")
 
static PyObject * bpy_app_driver_dict_get (PyObject *UNUSED(self), void *UNUSED(closure))
 
 PyDoc_STRVAR (bpy_app_preview_render_size_doc, "Reference size for icon/preview renders (read-only)")
 
static PyObject * bpy_app_preview_render_size_get (PyObject *UNUSED(self), void *closure)
 
static PyObject * bpy_app_autoexec_fail_message_get (PyObject *UNUSED(self), void *UNUSED(closure))
 
 PyDoc_STRVAR (bpy_app_is_job_running_doc, ".. staticmethod:: is_job_running(job_type)\n" "\n" " Check whether a job of the given type is running.\n" "\n" " :arg job_type: job type in :ref:`rna_enum_wm_job_type_items`.\n" " :type job_type: str\n" " :return: Whether a job of the given type is currently running.\n" " :rtype: bool.\n")
 
static PyObject * bpy_app_is_job_running (PyObject *UNUSED(self), PyObject *args, PyObject *kwds)
 
static void py_struct_seq_getset_init (void)
 
static void py_struct_seq_method_init (void)
 
PyObject * BPY_app_struct (void)
 

Variables

char build_date [] = BUILD_DATE
 
char build_time [] = BUILD_TIME
 
ulong build_commit_timestamp = BUILD_COMMIT_TIMESTAMP
 
char build_commit_date [] = "\0"
 
char build_commit_time [] = "\0"
 
char build_hash [] = BUILD_HASH
 
char build_branch [] = BUILD_BRANCH
 
char build_platform [] = BUILD_PLATFORM
 
char build_type [] = BUILD_TYPE
 
char build_cflags [] = "unmaintained buildsystem alert!"
 
char build_cxxflags [] = "unmaintained buildsystem alert!"
 
char build_linkflags [] = "unmaintained buildsystem alert!"
 
char build_system [] = "unmaintained buildsystem alert!"
 
static PyTypeObject BlenderAppType
 
static PyStructSequence_Field app_info_fields []
 
static PyStructSequence_Desc app_info_desc
 
static PyGetSetDef bpy_app_getsets []
 
static struct PyMethodDef bpy_app_methods []
 

Detailed Description

This file defines a 'PyStructSequence' accessed via 'bpy.app', mostly exposing static applications variables such as version and buildinfo however some writable variables have been added such as 'debug' and 'tempdir'

Definition in file bpy_app.c.

Macro Definition Documentation

◆ SetBytesItem

#define SetBytesItem (   str)    PyStructSequence_SET_ITEM(app_info, pos++, PyBytes_FromString(str))

◆ SetIntItem

#define SetIntItem (   flag)    PyStructSequence_SET_ITEM(app_info, pos++, PyLong_FromLong(flag))

◆ SetObjItem

#define SetObjItem (   obj)    PyStructSequence_SET_ITEM(app_info, pos++, obj)

◆ SetStrItem

#define SetStrItem (   str)    PyStructSequence_SET_ITEM(app_info, pos++, PyUnicode_FromString(str))

Function Documentation

◆ bpy_app_autoexec_fail_message_get()

static PyObject* bpy_app_autoexec_fail_message_get ( PyObject *  UNUSEDself,
void UNUSEDclosure 
)
static

Definition at line 343 of file bpy_app.c.

References G, and PyC_UnicodeFromByte().

◆ bpy_app_debug_get()

static PyObject* bpy_app_debug_get ( PyObject *  UNUSEDself,
void closure 
)
static

Definition at line 224 of file bpy_app.c.

References G, and POINTER_AS_INT.

◆ bpy_app_debug_set()

static int bpy_app_debug_set ( PyObject *  UNUSEDself,
PyObject *  value,
void closure 
)
static

Definition at line 230 of file bpy_app.c.

References G, and POINTER_AS_INT.

◆ bpy_app_debug_value_get()

static PyObject* bpy_app_debug_value_get ( PyObject *  UNUSEDself,
void UNUSEDclosure 
)
static

Definition at line 293 of file bpy_app.c.

References G.

◆ bpy_app_debug_value_set()

static int bpy_app_debug_value_set ( PyObject *  UNUSEDself,
PyObject *  value,
void UNUSEDclosure 
)
static

◆ bpy_app_driver_dict_get()

static PyObject* bpy_app_driver_dict_get ( PyObject *  UNUSEDself,
void UNUSEDclosure 
)
static

Definition at line 324 of file bpy_app.c.

References bpy_pydriver_create_dict(), bpy_pydriver_Dict, and NULL.

◆ bpy_app_global_flag_get()

static PyObject* bpy_app_global_flag_get ( PyObject *  UNUSEDself,
void closure 
)
static

Definition at line 253 of file bpy_app.c.

References G, and POINTER_AS_INT.

◆ bpy_app_global_flag_set()

static int bpy_app_global_flag_set ( PyObject *  UNUSEDself,
PyObject *  value,
void closure 
)
static

Definition at line 259 of file bpy_app.c.

References G, and POINTER_AS_INT.

Referenced by bpy_app_global_flag_set__only_disable().

◆ bpy_app_global_flag_set__only_disable()

static int bpy_app_global_flag_set__only_disable ( PyObject *  UNUSEDself,
PyObject *  value,
void closure 
)
static

Definition at line 279 of file bpy_app.c.

References bpy_app_global_flag_set(), and NULL.

◆ bpy_app_is_job_running()

static PyObject* bpy_app_is_job_running ( PyObject *  UNUSEDself,
PyObject *  args,
PyObject *  kwds 
)
static

◆ bpy_app_preview_render_size_get()

static PyObject* bpy_app_preview_render_size_get ( PyObject *  UNUSEDself,
void closure 
)
static

Definition at line 338 of file bpy_app.c.

References POINTER_AS_INT, and UI_icon_preview_to_render_size().

◆ BPY_app_struct()

PyObject* BPY_app_struct ( void  )

◆ bpy_app_tempdir_get()

static PyObject* bpy_app_tempdir_get ( PyObject *  UNUSEDself,
void UNUSEDclosure 
)
static

Definition at line 316 of file bpy_app.c.

References BKE_tempdir_session, and PyC_UnicodeFromByte().

◆ make_app_info()

static PyObject* make_app_info ( void  )
static

◆ py_struct_seq_getset_init()

static void py_struct_seq_getset_init ( void  )
static

Definition at line 495 of file bpy_app.c.

References BlenderAppType, and bpy_app_getsets.

Referenced by BPY_app_struct().

◆ py_struct_seq_method_init()

static void py_struct_seq_method_init ( void  )
static

Definition at line 505 of file bpy_app.c.

References BlenderAppType, BLI_assert_msg, bpy_app_methods, and NULL.

Referenced by BPY_app_struct().

◆ PyDoc_STRVAR() [1/8]

PyDoc_STRVAR ( bpy_app_debug_doc  ,
Boolean,
for debug info(started with --debug/--debug_ *matching this attribute name)"   
)

◆ PyDoc_STRVAR() [2/8]

PyDoc_STRVAR ( bpy_app_debug_value_doc  ,
Short,
number which can be set to non-zero values for testing purposes"   
)

◆ PyDoc_STRVAR() [3/8]

PyDoc_STRVAR ( bpy_app_doc  ,
"This module contains application values that remain unchanged during runtime."   
)

◆ PyDoc_STRVAR() [4/8]

PyDoc_STRVAR ( bpy_app_driver_dict_doc  ,
"Dictionary for drivers  namespace,
editable in-  place,
reset on file load(read-only)"   
)

◆ PyDoc_STRVAR() [5/8]

PyDoc_STRVAR ( bpy_app_global_flag_doc  ,
Boolean,
for application behavior(started with --enable- *matching this attribute name)"   
)

◆ PyDoc_STRVAR() [6/8]

PyDoc_STRVAR ( bpy_app_is_job_running_doc  ,
".. staticmethod:: is_job_running(job_type)\n" "\n" " Check whether a job of the given type is running.\n" "\n" " :arg job_type: job type in :ref:`rna_enum_wm_job_type_items`.\n" " :type job_type: str\n" " :return: Whether a job of the given type is currently running.\n" " :rtype: bool.\n"   
)

◆ PyDoc_STRVAR() [7/8]

PyDoc_STRVAR ( bpy_app_preview_render_size_doc  ,
"Reference size for icon/preview renders (read-only)"   
)

◆ PyDoc_STRVAR() [8/8]

PyDoc_STRVAR ( bpy_app_tempdir_doc  ,
String,
the temp directory used by blender(read-only)"   
)

Variable Documentation

◆ app_info_desc

PyStructSequence_Desc app_info_desc
static
Initial value:
= {
"bpy.app",
bpy_app_doc,
}
#define ARRAY_SIZE(arr)
static PyStructSequence_Field app_info_fields[]
Definition: bpy_app.c:73

Definition at line 125 of file bpy_app.c.

Referenced by BPY_app_struct().

◆ app_info_fields

PyStructSequence_Field app_info_fields[]
static

Definition at line 73 of file bpy_app.c.

◆ BlenderAppType

PyTypeObject BlenderAppType
static

◆ bpy_app_getsets

PyGetSetDef bpy_app_getsets[]
static

Definition at line 348 of file bpy_app.c.

Referenced by py_struct_seq_getset_init().

◆ bpy_app_methods

struct PyMethodDef bpy_app_methods[]
static
Initial value:
= {
{"is_job_running",
(PyCFunction)bpy_app_is_job_running,
METH_VARARGS | METH_KEYWORDS | METH_STATIC,
bpy_app_is_job_running_doc},
{NULL, NULL, 0, NULL},
}
static PyObject * bpy_app_is_job_running(PyObject *UNUSED(self), PyObject *args, PyObject *kwds)
Definition: bpy_app.c:466

Definition at line 466 of file bpy_app.c.

Referenced by py_struct_seq_method_init().

◆ build_branch

char build_branch = BUILD_BRANCH
extern

Definition at line 35 of file buildinfo.c.

Referenced by make_app_info().

◆ build_cflags

char build_cflags = "unmaintained buildsystem alert!"
extern

Definition at line 46 of file buildinfo.c.

Referenced by make_app_info(), and print_version_full().

◆ build_commit_date

char build_commit_date = "\0"
extern

◆ build_commit_time

char build_commit_time = "\0"
extern

◆ build_commit_timestamp

unsigned long build_commit_timestamp = BUILD_COMMIT_TIMESTAMP
extern

Definition at line 32 of file buildinfo.c.

Referenced by main(), make_app_info(), and write_global().

◆ build_cxxflags

char build_cxxflags = "unmaintained buildsystem alert!"
extern

Definition at line 47 of file buildinfo.c.

Referenced by make_app_info(), and print_version_full().

◆ build_date

char build_date = BUILD_DATE
extern

◆ build_hash

char build_hash = BUILD_HASH
extern

◆ build_linkflags

char build_linkflags = "unmaintained buildsystem alert!"
extern

Definition at line 48 of file buildinfo.c.

Referenced by make_app_info(), and print_version_full().

◆ build_platform

char build_platform = BUILD_PLATFORM
extern

Definition at line 37 of file buildinfo.c.

Referenced by arg_handle_debug_mode_set(), make_app_info(), and print_version_full().

◆ build_system

char build_system = "unmaintained buildsystem alert!"
extern

Definition at line 49 of file buildinfo.c.

Referenced by make_app_info(), and print_version_full().

◆ build_time

char build_time = BUILD_TIME
extern

◆ build_type

char build_type = BUILD_TYPE
extern

Definition at line 38 of file buildinfo.c.

Referenced by arg_handle_debug_mode_set(), make_app_info(), and print_version_full().