[Bf-python] Re: Bf-python digest, Vol 1 #260 - 2 msgs

Joseph Gilbert models at paposo.com
Sat Mar 20 08:00:16 CET 2004


I made some modifications to the files you provided.  I also added a script
to test. You can now add bones to the armature.
I didn't check everything. Some things: I don't think setChildren will be
necessary because when you add a bone you will need to
1.Create new bone,
2.set bone parameters (including PARENT)
3.add bone to armature.
When the bone is added to the armature with it's parent property set it is
added to the childlist of the parent bone.
I also fixed a bug with the Bone_New function. All calls to malloc (or
calloc) need calls to free in the dealloc function for the python object.
MEM_callocN will memset the bone.
Also the Object structure needed to be able to link armature data. Calling
getData() doesn't work anymore because the data parameter will be set to
NULL and ob.getData() will return none_type. So now by calling
Armature.New() you'll create a new armature datablock.
Object.New('Armature') will create an empty object of type armature, and
then object.link(armaturedata) will set up the object correctly.
Things to think about:
I didn't check about how unnamed bones are handled, etc.
Armatures/bones should probably have unique names (didn't check)
What about adding a list of bones to the armature instead of 1 at a time?
Anyway this should help. :) Keep up the good work.

Joseph
-------------- next part --------------
A non-text attachment was scrubbed...
Name: armature.zip
Type: application/x-zip-compressed
Size: 23984 bytes
Desc: not available
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20040320/8d7e4dbf/attachment.bin>


More information about the Bf-python mailing list