diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-26 01:31:17 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-26 01:31:17 +0400 |
commit | eb80ce4d7f24778e1edcc3c88a9b071dd2e25b4c (patch) | |
tree | 34a3ce693e362b69d5c01e8404b310ba4eca1304 /release | |
parent | 1b142434055e2b56b23991f0c9d695b6d4f33390 (diff) |
2.5: Materials
* Diffuse/specular ramps works again.
* Wire is now a material type next to Surface and Halo.
* Removed Volume material type option until it is actually there.
* Some button layout tweaks.
Diffstat (limited to 'release')
-rw-r--r-- | release/ui/buttons_material.py | 90 |
1 files changed, 38 insertions, 52 deletions
diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py index c6678d64c6e..9a28a74d0f7 100644 --- a/release/ui/buttons_material.py +++ b/release/ui/buttons_material.py @@ -75,40 +75,23 @@ class MATERIAL_PT_material(MaterialButtonsPanel): if mat: layout.itemR(mat, "type", expand=True) - if mat.type == 'SURFACE': + if mat.type in ('SURFACE', 'WIRE', 'VOLUME'): split = layout.split() sub = split.column() - sub.itemR(mat, "z_buffer") sub.itemR(mat, "alpha", slider=True) sub.itemR(mat, "ambient", slider=True) sub.itemR(mat, "emit") + sub.itemR(mat, "translucency", slider=True) sub = split.column() + sub.itemR(mat, "z_transparency") sub.itemR(mat, "shadeless") - sub.itemR(mat, "wireframe") - sub.itemR(mat, "tangent_shading") sub.itemR(mat, "cubic", slider=True) - elif mat.type == 'VOLUME': - split = layout.split() - - sub = split.column() - sub.itemR(mat, "z_buffer") - sub.itemR(mat, "alpha", slider=True) - sub.itemR(mat, "ambient", slider=True) - sub.itemR(mat, "emit") - - sub = split.column() - sub.itemR(mat, "shadeless") - sub.itemR(mat, "wireframe") - - sub.itemR(mat, "tangent_shading") - sub.itemR(mat, "cubic", slider=True) elif mat.type == 'HALO': layout.itemR(mat, "alpha", slider=True) - class MATERIAL_PT_strand(MaterialButtonsPanel): __idname__= "MATERIAL_PT_strand" @@ -158,17 +141,23 @@ class MATERIAL_PT_options(MaterialButtonsPanel): sub.itemR(mat, "full_oversampling") sub.itemR(mat, "sky") sub.itemR(mat, "exclude_mist") + sub.itemR(mat, "invert_z") + + col = sub.column(align=True) + col.itemL(text="Light Group:") + col.itemR(mat, "light_group", text="") + row = col.row() + row.active = mat.light_group + row.itemR(mat, "light_group_exclusive", text="Exclusive") + sub = split.column() sub.itemR(mat, "face_texture") colsub = sub.column() colsub.active = mat.face_texture colsub.itemR(mat, "face_texture_alpha") - sub.itemR(mat, "invert_z") - sub.itemR(mat, "light_group") - sub.itemR(mat, "light_group_exclusive") - - - + sub.itemR(mat, "vertex_color_paint") + sub.itemR(mat, "vertex_color_light") + sub.itemR(mat, "object_color") class MATERIAL_PT_shadows(MaterialButtonsPanel): __idname__= "MATERIAL_PT_shadows" @@ -201,7 +190,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel): def poll(self, context): mat = context.material - return (mat and mat.type != "HALO") + return (mat and mat.type != 'HALO') def draw(self, context): layout = self.layout @@ -211,18 +200,14 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel): sub = split.column() sub.itemR(mat, "diffuse_color", text="") - sub.itemR(mat, "vertex_color_paint") - sub.itemR(mat, "vertex_color_light") + row = sub.row() + row.active = mat.shadeless== False + row.itemR(mat, "diffuse_reflection", text="Intensity", slider=True) sub = split.column() sub.active = mat.shadeless== False - sub.itemR(mat, "diffuse_reflection", text="Intensity", slider=True) - sub.itemR(mat, "translucency", slider=True) - sub.itemR(mat, "object_color") - - row = layout.row() - row.active = mat.shadeless== False - row.itemR(mat, "diffuse_shader", text="Shader") + sub.itemR(mat, "diffuse_shader", text="") + sub.itemR(mat, "use_diffuse_ramp", text="Ramp") split = layout.split() split.active = mat.shadeless== False @@ -240,8 +225,8 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel): sub = split.column() sub.itemR(mat, "diffuse_fresnel_factor", text="Factor") - layout.template_color_ramp(mat.diffuse_ramp, expand=True) - + if mat.use_diffuse_ramp: + layout.template_color_ramp(mat.diffuse_ramp, expand=True) class MATERIAL_PT_specular(MaterialButtonsPanel): __idname__= "MATERIAL_PT_specular" @@ -249,7 +234,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel): def poll(self, context): mat = context.material - return (mat and mat.type != "HALO") + return (mat and mat.type != 'HALO') def draw(self, context): layout = self.layout @@ -261,29 +246,30 @@ class MATERIAL_PT_specular(MaterialButtonsPanel): sub = split.column() sub.itemR(mat, "specular_color", text="") - sub = split.column() sub.itemR(mat, "specular_reflection", text="Intensity", slider=True) - - layout.itemR(mat, "spec_shader", text="Shader") + + sub = split.column() + sub.itemR(mat, "specular_shader", text="") + sub.itemR(mat, "use_specular_ramp", text="Ramp") split = layout.split() sub = split.column() - if mat.spec_shader in ('COOKTORR', 'PHONG'): + if mat.specular_shader in ('COOKTORR', 'PHONG'): sub.itemR(mat, "specular_hardness", text="Hardness") - if mat.spec_shader == 'BLINN': + if mat.specular_shader == 'BLINN': sub.itemR(mat, "specular_hardness", text="Hardness") sub = split.column() sub.itemR(mat, "specular_ior", text="IOR") - if mat.spec_shader == 'WARDISO': + if mat.specular_shader == 'WARDISO': sub.itemR(mat, "specular_slope", text="Slope") - if mat.spec_shader == 'TOON': + if mat.specular_shader == 'TOON': sub.itemR(mat, "specular_toon_size", text="Size") sub = split.column() sub.itemR(mat, "specular_toon_smooth", text="Smooth") - layout.template_color_ramp(mat.specular_ramp, expand=True) - + if mat.use_specular_ramp: + layout.template_color_ramp(mat.specular_ramp, expand=True) class MATERIAL_PT_sss(MaterialButtonsPanel): __idname__= "MATERIAL_PT_sss" @@ -292,7 +278,7 @@ class MATERIAL_PT_sss(MaterialButtonsPanel): def poll(self, context): mat = context.material - return (mat and mat.type == "SURFACE") + return (mat and (mat.type == 'SURFACE' or mat.type == 'WIRE')) def draw_header(self, context): layout = self.layout @@ -331,7 +317,7 @@ class MATERIAL_PT_raymir(MaterialButtonsPanel): def poll(self, context): mat = context.material - return (mat and mat.type == "SURFACE") + return (mat and (mat.type == 'SURFACE' or mat.type == 'WIRE')) def draw_header(self, context): layout = self.layout @@ -375,7 +361,7 @@ class MATERIAL_PT_raytransp(MaterialButtonsPanel): def poll(self, context): mat = context.material - return (mat and mat.type == "SURFACE") + return (mat and (mat.type == 'SURFACE' or mat.type == 'WIRE')) def draw_header(self, context): layout = self.layout @@ -419,7 +405,7 @@ class MATERIAL_PT_halo(MaterialButtonsPanel): def poll(self, context): mat = context.material - return (mat and mat.type == "HALO") + return (mat and mat.type == 'HALO') def draw(self, context): layout = self.layout |