I'd like to extract the user view orientation of the current 3DView. Since I didn't find a direct command to get it, my approach would be to take its matrix using bpy.context.region_data.view_matrix.transposed()
and somehow convert it to a Euler rotation (ignoring its location), but I don't know how to do it.
Note that I'm not talking about a camera object but the user view.
mat.to_euler()
. Assuming your matrix is in the space you want, that should do the trick. $\endgroup$