[Bf-python] Proposed BPyAPI Additions.

Martin Poirier theeth at yahoo.com
Thu Aug 31 18:43:24 CEST 2006


Hi,

Just a couple of comments on the proposed additions:

I like where you're going with the iterator protocol
implementation, however, I think some of the suggested
uses could be made a bit better. For example:

scn.objects.new(Types.Mesh): I thought we were moving
away from those factory-like methods and into the
realm of real object constructors? At least, get rid
of the constant and have something like
objects.newMesh(), then each object type method can be
documented separated. Moreover, with the constant, you
can't pass around object creators for specific type
without relying on curying (wrapping it to remove the
parameter).

scn.objects.selected should be an object set (just
like scn.objects) and you could use that to change the
selection (with add, remove, extend, ...)



For the rest, I don't quite like the DataBase name,
that thing is far from being a database implementation
and calling it that I think is might be a bit
confusing. I'd propose just calling it Data.

Blender.Data.objects and so on.



On the Constants topic, I know that was removed from
the proposal, but I really didn't like where it was
going for some reasons:
- A single constant module that is coupled with all
the others has very bad coupling and very low usage
cohesion. This should light a red light right away.
- Cramming all the constant in a single module will
quickly become overcrowded and if we're going to use
submodules to classify them, we might as well put it
where they belong (cohesion up, coupling down), that
is, right in their respective classes (mesh constant
in the Mesh class, edge constants in the edge class,
...).
- Moreover, what to do if we have the same functional
constant (does the same thing on two different object)
with different values. (for an hypothetical example:
if we have HardEdge on mesh = 1 and HardEdge on nurbs
= 2).


All in all, good ideas.

Martin

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Bf-python mailing list