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 layout.itemR(world.mist, "falloff")
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 class WORLD_PT_stars(WorldButtonsPanel):
60 def draw(self, context):
61 world = context.scene.world
65 layout.itemR(world.stars, "enabled", text="Enable")
68 layout.itemR(world.stars, "size")
69 layout.itemR(world.stars, "min_distance", text="MinDist")
70 layout.itemR(world.stars, "average_separation", text="StarDist")
71 layout.itemR(world.stars, "color_randomization", text="Colnoise")
73 class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
74 __label__ = "Ambient Occlusion"
76 def draw(self, context):
77 world = context.scene.world
80 ao = world.ambient_occlusion
83 layout.itemR(ao, "enabled", text="Enable")
86 layout.itemR(ao, "gather_method", expand=True)
88 if ao.gather_method == 'RAYTRACE':
90 layout.itemR(ao, "samples")
91 layout.itemR(ao, "distance")
94 layout.itemR(ao, "sample_method")
95 if ao.sample_method == 'ADAPTIVE_QMC':
97 layout.itemR(ao, "threshold")
98 layout.itemR(ao, "adapt_to_speed")
100 if ao.sample_method == 'CONSTANT_JITTERED':
102 layout.itemR(ao, "bias")
104 if ao.gather_method == 'APPROXIMATE':
106 layout.itemR(ao, "passes")
107 layout.itemR(ao, "error_tolerance")
110 layout.itemR(ao, "correction")
111 layout.itemR(ao, "pixel_cache")
117 layout.itemR(ao, "falloff")
118 layout.itemR(ao, "strength")
121 layout.itemR(ao, "blend_mode", expand=True)
122 layout.itemR(ao, "color", expand=True)
123 layout.itemR(ao, "energy")
125 bpy.types.register(WORLD_PT_world)
126 bpy.types.register(WORLD_PT_mist)
127 bpy.types.register(WORLD_PT_stars)
128 bpy.types.register(WORLD_PT_ambient_occlusion)
129 bpy.types.register(WORLD_PT_color_correction)