From 91785f1e36cc7457b7b4cf695b66f6313d6b3564 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Jun 2009 01:25:49 +0000 Subject: [PATCH] UI scripts: * Close some material/texture panels by default. * Update material buttons to use more diffuse/specular variables. * Don't show texture mapping/influence when the texture is pinned. * Small visual tweak for sequencer header menus. --- release/ui/buttons_material.py | 31 +++++++++++++++++++++++-------- release/ui/buttons_texture.py | 10 +++++++++- release/ui/space_sequencer.py | 2 +- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py index e29fe211424..87179ce916a 100644 --- a/release/ui/buttons_material.py +++ b/release/ui/buttons_material.py @@ -58,6 +58,7 @@ class MATERIAL_PT_material(MaterialButtonsPanel): class MATERIAL_PT_tangent(MaterialButtonsPanel): __idname__= "MATERIAL_PT_tangent" __label__ = "Tangent Shading" + __default_closed__ = True def draw_header(self, context): layout = self.layout @@ -161,8 +162,14 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel): sub.itemR(mat, "roughness") if mat.diffuse_shader == 'MINNAERT': sub.itemR(mat, "darkness") - sub = split.column() - sub.itemR(mat, "params1_4", text="") + if mat.diffuse_shader == 'TOON': + sub.itemR(mat, "diffuse_toon_size", text="Size") + sub = split.column() + sub.itemR(mat, "diffuse_toon_smooth", text="Smooth") + if mat.diffuse_shader == 'FRESNEL': + sub.itemR(mat, "diffuse_fresnel", text="Fresnel") + sub = split.column() + sub.itemR(mat, "diffuse_fresnel_factor", text="Factor") layout.itemR(mat, "diffuse_ramp", text="Ramp") @@ -183,25 +190,31 @@ class MATERIAL_PT_specular(MaterialButtonsPanel): sub = split.column() sub.itemR(mat, "specular_color", text="") sub = split.column() - sub.itemR(mat, "specularity", text="Intensity", slider=True) + sub.itemR(mat, "specular_reflection", text="Reflection", slider=True) layout.itemR(mat, "spec_shader", text="Shader") split = layout.split() sub = split.column() - if (mat.spec_shader in ('COOKTORR', 'PHONG', 'BLINN')): + if mat.spec_shader in ('COOKTORR', 'PHONG', 'BLINN'): sub.itemR(mat, "specular_hardness", text="Hardness") - if (mat.spec_shader in ('BLINN')): - sub.itemR(mat, "specular_refraction", text="IOR") - if (mat.spec_shader in ('WARDISO')): + if mat.spec_shader == 'BLINN': + sub = split.column() + sub.itemR(mat, "specular_ior", text="IOR") + if mat.spec_shader == 'WARDISO': sub.itemR(mat, "specular_slope", text="Slope") + if mat.spec_shader == 'TOON': + sub.itemR(mat, "specular_toon_size", text="Size") + sub = split.column() + sub.itemR(mat, "specular_toon_smooth", text="Smooth") layout.itemR(mat, "specular_ramp", text="Ramp") class MATERIAL_PT_sss(MaterialButtonsPanel): __idname__= "MATERIAL_PT_sss" __label__ = "Subsurface Scattering" + __default_closed__ = True def poll(self, context): mat = context.material @@ -238,6 +251,7 @@ class MATERIAL_PT_sss(MaterialButtonsPanel): class MATERIAL_PT_raymir(MaterialButtonsPanel): __idname__= "MATERIAL_PT_raymir" __label__ = "Ray Mirror" + __default_closed__ = True def poll(self, context): mat = context.material @@ -279,6 +293,7 @@ class MATERIAL_PT_raymir(MaterialButtonsPanel): class MATERIAL_PT_raytransp(MaterialButtonsPanel): __idname__= "MATERIAL_PT_raytransp" __label__= "Ray Transparency" + __default_closed__ = True def poll(self, context): mat = context.material @@ -378,4 +393,4 @@ bpy.types.register(MATERIAL_PT_raytransp) bpy.types.register(MATERIAL_PT_sss) bpy.types.register(MATERIAL_PT_halo) bpy.types.register(MATERIAL_PT_tangent) -bpy.types.register(MATERIAL_PT_options) \ No newline at end of file +bpy.types.register(MATERIAL_PT_options) diff --git a/release/ui/buttons_texture.py b/release/ui/buttons_texture.py index c2829c12926..286c1240d0e 100644 --- a/release/ui/buttons_texture.py +++ b/release/ui/buttons_texture.py @@ -67,6 +67,9 @@ class TEXTURE_PT_texture(TextureButtonsPanel): class TEXTURE_PT_mapping(TextureButtonsPanel): __idname__= "TEXTURE_PT_mapping" __label__ = "Mapping" + + def poll(self, context): + return (context.texture_slot and context.texture and context.texture.type != 'NONE') def draw(self, context): layout = self.layout @@ -111,6 +114,9 @@ class TEXTURE_PT_mapping(TextureButtonsPanel): class TEXTURE_PT_influence(TextureButtonsPanel): __idname__= "TEXTURE_PT_influence" __label__ = "Influence" + + def poll(self, context): + return (context.texture_slot and context.texture and context.texture.type != 'NONE') def draw(self, context): layout = self.layout @@ -171,6 +177,7 @@ class TEXTURE_PT_influence(TextureButtonsPanel): class TEXTURE_PT_colors(TextureButtonsPanel): __idname__= "TEXTURE_PT_colors" __label__ = "Colors" + __default_closed__ = True def draw(self, context): layout = self.layout @@ -518,4 +525,5 @@ bpy.types.register(TEXTURE_PT_voronoi) bpy.types.register(TEXTURE_PT_distortednoise) bpy.types.register(TEXTURE_PT_colors) bpy.types.register(TEXTURE_PT_mapping) -bpy.types.register(TEXTURE_PT_influence) \ No newline at end of file +bpy.types.register(TEXTURE_PT_influence) + diff --git a/release/ui/space_sequencer.py b/release/ui/space_sequencer.py index b0caeee3e48..94858db81ad 100644 --- a/release/ui/space_sequencer.py +++ b/release/ui/space_sequencer.py @@ -18,7 +18,7 @@ class SEQUENCER_HT_header(bpy.types.Header): layout.template_header(context) if context.area.show_menus: - row = layout.row(align=True) + row = layout.row() row.itemM(context, "SEQUENCER_MT_view") row.itemR(st, "display_mode")