+ out_node = next((n for n in scene.world.node_tree.nodes if n.type=='OUTPUT_WORLD'), None)
+ if out_node:
+ from .util import get_linked_node_and_socket
+
+ surface_node, _ = get_linked_node_and_socket(scene.world.node_tree, out_node.inputs["Surface"])
+ if surface_node and surface_node.type=='BACKGROUND':
+ c = surface_node.inputs["Color"].default_value
+ s = surface_node.inputs["Strength"].default_value
+ self.ambient_light = mathutils.Color(c[:3])*s
+
+ self.use_sky = scene.world.use_sky and scene.world.sun_light
+ self.sun_light = scene.world.sun_light
+
+ self.use_shadow = False
+ self.use_ibl = False