[Bf-python] Proposed BPyAPI Additions.

Willian Padovani Germano wgermano at superig.com.br
Fri Dec 15 19:53:22 CET 2006


Hi, Campbell

Python dictionaries do it, so it's a good place to start looking for 
ideas. I just saw the error msg here (function dictiter_iternextkey ) :

http://svn.python.org/view/python/trunk/Objects/dictobject.c?rev=52550&view=markup

Will spend some time on this weekend, to learn more about the possibilities.

Campbell Barton wrote:
> Hey Willian,
> I dont think we can stop people from adding new objects while iterating.
> 
> I thaught doing somthing like only allowing to add a new object when the 
> the pypypes  "iter" value is NULL
> would be ok but  it wont work if you break early.
>  
> I think the only way it can be done is to use a refcounter on the scene 
> that lets python know how many scn.objects  there are iterating (can 
> increment on getIter), and only if its 0, let the user add objects.
> 
> All up I dont think its the biggest of our problems, but interested to 
> see if theres another way to do this.

It's important but probably not a show-stopper. If we can't find a good 
way now, it can be done later, as long as the docs clearly tell users 
not to add/remove objects inside loops.

-- 
Willian



More information about the Bf-python mailing list