Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp')
-rw-r--r--source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp
index 0006aa80d9d..10f3e493244 100644
--- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp
+++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp
@@ -160,13 +160,17 @@ PyObject * UnaryFunction0DMaterial___call__( BPy_UnaryFunction0DMaterial *self,
{
PyObject *obj;
- if(!PyArg_ParseTuple(args, "O!", &Interface0DIterator_Type, &obj)) {
- cout << "ERROR: UnaryFunction0DMaterial___call__ " << endl;
+ if(!PyArg_ParseTuple(args, "O!", &Interface0DIterator_Type, &obj))
return NULL;
- }
- FrsMaterial m( self->uf0D_material->operator()(*( ((BPy_Interface0DIterator *) obj)->if0D_it )) );
- return BPy_FrsMaterial_from_FrsMaterial( m );
+ if (self->uf0D_material->operator()(*( ((BPy_Interface0DIterator *) obj)->if0D_it )) < 0) {
+ if (!PyErr_Occurred()) {
+ string msg(self->uf0D_material->getName() + " __call__ method failed");
+ PyErr_SetString(PyExc_RuntimeError, msg.c_str());
+ }
+ return NULL;
+ }
+ return BPy_FrsMaterial_from_FrsMaterial( self->uf0D_material->result );
}