Fixed the __call__ method of UnaryFunction0DVectorViewShape and

UnaryFunction1DVectorViewShape.  The __call__ method now returns
a list whose elements are either a ViewShape or None.
This commit is contained in:
2010-05-27 21:12:09 +00:00
parent 0ff5ea0df8
commit d15f2b562e
2 changed files with 22 additions and 6 deletions

View File

@@ -129,9 +129,17 @@ static PyObject * UnaryFunction1DVectorViewShape___call__( BPy_UnaryFunction1DVe
return NULL;
}
PyObject *list = PyList_New(0);
for( unsigned int i = 0; i < self->uf1D_vectorviewshape->result.size(); i++)
PyList_Append(list, BPy_ViewShape_from_ViewShape(*( self->uf1D_vectorviewshape->result[i] )) );
PyObject *item;
for( unsigned int i = 0; i < self->uf1D_vectorviewshape->result.size(); i++) {
ViewShape *v = self->uf1D_vectorviewshape->result[i];
if (v) {
item = BPy_ViewShape_from_ViewShape(*v);
} else {
item = Py_None;
Py_INCREF(item);
}
PyList_Append(list, item);
}
return list;
}