diff options
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 |