diff options
Diffstat (limited to 'source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec3f.cpp')
-rw-r--r-- | source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec3f.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec3f.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec3f.cpp index 2b2808947f8..99fb88b3b61 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec3f.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec3f.cpp @@ -177,13 +177,17 @@ PyObject * UnaryFunction1DVec3f___call__( BPy_UnaryFunction1DVec3f *self, PyObje { PyObject *obj; - if( !PyArg_ParseTuple(args, "O!", &Interface1D_Type, &obj) ) { - cout << "ERROR: UnaryFunction1DVec3f___call__ " << endl; + if( !PyArg_ParseTuple(args, "O!", &Interface1D_Type, &obj) ) return NULL; - } - Vec3f v( self->uf1D_vec3f->operator()(*( ((BPy_Interface1D *) obj)->if1D )) ); - return Vector_from_Vec3f( v ); + if (self->uf1D_vec3f->operator()(*( ((BPy_Interface1D *) obj)->if1D )) < 0) { + if (!PyErr_Occurred()) { + string msg(self->uf1D_vec3f->getName() + " __call__ method failed"); + PyErr_SetString(PyExc_RuntimeError, msg.c_str()); + } + return NULL; + } + return Vector_from_Vec3f( self->uf1D_vec3f->result ); } @@ -191,10 +195,8 @@ PyObject * UnaryFunction1DVec3f_setIntegrationType(BPy_UnaryFunction1DVec3f* sel { PyObject *obj; - if( !PyArg_ParseTuple(args, "O!", &IntegrationType_Type, &obj) ) { - cout << "ERROR: UnaryFunction1DVec3f_setIntegrationType " << endl; - Py_RETURN_NONE; - } + if( !PyArg_ParseTuple(args, "O!", &IntegrationType_Type, &obj) ) + return NULL; self->uf1D_vec3f->setIntegrationType( IntegrationType_from_BPy_IntegrationType(obj) ); Py_RETURN_NONE; |