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 59aeea175c - Show all commits

View File

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