Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/ui/buttons_world.py')
-rw-r--r--release/ui/buttons_world.py43
1 files changed, 18 insertions, 25 deletions
diff --git a/release/ui/buttons_world.py b/release/ui/buttons_world.py
index 342adfaf4af..b02673d126f 100644
--- a/release/ui/buttons_world.py
+++ b/release/ui/buttons_world.py
@@ -9,17 +9,14 @@ class WorldButtonsPanel(bpy.types.Panel):
def poll(self, context):
rd = context.scene.render_data
- return (context.world != None) and (not rd.use_game_engine) and (rd.engine in self.COMPAT_ENGINES)
+ return (context.world) and (not rd.use_game_engine) and (rd.engine in self.COMPAT_ENGINES)
class WORLD_PT_preview(WorldButtonsPanel):
__label__ = "Preview"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
- layout = self.layout
- world = context.world
-
- layout.template_preview(world)
+ self.layout.template_preview(context.world)
class WORLD_PT_context_world(WorldButtonsPanel):
__show_header__ = False
@@ -52,32 +49,30 @@ class WORLD_PT_world(WorldButtonsPanel):
world = context.world
- if world:
-
- row = layout.row()
- row.itemR(world, "paper_sky")
- row.itemR(world, "blend_sky")
- row.itemR(world, "real_sky")
+ row = layout.row()
+ row.itemR(world, "paper_sky")
+ row.itemR(world, "blend_sky")
+ row.itemR(world, "real_sky")
- row = layout.row()
- row.column().itemR(world, "horizon_color")
- col = row.column()
- col.itemR(world, "zenith_color")
- col.active = world.blend_sky
- row.column().itemR(world, "ambient_color")
+ row = layout.row()
+ row.column().itemR(world, "horizon_color")
+ col = row.column()
+ col.itemR(world, "zenith_color")
+ col.active = world.blend_sky
+ row.column().itemR(world, "ambient_color")
class WORLD_PT_mist(WorldButtonsPanel):
__label__ = "Mist"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
- layout = self.layout
world = context.world
- layout.itemR(world.mist, "enabled", text="")
+ self.layout.itemR(world.mist, "enabled", text="")
def draw(self, context):
layout = self.layout
+
world = context.world
layout.active = world.mist.enabled
@@ -87,7 +82,6 @@ class WORLD_PT_mist(WorldButtonsPanel):
flow.itemR(world.mist, "start")
flow.itemR(world.mist, "depth")
flow.itemR(world.mist, "height")
-
layout.itemR(world.mist, "falloff")
@@ -96,13 +90,13 @@ class WORLD_PT_stars(WorldButtonsPanel):
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
- layout = self.layout
world = context.world
- layout.itemR(world.stars, "enabled", text="")
+ self.layout.itemR(world.stars, "enabled", text="")
def draw(self, context):
layout = self.layout
+
world = context.world
layout.active = world.stars.enabled
@@ -118,13 +112,13 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
- layout = self.layout
world = context.world
- layout.itemR(world.ambient_occlusion, "enabled", text="")
+ self.layout.itemR(world.ambient_occlusion, "enabled", text="")
def draw(self, context):
layout = self.layout
+
ao = context.world.ambient_occlusion
layout.active = ao.enabled
@@ -186,4 +180,3 @@ bpy.types.register(WORLD_PT_world)
bpy.types.register(WORLD_PT_ambient_occlusion)
bpy.types.register(WORLD_PT_mist)
bpy.types.register(WORLD_PT_stars)
-