diff options
Diffstat (limited to 'source/blender/freestyle/intern/python/UnaryFunction1D')
2 files changed, 6 insertions, 12 deletions
diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp index a028952fa69..c15d974e771 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp @@ -142,18 +142,12 @@ static PyObject *UnaryFunction1DVectorViewShape___call__(BPy_UnaryFunction1DVect } return NULL; } - PyObject *list = PyList_New(0); - PyObject *item; - for (unsigned int i = 0; i < self->uf1D_vectorviewshape->result.size(); i++) { + + const unsigned int list_len = self->uf1D_vectorviewshape->result.size(); + PyObject *list = PyList_New(list_len); + for (unsigned int i = 0; i < list_len; 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); + PyList_SET_ITEM(list, i, v ? BPy_ViewShape_from_ViewShape(*v) : (Py_INCREF(Py_None), Py_None)); } return list; diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp index 517b07f5c7f..041bb60b507 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp @@ -63,7 +63,7 @@ static char GetDirectionalViewMapDensityF1D___doc__[] = "\n" " Returns the density evaluated for an Interface1D in of the steerable\n" " viewmaps image. The direction telling which Directional map to choose\n" -" is explicitely specified by the user. The density is evaluated for a\n" +" is explicitly specified by the user. The density is evaluated for a\n" " set of points along the Interface1D (using the\n" " :class:`freestyle.functions.ReadSteerableViewMapPixelF0D` functor) and\n" " then integrated into a single value using a user-defined integration\n" |