Added Ztransp (renamed Z Buffer) option in rna and layout. Also added diffuse and...
authorWilliam Reynish <william@reynish.com>
Sat, 25 Jul 2009 12:22:22 +0000 (12:22 +0000)
committerWilliam Reynish <william@reynish.com>
Sat, 25 Jul 2009 12:22:22 +0000 (12:22 +0000)
release/ui/buttons_material.py
source/blender/makesrna/intern/rna_material.c

index ceb492b198e3aecef4248447a8a57e098f293338..c6678d64c6e37df7f159dec1edbb9f2ee539f12e 100644 (file)
@@ -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"
index 8f5252dbdac8f61beb74ba0887ef0bd40008fad4..2eab89e43b21f2c622278f16314a3d51f57c5320 100644 (file)
@@ -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.");