[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20914] branches/blender2.5/blender/ release/ui: UI scripts:

Brecht Van Lommel brecht at blender.org
Tue Jun 16 03:25:51 CEST 2009


Revision: 20914
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20914
Author:   blendix
Date:     2009-06-16 03:25:49 +0200 (Tue, 16 Jun 2009)

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

Modified Paths:
--------------
    branches/blender2.5/blender/release/ui/buttons_material.py
    branches/blender2.5/blender/release/ui/buttons_texture.py
    branches/blender2.5/blender/release/ui/space_sequencer.py

Modified: branches/blender2.5/blender/release/ui/buttons_material.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_material.py	2009-06-16 01:22:56 UTC (rev 20913)
+++ branches/blender2.5/blender/release/ui/buttons_material.py	2009-06-16 01:25:49 UTC (rev 20914)
@@ -58,6 +58,7 @@
 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 @@
 				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 @@
 		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_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_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_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)

Modified: branches/blender2.5/blender/release/ui/buttons_texture.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_texture.py	2009-06-16 01:22:56 UTC (rev 20913)
+++ branches/blender2.5/blender/release/ui/buttons_texture.py	2009-06-16 01:25:49 UTC (rev 20914)
@@ -67,6 +67,9 @@
 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_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_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_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)
+

Modified: branches/blender2.5/blender/release/ui/space_sequencer.py
===================================================================
--- branches/blender2.5/blender/release/ui/space_sequencer.py	2009-06-16 01:22:56 UTC (rev 20913)
+++ branches/blender2.5/blender/release/ui/space_sequencer.py	2009-06-16 01:25:49 UTC (rev 20914)
@@ -18,7 +18,7 @@
 		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")





More information about the Bf-blender-cvs mailing list