Cycles: ambient occlusion support, with AO factor and distance, and a render pass.
[blender.git] / intern / cycles / blender / addon / ui.py
index e006238a70d2a0fb19ebada6b3f90036b3f14eb2..faf057e13cc63eaaf94d16c0ea91c30eabba9992 100644 (file)
@@ -196,6 +196,7 @@ class CyclesRender_PT_layers(CyclesButtonsPanel, Panel):
         col.prop(rl, "use_pass_material_index")
         col.prop(rl, "use_pass_emit")
         col.prop(rl, "use_pass_environment")
+        col.prop(rl, "use_pass_ambient_occlusion")
 
         col = split.column()
         col.label()
@@ -483,48 +484,67 @@ class CyclesWorld_PT_surface(CyclesButtonsPanel, Panel):
         if not panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Surface'):
             layout.prop(world, "horizon_color", text="Color")
 
-
-class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel):
-    bl_label = "Settings"
+class CyclesWorld_PT_volume(CyclesButtonsPanel, Panel):
+    bl_label = "Volume"
     bl_context = "world"
     bl_options = {'DEFAULT_CLOSED'}
 
     @classmethod
     def poll(cls, context):
-        return context.world and CyclesButtonsPanel.poll(context)
+        # world = context.world
+        # world and world.node_tree and CyclesButtonsPanel.poll(context)
+        return False
 
     def draw(self, context):
         layout = self.layout
+        layout.active = False
 
         world = context.world
-        cworld = world.cycles
+        panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Volume')
 
-        col = layout.column()
+class CyclesWorld_PT_ambient_occlusion(CyclesButtonsPanel, Panel):
+    bl_label = "Ambient Occlusion"
+    bl_context = "world"
 
-        col.prop(cworld, "sample_as_light")
-        row = col.row()
-        row.active = cworld.sample_as_light
-        row.prop(cworld, "sample_map_resolution")
+    @classmethod
+    def poll(cls, context):
+        return context.world and CyclesButtonsPanel.poll(context)
 
+    def draw_header(self, context):
+        light = context.world.light_settings
+        self.layout.prop(light, "use_ambient_occlusion", text="")
 
-class CyclesWorld_PT_volume(CyclesButtonsPanel, Panel):
-    bl_label = "Volume"
+    def draw(self, context):
+        layout = self.layout
+        light = context.world.light_settings
+
+        layout.active = light.use_ambient_occlusion
+
+        split = layout.split()
+        split.prop(light, "ao_factor", text="Factor")
+        split.prop(light, "distance", text="Distance")
+
+class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel):
+    bl_label = "Settings"
     bl_context = "world"
     bl_options = {'DEFAULT_CLOSED'}
 
     @classmethod
     def poll(cls, context):
-        # world = context.world
-        # world and world.node_tree and CyclesButtonsPanel.poll(context)
-        return False
+        return context.world and CyclesButtonsPanel.poll(context)
 
     def draw(self, context):
         layout = self.layout
-        layout.active = False
 
         world = context.world
-        panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Volume')
+        cworld = world.cycles
 
+        col = layout.column()
+
+        col.prop(cworld, "sample_as_light")
+        row = col.row()
+        row.active = cworld.sample_as_light
+        row.prop(cworld, "sample_map_resolution")
 
 class CyclesMaterial_PT_surface(CyclesButtonsPanel, Panel):
     bl_label = "Surface"