diff options
Diffstat (limited to 'source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVoid.cpp')
-rw-r--r-- | source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVoid.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVoid.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVoid.cpp index d742b0f19d0..a353bf76213 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVoid.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVoid.cpp @@ -192,12 +192,16 @@ PyObject * UnaryFunction1DVoid___call__( BPy_UnaryFunction1DVoid *self, PyObject { PyObject *obj; - if( !PyArg_ParseTuple(args, "O!", &Interface1D_Type, &obj) ) { - cout << "ERROR: UnaryFunction1DVoid___call__ " << endl; + if( !PyArg_ParseTuple(args, "O!", &Interface1D_Type, &obj) ) return NULL; - } - self->uf1D_void->operator()(*( ((BPy_Interface1D *) obj)->if1D )); + if (self->uf1D_void->operator()(*( ((BPy_Interface1D *) obj)->if1D )) < 0) { + if (!PyErr_Occurred()) { + string msg(self->uf1D_void->getName() + " __call__ method failed"); + PyErr_SetString(PyExc_RuntimeError, msg.c_str()); + } + return NULL; + } Py_RETURN_NONE; } @@ -205,10 +209,8 @@ PyObject * UnaryFunction1DVoid_setIntegrationType(BPy_UnaryFunction1DVoid* self, { PyObject *obj; - if( !PyArg_ParseTuple(args, "O!", &IntegrationType_Type, &obj) ) { - cout << "ERROR: UnaryFunction1DVoid_setIntegrationType " << endl; - Py_RETURN_NONE; - } + if( !PyArg_ParseTuple(args, "O!", &IntegrationType_Type, &obj) ) + return NULL; self->uf1D_void->setIntegrationType( IntegrationType_from_BPy_IntegrationType(obj) ); Py_RETURN_NONE; |