I’m export a mesh for use in some software where Y is up, not Z. This is the code I’ve come up with but honestly I’m not really sure it’s correct. I’m not getting correct results on export and wondering if this is part of the problem.
new_matrix = bone.matrix_local @ Matrix.Rotation(1.5707963267948966, 4, 'Z')