[Bf-python] scripting comparison and portability

Gilbert, Joseph jgilbert at tigr.ORG
Fri Aug 12 17:21:13 CEST 2005


Thank you toni good link,

Currently the Armature module (that's in process) has a psudo-dictionary
called 'bones' which manages all the py_bone objects in the armature.
This allows for some interesting behavior. It allows you to call bones
by index like this:
Amature.bones['bone1'].attribute

As for adding bones you can pass a dictionary (much like 'property
indices in zspheres)
b = {'mode':'blah', 'head':vec1, 'parent': index}
Armature.bones['newbone'] = b

There are some restrictions (yet to be built) that the armature must be
in editmode (because blender does it this way :) - like zSphereEdit I
guess) to perform addition/removal of bones (which is the reason for the
psudo-dictionary)

print Armature.bones.keys()
for key, bone in Armature.bones.items():
...if key == 'mybone' and bone is not None:
......bone.attribute = x

I don't think we have ever considered a timestamp on object creation but
it sounds interesting. I think the only problem with it is that blender
doesn't support it internally and would only tell you the time when the
python object was created. :/

-----Original Message-----
From: bf-python-bounces at projects.blender.org
[mailto:bf-python-bounces at projects.blender.org] On Behalf Of Tom M
Sent: Friday, August 12, 2005 1:25 AM
To: Blender Foundation Python list
Subject: Re: [Bf-python] scripting comparison and portability

Hi Toni,

> iirc someone who had been using Maya before commented that Blender is
better to program  because Python is nicer than MEL, in some session at

I'm not talking about which language bindings (Ie Python, JavaScript,
Perl, or custom scripting languages such as MEL or ZBrushes), but what
the API offers in terms of functionality.

For instance there really isn't a blender equivalent of the ZBrush
strokes.

(I found a bit of information on parsing the zbrush canvas stroke
strings -

http://206.145.80.239/zbc/showthread.php?t=728
)

Another interesting bit was there method of establishing parent child
relationships and using timestamp info for conncurrently created
zspheres and their interface for accessing child spheres. (which would
be useful for accessing bones in blender...)

> btw: what do you mean with portability? having same tools work in many
> apps? i guess that's basically possible at least for simple things..
if
> there's be some abstraction layer, but dunno if it'd be feasible
really
> for usefull things (am looking forward to be proven wrong by existing
> implementations ;)

Portability in terms of what the API exposes to usage by the
programmer, what sort of common utility functions are exposed, what
sort of variables are exposed for manipulation, etc.

LetterRip
_______________________________________________
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