Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-01-03 02:14:01 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-01-03 02:14:01 +0300
commit04d0261c37ccd28e8466312f5a2d8260c5a4c9e9 (patch)
tree1e86df8239609c76f93d2cc15f65db27aeceef3d /source/blender/python/intern/bpy_interface.c
parente7d863cee530d477f0aa494a4f0f9e70ac5012c7 (diff)
new python submodule. eg.
from bpy.app import binary_path, version, version_string, home can add constant variables from blender here as needed (maybe functions too... bpy.app.memory_usage() ?)
Diffstat (limited to 'source/blender/python/intern/bpy_interface.c')
-rw-r--r--source/blender/python/intern/bpy_interface.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index 5ac3a233e11..2fcb36f6d5b 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -223,12 +223,15 @@ static void bpy_init_modules( void )
/* blender info that wont change at runtime, add into _bpy */
{
+ extern char bprogname[]; /* argv[0] from creator.c */
+
PyObject *mod_dict= PyModule_GetDict(mod);
char tmpstr[256];
PyModule_AddStringConstant(mod, "_HOME", BLI_gethome());
PyDict_SetItemString(mod_dict, "_VERSION", Py_BuildValue("(iii)", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION));
sprintf(tmpstr, "%d.%02d (sub %d)", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION);
PyModule_AddStringConstant(mod, "_VERSION_STR", tmpstr);
+ PyModule_AddStringConstant(mod, "_BINPATH", bprogname);
}
/* add our own modules dir, this is a python package */