[Bf-python] Issue with obtaining children of an armature bone

Tron Thomas tron.thomas at verizon.net
Tue Dec 20 23:58:48 CET 2005


I don't know if children should return all descendants or not.  In the 
previous object model that existed, child related attributes did only 
return the immediate children.
How do other people feel about how this attribute should behave?
If the children attribute should return all descendants, what other 
method will exist for a person to understand and export the hierarchical 
relationships that exist between bones in the armature?

Gilbert, Joseph T. wrote:

>The bone.children attribute returns ALL the children under that bone. I
>guess it could just return the immediate children..... 
>
>-----Original Message-----
>From: bf-python-bounces at projects.blender.org
>[mailto:bf-python-bounces at projects.blender.org] On Behalf Of Tron Thomas
>Sent: Tuesday, December 20, 2005 3:43 PM
>To: bf-python at projects.blender.org
>Subject: [Bf-python] Issue with obtaining children of an armature bone
>
>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?
>
>
>_______________________________________________
>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