Hello,
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):
Then,
If a “TRACK_TO” constraint is added to a camera such like:
# Python script starts here:
scene = bpy.data.scenes[0]
cam = bpy.data.cameras[0]
camo = bpy.data.objects[cam.name]
scene.camera = camo
camo.select = True
# Let’s print rotation pose of the camera object
print(camo.rotation_euler)
# and location vector:
print(camo.location)
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 = bpy.data.objects[‘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
print(camo.rotation_euler)
# It shows that rotation angles does not change as printed above, but
# location is changed:
print(camo.location)
# Is that a bug?
# Configuration: Blender version - 2.71, PC, Windows 64-bit, NVIDIA 760