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:
Diffstat (limited to 'source/blender/python/api2_2x/Ipo.c')
-rw-r--r--source/blender/python/api2_2x/Ipo.c10
1 files changed, 8 insertions, 2 deletions
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" );