From d15f2b562e3ead5c91c89da5c384e9359418e27a Mon Sep 17 00:00:00 2001 From: Tamito Kajiyama Date: Thu, 27 May 2010 21:12:09 +0000 Subject: Fixed the __call__ method of UnaryFunction0DVectorViewShape and UnaryFunction1DVectorViewShape. The __call__ method now returns a list whose elements are either a ViewShape or None. --- .../UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'source/blender/freestyle/intern/python/UnaryFunction0D') diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp index c0c3f700b65..7d9026a6c78 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp @@ -99,9 +99,17 @@ static PyObject * UnaryFunction0DVectorViewShape___call__( BPy_UnaryFunction0DVe return NULL; } PyObject *list = PyList_New(0); - - for( unsigned int i = 0; i < self->uf0D_vectorviewshape->result.size(); i++) - PyList_Append(list, BPy_ViewShape_from_ViewShape(*( self->uf0D_vectorviewshape->result[i] )) ); + PyObject *item; + for( unsigned int i = 0; i < self->uf0D_vectorviewshape->result.size(); i++) { + ViewShape *v = self->uf0D_vectorviewshape->result[i]; + if (v) { + item = BPy_ViewShape_from_ViewShape(*v); + } else { + item = Py_None; + Py_INCREF(item); + } + PyList_Append(list, item); + } return list; } -- cgit v1.2.3