diff options
Diffstat (limited to 'source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.cpp')
-rw-r--r-- | source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.cpp b/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.cpp index b00422a0aab..54731d75d7b 100644 --- a/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.cpp +++ b/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.cpp @@ -1,6 +1,7 @@ #include "BPy_UnaryPredicate1D.h" #include "BPy_Convert.h" +#include "BPy_Interface1D.h" #ifdef __cplusplus extern "C" { @@ -124,6 +125,7 @@ PyMODINIT_FUNC UnaryPredicate1D_Init( PyObject *module ) int UnaryPredicate1D___init__(BPy_UnaryPredicate1D *self, PyObject *args, PyObject *kwds) { + self->up1D = new UnaryPredicate1D(); return 0; } @@ -147,14 +149,17 @@ PyObject * UnaryPredicate1D_getName( BPy_UnaryPredicate1D *self, PyObject *args) PyObject * UnaryPredicate1D___call__( BPy_UnaryPredicate1D *self, PyObject *args) { - PyObject *l; + PyObject *py_if1D; - if( !PyArg_ParseTuple(args, "O", &l) ) { + if(!( PyArg_ParseTuple(args, "O", &py_if1D) && BPy_Interface1D_Check(py_if1D) )) { cout << "ERROR: UnaryPredicate1D___call__ " << endl; return NULL; } - //TBD + Interface1D *if1D = ((BPy_Interface1D *) py_if1D)->if1D; + + if( if1D ) + return PyBool_from_bool( self->up1D->operator()(*if1D) ); Py_RETURN_NONE; } |