From a05f95f347848932705c1f62e6f70775c3d0c3e8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 25 Feb 2007 12:41:50 +0000 Subject: Image.c * moved to getseters (use new generic ID funcs) * added 'reflect' attribute Text.c * moved to getseters (new generic ID funcs too) NLA.c * moved to getseters (ditto) Ipo.c * bugfix, allow nested loops on an IPO's curves. Blender.c * removed undocumented function RemoveFakeuser, since actions now have the fakeUser attribute. --- source/blender/python/api2_2x/Ipo.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source/blender/python/api2_2x/Ipo.c') diff --git a/source/blender/python/api2_2x/Ipo.c b/source/blender/python/api2_2x/Ipo.c index 87815e69c42..6f270839ce2 100644 --- a/source/blender/python/api2_2x/Ipo.c +++ b/source/blender/python/api2_2x/Ipo.c @@ -1556,8 +1556,13 @@ static int Ipo_contains( BPy_Ipo *self, PyObject *key ) static PyObject *Ipo_getIter( BPy_Ipo * self ) { - self->iter = 0; - return EXPP_incr_ret ( (PyObject *) self ); + /* return a new IPO object if we are looping on the existing one + This allows nested loops */ + if (self->iter==0) { + return EXPP_incr_ret ( (PyObject *) self ); + } else { + return Ipo_CreatePyObject(self->ipo); + } } /* @@ -1589,6 +1594,7 @@ static PyObject *Ipo_nextIter( BPy_Ipo * self ) } } + self->iter = 0; /* allow iter use again */ /* ran out of curves */ return EXPP_ReturnPyObjError( PyExc_StopIteration, "iterator at end" ); -- cgit v1.2.3