blender api - get current location and rotation of camera tracking an object I have a camera with an object constraint to track an empty plain axes. I want to get the camera's current rotation, since when the axes move, or when the camera changes location, the camera rotates in order to track the axes.

however, when I read the value using  C.scene.camera.rotation_euler, the values never change, even though the camera clearly has rotated in order to follow the axes.

&gt;&gt;&gt; C.scene.camera.rotation_euler
Euler((-0.2408553957939148, -0.0, 0.0), 'XYZ')


How do I get the correct values of the camera rotation?
Use the matrices

Use the cameras matrices to get the visual transform.  For global transform use ob.matrix_world

&gt;&gt;&gt; C.scene.camera.matrix_world.to_euler()
Euler((1.1093189716339111, -0.0, 0.8149281740188599), 'XYZ')

&gt;&gt;&gt; C.scene.camera.matrix_local.to_euler()
Euler((1.1093189716339111, -0.0, 0.8149281740188599), 'XYZ')


The matrix can be decomposed to location, rotation and scale. The quaternion rotation can be converted to Euler if need be.

&gt;&gt;&gt; loc, rot, scale = C.scene.camera.matrix_world.decompose()
&gt;&gt;&gt; rot
Quaternion((0.7804827094078064, 0.483536034822464, 0.20870360732078552, 0.33687159419059753))

&gt;&gt;&gt; rot.to_euler()
Euler((1.1093189716339111, 4.011331711240018e-09, 0.8149281740188599), 'XYZ')