['Camera'].rotation_euler.x Will not return camera rotaton After Track To constraint.

I can normaly use this bit of code to get any objects rotation … in this case a camera:
var = bpy.data.objects[‘Camera’].rotation_euler.x

How ever after adding the Track To constraint to the Camera,
this dose not work… or more precisely it still returns the cameras rotation but the Track To constraint dose not
change the information stored at bpy.data.objects[‘Camera’].rotation_euler.x

What bit of code will get the cameras REAL rotaton value, as in the rotation after the Track To constraint ?

Perhaps itssomthing in the constraint modulal?


seems like only matrix_world is updated, try:


Thank you so much CoDEmanX

That works Perfectly!!!

val = bpy.data.objects[‘Camera’].matrix_world.to_euler().x # returns the rotaton of Camera after the Track To Constraint !