# How to get XYZ euler rotation of 3DView?

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.

• Converting a matrix to euler is as simple as mat.to_euler(). Assuming your matrix is in the space you want, that should do the trick. – HENDRIX Jan 6 '18 at 15:04
• Wow that was so much simpler than I expected. Tank you – ChameleonScales Jan 6 '18 at 16:16

bpy.context.region_data.view_matrix.transposed().to_euler()