Move bpy_hydra.export_mtlx() exception handling to C code #28

Merged
Bogdan Nagirniak merged 9 commits from BLEN-392_pyerr_catch into hydra-render 2023-05-03 21:15:52 +02:00
Showing only changes of commit af70cf4253 - Show all commits

View File

@ -79,12 +79,15 @@ void MaterialData::init()
err_str += PyUnicode_AsUTF8(pstr); err_str += PyUnicode_AsUTF8(pstr);
Py_DECREF(pstr); Py_DECREF(pstr);
} }
CLOG_ERROR(
LOG_BSD, "Export error for %s (%s): %s", prim_id.GetText(), id->name, err_str.c_str());
if (traceback) {
PyTraceBack_Print(traceback, PySys_GetObject("stderr"));
}
Py_XDECREF(traceback); Py_XDECREF(traceback);
Py_XDECREF(value); Py_XDECREF(value);
Py_DECREF(type); Py_DECREF(type);
CLOG_ERROR(
LOG_BSD, "Export error for %s (%s): %s", prim_id.GetText(), id->name, err_str.c_str());
} }
Py_DECREF(module); Py_DECREF(module);