4 class WorldButtonsPanel(bpy.types.Panel):
5 __space_type__ = "BUTTONS_WINDOW"
6 __region_type__ = "WINDOW"
9 def poll(self, context):
10 return (context.scene.world != None)
12 class WORLD_PT_world(WorldButtonsPanel):
15 def draw(self, context):
16 world = context.scene.world
20 layout.itemR(world, "blend_sky")
21 layout.itemR(world, "paper_sky")
22 layout.itemR(world, "real_sky")
25 layout.itemR(world, "horizon_color")
26 layout.itemR(world, "zenith_color")
27 layout.itemR(world, "ambient_color")
29 class WORLD_PT_color_correction(WorldButtonsPanel):
30 __label__ = "Color Correction"
32 def draw(self, context):
33 world = context.scene.world
37 layout.itemR(world, "exposure")
38 layout.itemR(world, "range")
40 class WORLD_PT_mist(WorldButtonsPanel):
43 def draw(self, context):
44 world = context.scene.world
48 layout.itemR(world.mist, "enabled", text="Enable")
49 if (world.mist.enabled):
52 layout.itemR(world.mist, "start")
53 layout.itemR(world.mist, "depth")
54 layout.itemR(world.mist, "height")
55 layout.itemR(world.mist, "intensity")
57 layout.itemL(text="Fallof:")
58 layout.itemR(world.mist, "falloff", expand=True)
60 class WORLD_PT_stars(WorldButtonsPanel):
63 def draw(self, context):
64 world = context.scene.world
68 layout.itemR(world.stars, "enabled", text="Enable")
69 if (world.stars.enabled):
72 layout.itemR(world.stars, "size")
73 layout.itemR(world.stars, "min_distance", text="MinDist")
74 layout.itemR(world.stars, "average_separation", text="StarDist")
75 layout.itemR(world.stars, "color_randomization", text="Colnoise")
77 class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
78 __label__ = "Ambient Occlusion"
80 def draw(self, context):
81 world = context.scene.world
84 ao = world.ambient_occlusion
87 layout.itemR(ao, "enabled", text="Enable")
91 layout.itemR(ao, "gather_method", expand=True)
93 if ao.gather_method == 'RAYTRACE':
95 layout.itemR(ao, "samples")
96 layout.itemR(ao, "distance")
99 layout.itemR(ao, "sample_method")
100 if ao.sample_method == 'ADAPTIVE_QMC':
102 layout.itemR(ao, "threshold")
103 layout.itemR(ao, "adapt_to_speed")
105 if ao.sample_method == 'CONSTANT_JITTERED':
107 layout.itemR(ao, "bias")
109 if ao.gather_method == 'APPROXIMATE':
111 layout.itemR(ao, "passes")
112 layout.itemR(ao, "error_tolerance")
115 layout.itemR(ao, "correction")
116 layout.itemR(ao, "pixel_cache")
122 layout.itemR(ao, "falloff")
123 layout.itemR(ao, "strength")
126 layout.itemR(ao, "blend_mode", expand=True)
127 layout.itemR(ao, "color", expand=True)
128 layout.itemR(ao, "energy")
130 bpy.types.register(WORLD_PT_world)
131 bpy.types.register(WORLD_PT_mist)
132 bpy.types.register(WORLD_PT_stars)
133 bpy.types.register(WORLD_PT_ambient_occlusion)
134 bpy.types.register(WORLD_PT_color_correction)