I use this simple python script to export bones transformation:
bones = armature.pose.bones
# for eaach bone in bones
SystemMatrix = Matrix.Scale(-1, 4, Vector((0, 0, 1))) * Matrix.Rotation(radians(-90), 4, 'X')
if (bone.parent):
Export_babylon.write_matrix4(file_handler, "matrix", bone.parent.matrix.inverted() * bone.matrix)
else:
Export_babylon.write_matrix4(file_handler, "matrix", SystemMatrix * bone.matrix)
I'm using a left handed Y up system but I should forget something about rotation because the result is not correct :(
Original (under Blender):