2009-04-27 18:05:58 +00:00
|
|
|
|
|
|
|
import bpy
|
|
|
|
|
|
|
|
class WorldButtonsPanel(bpy.types.Panel):
|
|
|
|
__space_type__ = "BUTTONS_WINDOW"
|
|
|
|
__region_type__ = "WINDOW"
|
|
|
|
__context__ = "world"
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
return (context.scene.world != None)
|
|
|
|
|
|
|
|
class WORLD_PT_world(WorldButtonsPanel):
|
|
|
|
__label__ = "World"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
world = context.scene.world
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
layout.row()
|
|
|
|
layout.itemR(world, "blend_sky")
|
|
|
|
layout.itemR(world, "paper_sky")
|
|
|
|
layout.itemR(world, "real_sky")
|
|
|
|
|
|
|
|
layout.row()
|
|
|
|
layout.itemR(world, "horizon_color")
|
|
|
|
layout.itemR(world, "zenith_color")
|
|
|
|
layout.itemR(world, "ambient_color")
|
|
|
|
|
|
|
|
class WORLD_PT_color_correction(WorldButtonsPanel):
|
|
|
|
__label__ = "Color Correction"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
world = context.scene.world
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
layout.row()
|
|
|
|
layout.itemR(world, "exposure")
|
|
|
|
layout.itemR(world, "range")
|
|
|
|
|
|
|
|
class WORLD_PT_mist(WorldButtonsPanel):
|
|
|
|
__label__ = "Mist"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
world = context.scene.world
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
layout.row()
|
|
|
|
layout.itemR(world.mist, "enabled", text="Enable")
|
2009-05-05 04:07:08 +00:00
|
|
|
if (world.mist.enabled):
|
2009-04-27 18:05:58 +00:00
|
|
|
|
2009-05-05 04:07:08 +00:00
|
|
|
layout.column_flow()
|
|
|
|
layout.itemR(world.mist, "start")
|
|
|
|
layout.itemR(world.mist, "depth")
|
|
|
|
layout.itemR(world.mist, "height")
|
|
|
|
layout.itemR(world.mist, "intensity")
|
|
|
|
layout.column()
|
|
|
|
layout.itemL(text="Fallof:")
|
|
|
|
layout.itemR(world.mist, "falloff", expand=True)
|
2009-04-27 18:05:58 +00:00
|
|
|
|
|
|
|
class WORLD_PT_stars(WorldButtonsPanel):
|
|
|
|
__label__ = "Stars"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
world = context.scene.world
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
layout.row()
|
|
|
|
layout.itemR(world.stars, "enabled", text="Enable")
|
2009-05-05 04:07:08 +00:00
|
|
|
if (world.stars.enabled):
|
2009-04-27 18:05:58 +00:00
|
|
|
|
2009-05-05 04:07:08 +00:00
|
|
|
layout.column_flow()
|
|
|
|
layout.itemR(world.stars, "size")
|
|
|
|
layout.itemR(world.stars, "min_distance", text="MinDist")
|
|
|
|
layout.itemR(world.stars, "average_separation", text="StarDist")
|
|
|
|
layout.itemR(world.stars, "color_randomization", text="Colnoise")
|
2009-04-27 18:05:58 +00:00
|
|
|
|
|
|
|
class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
|
|
|
|
__label__ = "Ambient Occlusion"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
world = context.scene.world
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
ao = world.ambient_occlusion
|
|
|
|
|
|
|
|
layout.row()
|
|
|
|
layout.itemR(ao, "enabled", text="Enable")
|
2009-05-05 04:07:08 +00:00
|
|
|
if (ao.enabled):
|
2009-04-27 18:05:58 +00:00
|
|
|
|
|
|
|
layout.row()
|
2009-05-05 04:07:08 +00:00
|
|
|
layout.itemR(ao, "gather_method", expand=True)
|
2009-04-27 18:05:58 +00:00
|
|
|
|
2009-05-05 04:07:08 +00:00
|
|
|
if ao.gather_method == 'RAYTRACE':
|
2009-04-27 18:05:58 +00:00
|
|
|
layout.row()
|
2009-05-05 04:07:08 +00:00
|
|
|
layout.itemR(ao, "samples")
|
|
|
|
layout.itemR(ao, "distance")
|
2009-04-27 18:05:58 +00:00
|
|
|
|
|
|
|
layout.row()
|
2009-05-05 04:07:08 +00:00
|
|
|
layout.itemR(ao, "sample_method")
|
|
|
|
if ao.sample_method == 'ADAPTIVE_QMC':
|
|
|
|
layout.row()
|
|
|
|
layout.itemR(ao, "threshold")
|
|
|
|
layout.itemR(ao, "adapt_to_speed")
|
|
|
|
|
|
|
|
if ao.sample_method == 'CONSTANT_JITTERED':
|
|
|
|
layout.row()
|
|
|
|
layout.itemR(ao, "bias")
|
|
|
|
|
|
|
|
if ao.gather_method == 'APPROXIMATE':
|
|
|
|
layout.row()
|
|
|
|
layout.itemR(ao, "passes")
|
|
|
|
layout.itemR(ao, "error_tolerance")
|
|
|
|
|
|
|
|
layout.row()
|
|
|
|
layout.itemR(ao, "correction")
|
|
|
|
layout.itemR(ao, "pixel_cache")
|
|
|
|
|
2009-04-27 18:05:58 +00:00
|
|
|
layout.row()
|
2009-05-05 04:07:08 +00:00
|
|
|
layout.itemS()
|
|
|
|
|
2009-04-27 18:05:58 +00:00
|
|
|
layout.row()
|
2009-05-05 04:07:08 +00:00
|
|
|
layout.itemR(ao, "falloff")
|
|
|
|
layout.itemR(ao, "strength")
|
2009-04-27 18:05:58 +00:00
|
|
|
|
2009-05-05 04:07:08 +00:00
|
|
|
layout.column()
|
|
|
|
layout.itemR(ao, "blend_mode", expand=True)
|
|
|
|
layout.itemR(ao, "color", expand=True)
|
|
|
|
layout.itemR(ao, "energy")
|
2009-04-27 18:05:58 +00:00
|
|
|
|
|
|
|
bpy.types.register(WORLD_PT_world)
|
|
|
|
bpy.types.register(WORLD_PT_mist)
|
|
|
|
bpy.types.register(WORLD_PT_stars)
|
|
|
|
bpy.types.register(WORLD_PT_ambient_occlusion)
|
|
|
|
bpy.types.register(WORLD_PT_color_correction)
|
|
|
|
|