Hi Python/Blender specialists,
Maybe I do not understand python. But to be able to restore the old camera orientation at the end of my program I was planning to us the object with name camera_rotation to store this old orientation. But strange thing is that now after setting the current camera orientation to another value (scene.camera.rotation_euler[0] = scene.camera.rotation_euler[0]-1) also the value of camera_rotation is changed?! Can anybody explain this behavior? Here below is the code with the output. So I expected the last printed value to be still -2.3490657806396484
scene = bpy.context.scene
# get the blender camera with camera_name we want to render the scene
scene.camera = bpy.data.objects[camera_name]
camera_rotation = scene.camera.rotation_euler
print(camera_rotation is scene.camera.rotation_euler)
print(camera_rotation[0] is scene.camera.rotation_euler[0])
print(camera_rotation[0])
scene.camera.rotation_euler[0] = scene.camera.rotation_euler[0]-1
print(camera_rotation is scene.camera.rotation_euler)
print(camera_rotation[0] is scene.camera.rotation_euler[0])
print(camera_rotation[0])
I get this as output:
False
False
-2.3490657806396484
False
False
-3.3490657806396484
Gr,
Michiel