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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user