I use Blender3D, but the answer might not API-exclusive.

I have some matrices I need to assign to PoseBones. The resulting pose looks fine when there is no bone hierarchy (parenting) and messed up when there is. enter image description here

I've uploaded an archive with sample blend of the rigged models, text animation importer and a test animation file here: http://www.2shared.com/file/5qUjmnIs/sample_files.html
Import the animation by selecting an Armature and running the importer on "sba" file. Do this for both Armatures.

This is how I assign the poses in the real (complex) importer:

matrix_bases = ... # matrix from file
animation_matrix = matrix_basis * pose.bones['mybone'].matrix.copy()
pose.bones[bonename].matrix = animation_matrix

If I go to edit mode, select all bones and press Alt+P to undo parenting, the Pose looks fine again.

The API documentation says the PoseBone.matrix is in "object space", but it seems clear to me from these tests that they are relative to parent bones.

Final 4x4 matrix after constraints and drivers are applied (object space)

I tried doing something like this:

matrix_basis = ... # matrix from file
animation_matrix = matrix_basis * (pose.bones['mybone'].matrix.copy()  * pose.bones[bonename].bone.parent.matrix_local.copy().inverted())
pose.bones[bonename].matrix = animation_matrix

But it looks worse. Experimented with order of operations, no luck with all.

For the record, in the old 2.4 API this worked like a charm:

matrix_basis = ... # matrix from file
animation_matrix = armature.bones['mybone'].matrix['ARMATURESPACE'].copy() * matrix_basis
pose.bones[bonename].poseMatrix = animation_matrix


Link to Blender API ref:



  • \$\begingroup\$ You could add intermediate bones, e.g. make a spine/snake of bones, forming a rigid hierarchy and using the intermediate bones to position the real bones. \$\endgroup\$
    – Exilyth
    Mar 2, 2013 at 20:53

1 Answer 1


I don't know if this is the correct answer (as I know relatively little about blender's behavior), but are the bones long enough? It kind of seems like the deformation is not being applied properly because of the way the bones are weighted. I am used to seeing other skeleton systems where the end of one bone touches the beginning of the next - here they appear to not connect.

  • \$\begingroup\$ In Blender connected bones also means parented bones. Connection signifies a hierarchy, so no... \$\endgroup\$
    – user17402
    Aug 5, 2012 at 8:15

You must log in to answer this question.