Camera tracker does not output current rotations

I would like to report a strange camera parameter issue related to output of rotation vector, if camera is linked by constraint in pointing to object. Probably, this is a bug, or expected, but could somebody help me to fetch updated rotation of a TRACK_TO camera when moved.
Thank you,

A reproduced behaviour could be described as follows:
A scene is designed of one camera and one plane mesh object with name “Plane” (e.g. like in factory reset scene):
If a “TRACK_TO” constraint is added to a camera such like:
# Python script starts here:
scene =[0]
cam =[0]
camo =[] = camo = True
# Let’s print rotation pose of the camera object
# and location vector:
bpy.ops.object.constraint_add(type = ‘TRACK_TO’)
bpy.context.object.constraints[0].track_axis = ‘TRACK_NEGATIVE_Z’
bpy.context.object.constraints[0].up_axis = ‘UP_Y’
bpy.context.object.constraints[0].target =[‘Plane’]
camo.location.x = camo.location.x + 5
camo.location.y = camo.location.y - 3
camo.location.z = camo.location.z + 2
# The expected result would be a camera that is always directed to the object “Plane”, but
# It shows that rotation angles does not change as printed above, but
# location is changed:
# Is that a bug?
# Configuration: Blender version - 2.71, PC, Windows 64-bit, NVIDIA 760

gives you the euler rotation after all constraints.

oh, Thank you Florian

I was so desperate that i did my own script to calculate the angles of rotations:

lz = camo.location.z
ly = camo.location.y
lx = camo.location.x

deve = 90*math.pi/180
angle = math.atan(ly/lz)
angleb = math.atan(lx/ly)

if ly>0 and lz>0:
angle = -angle
if ly<0 and lz>0:
angle = -angle
if ly>0 and lz<0:
angle = 2deve-angle
if ly<0 and lz<0:
angle = 2
if lx<0 and ly<0:
angleb = angleb
if lx>0 and ly<0:
angleb = angleb
if lx<0 and lz>0:
angleb = angleb-2deve
if lx>0 and lz>0:
angleb = angleb-2

that works too :slight_smile:
have a look at the mathutils module. there is lots of usefull stuff in there for this kind of work.