diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-12-08 13:03:17 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-12-08 13:03:17 +0400 |
commit | 46f8dba4c783fe5d174bd47a70710f9d7f0aeb07 (patch) | |
tree | 7998b9664bb00612501243ca20c0c9ddc7b5a0e9 /intern/cycles/blender/blender_python.cpp | |
parent | 55416f435ab9043df13b23e3e5244003d05d69bf (diff) |
Extend system-info with information about OIIO, OCIO and OSL
Summary:
Version of those libraries might be useful to know.
- OIIO and OCIO is exposed via bpy.app.oiio and bpy.app.ocio.
There're "supported", "version" and "version_string" defined
in those modules.
- OSL is available as _cycles.osl_version and _cycles.osl_version_string.
Reviewers: campbellbarton
Reviewed By: campbellbarton
CC: dingto
Differential Revision: http://developer.blender.org/D79
Diffstat (limited to 'intern/cycles/blender/blender_python.cpp')
-rw-r--r-- | intern/cycles/blender/blender_python.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp index 8e6bcaee350..f10b185287d 100644 --- a/intern/cycles/blender/blender_python.cpp +++ b/intern/cycles/blender/blender_python.cpp @@ -475,11 +475,25 @@ void *CCL_python_module_init() PyObject *mod = PyModule_Create(&ccl::module); #ifdef WITH_OSL + /* TODO(sergey): This gives us library we've been linking against. + * In theory with dynamic OSL library it might not be + * accurate, but there's nothing in OSL API which we + * might use th get version in runtime. + */ + int curversion = OSL_LIBRARY_VERSION_CODE; PyModule_AddObject(mod, "with_osl", Py_True); Py_INCREF(Py_True); + PyModule_AddObject(mod, "osl_version", + Py_BuildValue("(iii)", + curversion / 10000, (curversion / 100) % 100, curversion % 100)); + PyModule_AddObject(mod, "osl_version_string", + PyUnicode_FromFormat("%2d, %2d, %2d", + curversion / 10000, (curversion / 100) % 100, curversion % 100)); #else PyModule_AddObject(mod, "with_osl", Py_False); Py_INCREF(Py_False); + PyModule_AddStringCOnstant(mod, "osl_version", "unknown"); + PyModule_AddStringCOnstant(mod, "osl_version_string", "unknown"); #endif #ifdef WITH_NETWORK |