Why are bone axis and poseBone axis different?

Hi, I’m trying to write an exporter for a format in Blender. I’m actually stuck at bones and animations.

So here’s where my question comes. PoseBones transformations are made in their own axes. That’s ok, but I found something weird for me: the bone (PoseBone.bone) has different axes than the poseBone!


Another weird thing about it is that marking “Axes” in the Display properties of the Armature shows the poseBone axes, both in pose and edit mode:


So, what are the bone axes for?
The only relation I’ve found is that they are equal to the bone matrix, which (as far as I know) is relative to the bone parent.

Here is the whole armature:

The pbone matrix is in relative to the rest pose, and it is an identity matrix because you have no pose / transformation applied.

That’s matrix_basis. I was talking about x_axis, y_axis and z_axis.