[Bf-python] Issue with obtaining children of an armature bone
Tron Thomas
tron.thomas at verizon.net
Tue Dec 20 21:43:15 CET 2005
I am interested in writing a Python Blender exporter to export skeletal
animation information. I have been using the latest development code
base to become familiar with the new implementation that will be
available for the armature, bones, etc.
I was working with code I synched up with on Monday, December 19th, and
I was trying to export an armature in rest position. Getting this type
of information is vastly improved over what existed in last release of
Blender. Despite the improvements, I ran across a serious problem that
prevented the export from working successfully.
I discovered that when I try to obtain the children for a particular
bone, instead of getting only the immediate children, I get all
descendants from that bone, and I had no way to know how all these
descendants were hierarchically related. I did some investigate into
the code base. I discovered that if I removed the last if statement
inside the for loop of the PyBone_ChildrenAsList function contained in
Bone.c, I was able to successfully export the skeletal information.
I'm wondering whether the existence of this particular if statement is a
bug in the code. I don't know if removing the statement breaks anything
or why it was added to the function.
It seems that the children attribute of a bone is intended to only
return the immediate children of that bone. How correct is this
assumption? If the children attribute is intended to provide all bone
descendants, how can someone determine the hierarchical relation of
bones in the armature?
More information about the Bf-python
mailing list