[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34915] trunk/blender/release/scripts/ui/ properties_material.py: Material UI: Code cleanup.

Thomas Dinges blender at dingto.de
Wed Feb 16 20:52:32 CET 2011


Revision: 34915
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34915
Author:   dingto
Date:     2011-02-16 19:52:32 +0000 (Wed, 16 Feb 2011)
Log Message:
-----------
Material UI: Code cleanup.

Please, don't use a split function if you just have 2 properties in one line, a row is all you need here. ;-)

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/properties_material.py

Modified: trunk/blender/release/scripts/ui/properties_material.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_material.py	2011-02-16 19:39:45 UTC (rev 34914)
+++ trunk/blender/release/scripts/ui/properties_material.py	2011-02-16 19:52:32 UTC (rev 34915)
@@ -231,22 +231,14 @@
         elif mat.diffuse_shader == 'MINNAERT':
             col.prop(mat, "darkness")
         elif mat.diffuse_shader == 'TOON':
-            split = col.split()
-
-            col = split.column()
-            col.prop(mat, "diffuse_toon_size", text="Size")
-
-            col = split.column()
-            col.prop(mat, "diffuse_toon_smooth", text="Smooth")
+            row = col.row()
+            row.prop(mat, "diffuse_toon_size", text="Size")
+            row.prop(mat, "diffuse_toon_smooth", text="Smooth")
         elif mat.diffuse_shader == 'FRESNEL':
-            split = col.split()
+            row = col.row()
+            row.prop(mat, "diffuse_fresnel", text="Fresnel")
+            row.prop(mat, "diffuse_fresnel_factor", text="Factor")
 
-            col = split.column()
-            col.prop(mat, "diffuse_fresnel", text="Fresnel")
-
-            col = split.column()
-            col.prop(mat, "diffuse_fresnel_factor", text="Factor")
-
         if mat.use_diffuse_ramp:
             layout.separator()
             layout.template_color_ramp(mat, "diffuse_ramp", expand=True)
@@ -294,24 +286,16 @@
         if mat.specular_shader in ('COOKTORR', 'PHONG'):
             col.prop(mat, "specular_hardness", text="Hardness")
         elif mat.specular_shader == 'BLINN':
-            split = layout.split()
-
-            col = split.column()
-            col.prop(mat, "specular_hardness", text="Hardness")
-
-            col = split.column()
-            col.prop(mat, "specular_ior", text="IOR")
+            row = col.row()
+            row.prop(mat, "specular_hardness", text="Hardness")
+            row.prop(mat, "specular_ior", text="IOR")
         elif mat.specular_shader == 'WARDISO':
             col.prop(mat, "specular_slope", text="Slope")
         elif mat.specular_shader == 'TOON':
-            split = layout.split()
+            row = col.row()
+            row.prop(mat, "specular_toon_size", text="Size")
+            row.prop(mat, "specular_toon_smooth", text="Smooth")
 
-            col = split.column()
-            col.prop(mat, "specular_toon_size", text="Size")
-
-            col = split.column()
-            col.prop(mat, "specular_toon_smooth", text="Smooth")
-
         if mat.use_specular_ramp:
             layout.separator()
             layout.template_color_ramp(mat, "specular_ramp", expand=True)




More information about the Bf-blender-cvs mailing list