[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21878] branches/blender2.5/blender: Added Ztransp (renamed Z Buffer) option in rna and layout.

William Reynish william at reynish.com
Sat Jul 25 14:22:22 CEST 2009


Revision: 21878
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21878
Author:   billrey
Date:     2009-07-25 14:22:22 +0200 (Sat, 25 Jul 2009)

Log Message:
-----------
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. 

Modified Paths:
--------------
    branches/blender2.5/blender/release/ui/buttons_material.py
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c

Modified: branches/blender2.5/blender/release/ui/buttons_material.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_material.py	2009-07-25 11:27:18 UTC (rev 21877)
+++ branches/blender2.5/blender/release/ui/buttons_material.py	2009-07-25 12:22:22 UTC (rev 21878)
@@ -74,37 +74,36 @@
 
 		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 @@
 		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 @@
 			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 @@
 			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"

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c	2009-07-25 11:27:18 UTC (rev 21877)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c	2009-07-25 12:22:22 UTC (rev 21878)
@@ -1133,6 +1133,11 @@
 	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.");





More information about the Bf-blender-cvs mailing list