forked from blender/blender
Move bpy_hydra.export_mtlx() exception handling to C code #28
@ -81,14 +81,16 @@ void MaterialData::init()
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
file_path = "";
|
file_path = "";
|
||||||
std::string err_str;
|
|
||||||
|
|
||||||
/* Clearing exception data */
|
/* Clearing and logging exception data */
|
||||||
PyObject *type, *value, *traceback;
|
PyObject *type, *value, *traceback, *pstr;
|
||||||
PyErr_Fetch(&type, &value, &traceback);
|
PyErr_Fetch(&type, &value, &traceback);
|
||||||
|
PyErr_NormalizeException(&type, &value, &traceback);
|
||||||
|
std::string err_str = ((PyTypeObject *)type)->tp_name;
|
||||||
if (value) {
|
if (value) {
|
||||||
PyObject *pstr = PyObject_Str(value);
|
PyObject *pstr = PyObject_Str(value);
|
||||||
err_str = PyUnicode_AsUTF8(pstr);
|
err_str += ": ";
|
||||||
|
err_str += PyUnicode_AsUTF8(pstr);
|
||||||
Py_DECREF(pstr);
|
Py_DECREF(pstr);
|
||||||
}
|
}
|
||||||
Py_XDECREF(traceback);
|
Py_XDECREF(traceback);
|
||||||
|
Loading…
Reference in New Issue
Block a user