[Bf-python] New here but...
Stephen Swaney
sswaney at swbell.net
Mon Jun 7 23:16:08 CEST 2004
Since I am guilty of encouraging you, I should probably
jump in here too.
a side note as I understand it Bpython used to be partly coded in
Python? Can I ask why this changed (or for a link to the relevant
information)?
Nope. This has never been true, iirc. We used to have a
short article describing the bpy architecture and its
rationale in the development CMS area, but it may have
gotten unpublished.
It seems to me from the outside that it would be much more useful if the
Bpython modules were actually in written in Python.
I just did a
short test and it seems I cannot inherit from Blender classes.
The short answer is that you can't interface with blender's
C code using Python directly. It isn't a question of
usefulness, it is a question of how Python gets embedded and
extended. This has to be done in a language that can be
compiled and linked with the Python C code. The easiest way
to do this is to use C or C++. There are some very nice
guides on how to do this at python.org if you are interested
in the technical details.
Discussion of blender3 has centered around implementing
blender as a Python extension. This would allow more features
to be implemented as python scripts.
The reason you can't inherit from a bpy class is becaue
they are actually Python types and not classes. At one time,
Python drew a very clear line between types and classes and
what you could do with either. An example of this is the
UserDict used as a base class for user defined classes as
opposed to the Dict type.
This distinction is slowly being removed in Python as types
and classes are unified. Eventually, it will no doubt also go
away in bpy.
People who understand Object Oriented development know that
composition is often a more useful technique than inheritance
for creating classes. The bpy types can be used as members
in your user-defined classes.
Back
to what I am supposed to be doing, would it be helpful to have examples
at the class, or method level instead of just at the module level?
When I'm using the API reference I look at the documentation to know what
is available, but I look at the examples to know how things work.
Does anyone else think this would be useful?<o:p></o:p></span>
Definitely. More examples anywhere would be good. This would
help bridge the gap between developers and users.
I've seen posts like this on other forums/newsgroups, and they always seem
to go horribly wrong for the person who posted them. The people who
have worked so many hard hours creating their software seem to get very
PO?d when someone comes in out of nowhere and starts saying how they think
it should be done. Hopefully my willingness
to actually do the things I?m proposing will help take some of the edge
off your anger, but I am bracing myself none the less.
Certainly anyone who has created something takes some pride
in their creation. However, any design is a compromise and
there are many ways to cook a rat. I think what people find
annoying is when someone with an incomplete understanding of
a problem comes in and tells everyone they are going about
it all wrong. Self-righteousness is seldom a convincing
argument.
One thing I have seen over and over on projects is when
The New Guy comes on board and asks "How come you didn't
do X?". The answer is almost always that X was the first
thing we all thought of ( because programmers do think along
the same lines ), but we rejected it for the following
N reasons. The New Guy invariably says, "Yeah, I see that now".
The Bpy team is a pretty civilized group and new ideas are
welcome. Especially good ones. And do feel free to ask
questions.
The only snarly remark I would make is 'stop sending
damn html mail to the mailing list' but even that would be
said with a friendly grin.
--
Stephen Swaney
sswaney at swbell.net
More information about the Bf-python
mailing list