[Bf-python] More Proposed API changes.
Martin Poirier
theeth at yahoo.com
Thu Mar 8 20:27:23 CET 2007
--- Willian Padovani Germano <wgermano at superig.com.br>
wrote:
> Campbell Barton wrote:
> > Just we can do this whilst keeping the same
> files, 3 modified lines of
> > code will do this.
> >> 3) Move Blender.Main.* into Blender.*
> >> Willain suggested we discuss this on the list.
> >>
> >> So there wouldbe Blender.scenes,
> Blender.meshes etc...
> >>
> >> This would be ifdef'd in a way that it could
> be easily omitted from
> >> next release if people arnt keen on having it
> there.
>
> As Campbell mentions, this is something we should
> discuss.
>
> Currently there's the new Blender.Main module, from
> which we can access
> iterators for scenes, objects, meshes, etc. right
> from G.main, for those
> familiar with Blender C internals.
>
> "Main" doesn't seem like a good name to me. It makes
> perfect sense for
> Blender devs, but possibly none for everyone else.
>
> So we can:
>
> 1) Put these iterators directly in the Blender
> module: Blender.scenes,
> Blender.meshes, etc.
>
> Handy, but what I grew to dislike is conceptual:
> scene, meshes, etc. are
> data belonging to a .blend file (which, actually, is
> the current one in
> memory), let's say, they don't belong to "Blender"
> itself. In practice,
> we note that e.g. Blender.meshes simply changes if
> we load another
> .blend file.
>
> So having something like Blender.blend.meshes, etc.
> may be a better
> idea, specially if we automatically add it to
> Python's main dictionary
> upon starting Blender. Users could then simply type
> things like:
>
> blend.meshes['Cube'].LocX = 10.0
> scene = blend.scenes.active
> print scene.name
>
> And we may be able to find a nice way to extend this
> "blend" idea to
> support other .blend files.
I like the "blend" idea.
Martin
____________________________________________________________________________________
Food fight? Enjoy some healthy debate
in the Yahoo! Answers Food & Drink Q&A.
http://answers.yahoo.com/dir/?link=list&sid=396545367
More information about the Bf-python
mailing list