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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-05-20 18:46:49 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-05-20 18:46:49 +0400
commit0a13c162b14065fcc93b74befee397d080d6d630 (patch)
tree19801791a15a1b2e7f82d04ba04e72fd97925d93 /release
parent8f620ea5f0881eaf3a88516030037371aa397443 (diff)
UI: added support for enable buttons in the panel header.
Diffstat (limited to 'release')
-rw-r--r--release/ui/buttons_material.py21
-rw-r--r--release/ui/buttons_scene.py34
-rw-r--r--release/ui/buttons_world.py26
3 files changed, 49 insertions, 32 deletions
diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py
index af24bba57c7..665a5223737 100644
--- a/release/ui/buttons_material.py
+++ b/release/ui/buttons_material.py
@@ -36,16 +36,17 @@ class MATERIAL_PT_sss(MaterialButtonsPanel):
def poll(self, context):
ob = context.active_object
return (ob and ob.active_material and ob.active_material.type == "SURFACE")
+
+ def draw_header(self, context):
+ sss = context.active_object.active_material.subsurface_scattering
+
+ layout = self.layout
+ layout.itemR(sss, "enabled", text="")
def draw(self, context):
layout = self.layout
sss = context.active_object.active_material.subsurface_scattering
- if not sss:
- return
-
- layout.itemR(sss, "enabled", text="Enable")
-
flow = layout.column_flow()
flow.itemR(sss, "error_tolerance")
flow.itemR(sss, "ior")
@@ -73,7 +74,7 @@ class MATERIAL_PT_raymir(MaterialButtonsPanel):
raym = context.active_object.active_material.raytrace_mirror
layout = self.layout
- layout.itemR(raym, "enabled", text=self.__label__)
+ layout.itemR(raym, "enabled", text="")
def draw(self, context):
layout = self.layout
@@ -105,11 +106,15 @@ class MATERIAL_PT_raytransp(MaterialButtonsPanel):
ob = context.active_object
return (ob and ob.active_material and ob.active_material.type == "SURFACE")
+ def draw_header(self, context):
+ rayt = context.active_object.active_material.raytrace_transparency
+
+ layout = self.layout
+ layout.itemR(rayt, "enabled", text="")
+
def draw(self, context):
layout = self.layout
rayt = context.active_object.active_material.raytrace_transparency
-
- layout.itemR(rayt, "enabled", text="Enable")
split = layout.split()
diff --git a/release/ui/buttons_scene.py b/release/ui/buttons_scene.py
index b5cba23f989..360122fb805 100644
--- a/release/ui/buttons_scene.py
+++ b/release/ui/buttons_scene.py
@@ -70,28 +70,30 @@ class RENDER_PT_output(RenderButtonsPanel):
class RENDER_PT_antialiasing(RenderButtonsPanel):
__label__ = "Anti-Aliasing"
+ def draw_header(self, context):
+ rd = context.scene.render_data
+
+ layout = self.layout
+ layout.itemR(rd, "antialiasing", text="")
+
def draw(self, context):
scene = context.scene
layout = self.layout
rd = scene.render_data
- row = layout.row()
- row.itemR(rd, "antialiasing", text="Enable")
+ split = layout.split()
+
+ sub = split.column()
+ sub.itemL(text="Samples:")
+ sub.row().itemR(rd, "antialiasing_samples", expand=True)
- if rd.antialiasing:
- split = layout.split()
-
- sub = split.column()
- sub.itemL(text="Samples:")
- sub.row().itemR(rd, "antialiasing_samples", expand=True)
-
- sub = split.column()
- sub.itemR(rd, "pixel_filter")
- sub.itemR(rd, "filter_size", text="Size")
- sub.itemR(rd, "save_buffers")
- if rd.save_buffers:
- sub.itemR(rd, "full_sample")
+ sub = split.column()
+ sub.itemR(rd, "pixel_filter")
+ sub.itemR(rd, "filter_size", text="Size")
+ sub.itemR(rd, "save_buffers")
+ if rd.save_buffers:
+ sub.itemR(rd, "full_sample")
class RENDER_PT_render(RenderButtonsPanel):
__label__ = "Render"
@@ -172,4 +174,4 @@ bpy.types.register(RENDER_PT_render)
bpy.types.register(RENDER_PT_dimensions)
bpy.types.register(RENDER_PT_antialiasing)
bpy.types.register(RENDER_PT_shading)
-bpy.types.register(RENDER_PT_output) \ No newline at end of file
+bpy.types.register(RENDER_PT_output)
diff --git a/release/ui/buttons_world.py b/release/ui/buttons_world.py
index f8ccf4f329f..0bcd466366a 100644
--- a/release/ui/buttons_world.py
+++ b/release/ui/buttons_world.py
@@ -40,12 +40,15 @@ class WORLD_PT_color_correction(WorldButtonsPanel):
class WORLD_PT_mist(WorldButtonsPanel):
__label__ = "Mist"
- def draw(self, context):
+ def draw_header(self, context):
world = context.scene.world
+
layout = self.layout
+ layout.itemR(world.mist, "enabled", text="")
- row = layout.row()
- row.itemR(world.mist, "enabled", text="Enable")
+ def draw(self, context):
+ world = context.scene.world
+ layout = self.layout
flow = layout.column_flow()
flow.itemR(world.mist, "start")
@@ -59,12 +62,15 @@ class WORLD_PT_mist(WorldButtonsPanel):
class WORLD_PT_stars(WorldButtonsPanel):
__label__ = "Stars"
- def draw(self, context):
+ def draw_header(self, context):
world = context.scene.world
+
layout = self.layout
+ layout.itemR(world.stars, "enabled", text="")
- row = layout.row()
- row.itemR(world.stars, "enabled", text="Enable")
+ def draw(self, context):
+ world = context.scene.world
+ layout = self.layout
flow = layout.column_flow()
flow.itemR(world.stars, "size")
@@ -75,6 +81,12 @@ class WORLD_PT_stars(WorldButtonsPanel):
class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
__label__ = "Ambient Occlusion"
+ def draw_header(self, context):
+ world = context.scene.world
+
+ layout = self.layout
+ layout.itemR(world.ambient_occlusion, "enabled", text="")
+
def draw(self, context):
world = context.scene.world
layout = self.layout
@@ -82,8 +94,6 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
ao = world.ambient_occlusion
row = layout.row()
- row.itemR(ao, "enabled", text="Enable")
- row = layout.row()
row.itemR(ao, "gather_method", expand=True)
if ao.gather_method == 'RAYTRACE':