# Copyright 2009 Autodesk, Inc.  All rights reserved.
# Use of this software is subject to the terms of the Autodesk license agreement 
# provided at the time of installation or download, or which otherwise accompanies
# this software in either electronic or hard copy form.
#
# Topic: FBCamera, FBColor
#

from pyfbsdk import FBSystem, FBColor

# First we get the current camera from the system renderer.
lSystem = FBSystem()
lCurrentCamera = lSystem.Renderer.CurrentCamera

# Then we iterate thru the list of all the cameras in the system to set the
# background color to be identical to the settings of the current camera.
for lCamera in lSystem.Scene.Cameras:
    # WARNING: Due to a problem with the implementation of the class
    #          FBPropertyAnimatableColor, we have to create a tuple from the
    #          string representation of the BackGroundColor. This tuple is then
    #          used as a parameter in the constructor of FBColor.
    lCamera.BackGroundColor = FBColor( eval( str( lCurrentCamera.BackGroundColor )))

# Cleanup everything.
del( lSystem, lCurrentCamera, lCamera )
del( FBSystem, FBColor )