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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2010-05-28 01:12:09 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2010-05-28 01:12:09 +0400
commitd15f2b562e3ead5c91c89da5c384e9359418e27a (patch)
tree69076e4c70c9088334d732c0085f5e77d0fcc056 /source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp
parent0ff5ea0df87f3fc871044208407e9c3852eab055 (diff)
Fixed the __call__ method of UnaryFunction0DVectorViewShape and
UnaryFunction1DVectorViewShape. The __call__ method now returns a list whose elements are either a ViewShape or None.
Diffstat (limited to 'source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp')
-rw-r--r--source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp
index 6493bcb13fb..e59aeefff52 100644
--- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp
+++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp
@@ -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;
}