# How to get the location of head bone relative to parent's head bone

In my python script I want to get the location of the head of the bone, in the parent's local matrix. This means that the equation:

b.head_local = b.parent_n.local_matrix * .... * b.parent.local_matrix * searched


I know bone.head but it seems this is sometimes relative to the tail of the parent. I say sometimes because I can't figure out when this is the case.

Can someone help me out with this? An alternative way to get the searched coordinates would help out as well.

EDIT: I don't understand the variables that blender offers on bones at all. None of them except bone.head_local and bone.tail_local. If someone could explain them that would be honorable.

• Do you want to get the position? – someonewithpc Aug 27 '14 at 15:04
• The position in the parent's matrix aka. parmatrix * pos = somepos and if that pos is then again multiplied with the parent's parent, etc... until no parent exists that position would be the armature-local position – WorldSEnder Aug 27 '14 at 15:07