[Bf-committers] Re: [Bf-blender-cvs] CVS commit: blender/source/blender/python/api2_2x Mesh.h Mesh.c

Martin Poirier theeth at yahoo.com
Fri Sep 22 14:27:14 CEST 2006

--- Campbell Barton <cbarton at metavr.com> wrote:

> campbellbarton (Campbell Barton) 2006/09/22 12:08:41
>   Modified files:
>     blender/source/blender/python/api2_2x Mesh.h
> Mesh.c 
>   Log:
>   Mesh iterators (me.faces, me.edges, me.verts, face
> and edge iterator) store the iterator progress in
> the python object.
>   This made nested loops with the same python object
> mess up.
>   eg-
>   faces= me.faces
>   for f1 in faces:
>     for f2 in faces:
>       print f1.index,f2.index
>   This didnt work, fixed by initializing the iter
> value at -1, so any greater value will create a new
> BPyObject with its own iter value.
>   once iteration is finished, its set back to -1.

You mean it creates one BPy Mesh wrapper per iterator?

In that case, how do you invalidate iterators if the
mesh structure changes during the lifetime of the

>   Also made face and edges iter value a char instead
> of an int to save some memory.

Did you confirm that this did indeed reduce memory
usage? Memory alignement optimisation (or requirement)
would likely mess with it.


Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the Bf-committers mailing list