diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-05-18 19:57:51 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-05-18 19:57:51 +0400 |
commit | 25e740f29d7f82b5e997fb9397092ad4321d48f7 (patch) | |
tree | 8853e4cb2c1564d95a51b19ee665100f5462b52d /source | |
parent | 88743740b8d0506501e2183a97e357a5f05b2b92 (diff) |
bpy.app.background - so a python script can check if blender is running without a UI
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/python/intern/bpy_app.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c index 15c6ad09e69..4a2ac0c9252 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -46,6 +46,7 @@ static PyStructSequence_Field app_info_fields[] = { {"home", "The blender home directory, normally matching $HOME"}, {"binary_path", "The location of blenders executable, useful for utilities that spawn new instances"}, {"debug", "Boolean, set when blender is running in debug mode (started with -d)"}, + {"background", "Boolean, True when blender is running without a user interface (started with -b)"}, /* buildinfo */ {"build_date", "The date this blender instance was built"}, @@ -60,7 +61,7 @@ static PyStructSequence_Desc app_info_desc = { "bpy.app", /* name */ "This module contains application values that remain unchanged during runtime.", /* doc */ app_info_fields, /* fields */ - 10 + (sizeof(app_info_fields)/sizeof(PyStructSequence_Field)) - 1 }; static PyObject *make_app_info(void) @@ -87,6 +88,7 @@ static PyObject *make_app_info(void) SetStrItem(BLI_gethome()); SetStrItem(bprogname); SetObjItem(PyBool_FromLong(G.f & G_DEBUG)); + SetObjItem(PyBool_FromLong(G.background)); /* build info */ #ifdef BUILD_DATE |