Blender  V2.93
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 "DNA_ID.h"
#include "UI_interface_icons.h"
#include "WM_api.h"
#include "WM_types.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_binary_path_python_doc, "String, the path to the python executable (read-only). " "Deprecated! Use ``sys.executable`` instead.")
 
static PyObject * bpy_app_binary_path_python_get (PyObject *UNUSED(self), void *UNUSED(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))
 
static void py_struct_seq_getset_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 []
 

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 359 of file bpy_app.c.

References G, and PyC_UnicodeFromByte().

◆ bpy_app_binary_path_python_get()

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

Definition at line 301 of file bpy_app.c.

◆ bpy_app_debug_get()

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

Definition at line 231 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 237 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 309 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 340 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 260 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 266 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 286 of file bpy_app.c.

References bpy_app_global_flag_set(), and NULL.

◆ bpy_app_preview_render_size_get()

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

Definition at line 354 of file bpy_app.c.

References POINTER_AS_INT, and UI_icon_preview_to_render_size().

◆ BPY_app_struct()

PyObject* BPY_app_struct ( void  )

Definition at line 488 of file bpy_app.c.

References app_info_desc, BlenderAppType, make_app_info(), NULL, py_struct_seq_getset_init(), and ret.

Referenced by BPy_init_modules().

◆ bpy_app_tempdir_get()

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

Definition at line 332 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 477 of file bpy_app.c.

References BlenderAppType, and bpy_app_getsets.

Referenced by BPY_app_struct().

◆ PyDoc_STRVAR() [1/8]

PyDoc_STRVAR ( bpy_app_binary_path_python_doc  ,
String,
the path to the python executable(read-only). " "Deprecated! Use ``sys.executable`` instead."   
)

◆ PyDoc_STRVAR() [2/8]

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

◆ PyDoc_STRVAR() [3/8]

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

◆ PyDoc_STRVAR() [4/8]

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

◆ PyDoc_STRVAR() [5/8]

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

◆ PyDoc_STRVAR() [6/8]

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

◆ 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:83

Definition at line 132 of file bpy_app.c.

Referenced by BPY_app_struct().

◆ app_info_fields

PyStructSequence_Field app_info_fields[]
static

Definition at line 83 of file bpy_app.c.

◆ BlenderAppType

PyTypeObject BlenderAppType
static

Definition at line 81 of file bpy_app.c.

Referenced by BPY_app_struct(), make_app_info(), and py_struct_seq_getset_init().

◆ bpy_app_getsets

PyGetSetDef bpy_app_getsets[]
static

Definition at line 364 of file bpy_app.c.

Referenced by py_struct_seq_getset_init().

◆ build_branch

char build_branch = BUILD_BRANCH
extern

Definition at line 51 of file buildinfo.c.

Referenced by make_app_info().

◆ build_cflags

char build_cflags = "unmaintained buildsystem alert!"
extern

Definition at line 62 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 48 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 63 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 64 of file buildinfo.c.

Referenced by make_app_info(), and print_version_full().

◆ build_platform

char build_platform = BUILD_PLATFORM
extern

Definition at line 53 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 65 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 54 of file buildinfo.c.

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