Added Ztransp (renamed Z Buffer) option in rna and layout. Also added diffuse and color ramps, although a bug in the RNA prevents these from working unless you load an old file with them already enabled.

This commit is contained in:
William Reynish 2009-07-25 12:22:22 +00:00
parent 5815cfd53b
commit a13341bed1
2 changed files with 17 additions and 12 deletions

@ -74,37 +74,36 @@ class MATERIAL_PT_material(MaterialButtonsPanel):
if mat:
layout.itemR(mat, "type", expand=True)
# row = layout.row()
if mat.type == 'SURFACE':
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, "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.itemR(mat, "translucency", slider=True)
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':
@ -218,10 +217,9 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel):
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")
@ -242,8 +240,9 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel):
sub = split.column()
sub.itemR(mat, "diffuse_fresnel_factor", text="Factor")
layout.itemR(mat, "diffuse_ramp", text="Ramp")
layout.template_color_ramp(mat.diffuse_ramp, expand=True)
class MATERIAL_PT_specular(MaterialButtonsPanel):
__idname__= "MATERIAL_PT_specular"
__label__ = "Specular"
@ -283,8 +282,9 @@ class MATERIAL_PT_specular(MaterialButtonsPanel):
sub = split.column()
sub.itemR(mat, "specular_toon_smooth", text="Smooth")
layout.itemR(mat, "specular_ramp", text="Ramp")
layout.template_color_ramp(mat.specular_ramp, expand=True)
class MATERIAL_PT_sss(MaterialButtonsPanel):
__idname__= "MATERIAL_PT_sss"
__label__ = "Subsurface Scattering"

@ -1133,6 +1133,11 @@ void RNA_def_material(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Wireframe", "Render the edges of faces as wires (not supported in ray tracing).");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
prop= RNA_def_property(srna, "z_buffer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ZTRA);
RNA_def_property_ui_text(prop, "Z Buffer", "Enable Z-buffering of transparent faces");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
prop= RNA_def_property(srna, "vertex_color_light", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_VERTEXCOL);
RNA_def_property_ui_text(prop, "Vertex Color Light", "Add vertex colors as additional lighting.");