From a16998911b59956806000826c15a941c53bd33c1 Mon Sep 17 00:00:00 2001 From: Tamito Kajiyama Date: Sun, 2 Feb 2014 21:59:15 +0900 Subject: Freestyle: Fix for iterations over 0D elements in the reversed order. The revision is concerned with Interface0DIterator and StrokeVertexIterator. These iterators can be generated by Interface1D::vertices_end() and Stroke::stroke_vertices_end(), respectively. These methods return an iterator poinitng the next index of the last 0D element (i.e., iterator's is_end property is true). When the iterators created in this way are used with Python's iterator protocol (e.g., in a for-loop), iterations over 0D elements are automatically performed in the reversed order. This functionality was broken after recent revisions concerning Freestyle iterators. Also made minor code cleanup (white space). --- .../intern/python/Iterator/BPy_Interface0DIterator.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp') diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp index c7c9e34eb1d..f85bcddf186 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp @@ -108,15 +108,7 @@ static PyObject *Interface0DIterator_iternext(BPy_Interface0DIterator *self) PyErr_SetNone(PyExc_StopIteration); return NULL; } - if (self->at_start) - self->at_start = false; - else { - self->if0D_it->decrement(); - if (self->if0D_it->isBegin()) { - PyErr_SetNone(PyExc_StopIteration); - return NULL; - } - } + self->if0D_it->decrement(); } else { if (self->if0D_it->isEnd()) { -- cgit v1.2.3