I’ve spent the last couple days reading through the 2.53 API as well as just about all the import scripts included with the windows release but still haven’t quite gotten where I need to. Before you say anything, yes, I’ve read the example script for armature creation on these forums, but it didn’t solve my problem.
Anyway, in 2.49, I could create a bone, link it to an armature object, parent it, then change the .head to the armature space coords, then change the .matrix to the armature space rotation matrix, like in the following code:
#Taken from ms3d_import.py in Blender 2.49 if bone.hasParent(): bone.head = Vector(pos) * bone.parent.matrix + bone.parent.head tempM = RM(rot) * bone.parent.matrix #tempM.transpose; bone.matrix = tempM else: bone.head = Vector(pos) bone.matrix = RM(rot) # set tail bvec = bone.tail - bone.head bvec.normalize() bone.tail = bone.head + 0.01 * bvec
All the import scripts for 2.53 only manipulate .head and .tail and I take it these are in armature coords (the API doesn’t specify afaik). EditBone.matrix is readonly from the docs, so… I guess my question is, how does one go about doing this same thing in 2.53? Any help would be greatly appreciated!