[Bf-python] integrating lib iter types

Ed Blake kitsune_e at yahoo.com
Mon Feb 26 19:17:34 CET 2007


Maybe put the __iter__ method in the submodules?

Ex.
obj = Blender.Object.New('Empty', 'test')
# or
for obj in Blender.Object:print obj.name

Modules are (seem like?) just objects, no reason (in theory) they can't have
an __iter__ method right?

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

> Hi, recently I added Blender.Main that gives access to iterator types 
> for all kinds...
> 
>
http://wiki.blender.org/index.php?title=User:Ideasman42#Post_2.43_Update_to_the_Python_API
> 
> Willain suggested Blender.Main.scenes, meshes, objects etc could be 
> moved to Blender.*
> 
> so you could do this.
> 
> for mesh in Blender.meshes: print mesh
> 
> and...
> 
> scn = Blender.scenes.active
> 
> and...
> 
> arm = Blender.armatures['my_arm']
> 
> 
> This seems more logical to me then "Blender.Main.scenes"
> 
> Any thoughts as to weather this is desirable, and when it might be done?
> 
> Main negitive is "Blender.Object" and "Blender.objects" are fairly 
> similar...
> 
> 
> 
> 
> 
> -- 
> Campbell J Barton
> 
> 133 Hope Street
> Geelong West, Victoria 3218 Australia
> 
> URL:    http://www.metavr.com
> e-mail: cbarton at metavr.com
> phone: AU (03) 5229 0241
> _______________________________________________
> Bf-python mailing list
> Bf-python at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-python
> 




More information about the Bf-python mailing list