How to convert rotation_axis_angle to euler or quaternion via Python? For my script I need to get the same result that Array modifier produces with Object Offset. In particular, I need to calculate rotation difference between two objects' rotations despite their rotation_mode. Euler properties have .to_quaternion() method, Quaternion properties have .to_euler() method, so there's no problem here. But Axis Angle... well, there's no such property as AxisAngle in mathutils, and bpy.context.object.rotation_axis_angle. doesn't provide any methods for converting itself either to euler or to quaterion rotation, as well as Euler and Quaternion don't have methods to convert themselves into an Axis Angle. Any idea of how it can be done via Python script? Is it something about getting global rotation using objects' evaluated depsgraph and matrices and then converting to something comparable or maybe is there an easier way I'm missing?
Via mathutils.Matrix.Rotation constructor.
Given an axis angle rotation provides just that, can make a matrix from the components.
Matrix.Rotation(angle, size, axis)
&gt;&gt;&gt; q
Quaternion((0.44383183121681213, -0.3263395428657532, 0.8345092535018921, 0.010497181676328182))
&gt;&gt;&gt; axis, angle = q.to_axis_angle()
&gt;&gt;&gt; R = Matrix.Rotation(angle, 4, axis) # or size 3
&gt;&gt;&gt; R.to_quaternion()
Quaternion((0.44383174180984497, -0.3263395428657532, 0.8345093727111816, 0.010497150011360645))