[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24522] trunk/blender/release/scripts/ui: Implemented suggestion be Matt to slightly tweak the code for single column UI

William Reynish william at reynish.com
Thu Nov 12 14:05:12 CET 2009


Revision: 24522
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24522
Author:   billrey
Date:     2009-11-12 14:05:12 +0100 (Thu, 12 Nov 2009)

Log Message:
-----------
Implemented suggestion be Matt to slightly tweak the code for single column UI

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/properties_material.py
    trunk/blender/release/scripts/ui/properties_object.py
    trunk/blender/release/scripts/ui/properties_render.py
    trunk/blender/release/scripts/ui/properties_scene.py
    trunk/blender/release/scripts/ui/properties_world.py

Modified: trunk/blender/release/scripts/ui/properties_material.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_material.py	2009-11-12 12:48:39 UTC (rev 24521)
+++ trunk/blender/release/scripts/ui/properties_material.py	2009-11-12 13:05:12 UTC (rev 24522)
@@ -73,6 +73,7 @@
         ob = context.object
         slot = context.material_slot
         space = context.space_data
+        col2 = context.region.width > narrowui
 
         if ob:
             row = layout.row()
@@ -90,7 +91,7 @@
                 row.itemO("object.material_slot_select", text="Select")
                 row.itemO("object.material_slot_deselect", text="Deselect")
 
-        if (context.region.width > narrowui):
+        if col2:
             split = layout.split(percentage=0.65)
     
             if ob:
@@ -107,7 +108,7 @@
             layout.template_ID(ob, "active_material", new="material.new")
 
         if mat:
-            if (context.region.width > narrowui):
+            if col2:
                 layout.itemR(mat, "type", expand=True)
             else:
                 layout.itemR(mat, "type", text="")
@@ -126,6 +127,7 @@
         layout = self.layout
 
         mat = active_node_mat(context.material)
+        col2 = context.region.width > narrowui
 
         if mat.type in ('SURFACE', 'WIRE'):
             split = layout.split()
@@ -138,7 +140,7 @@
             sub = col.column()
             sub.itemR(mat, "translucency")
 
-            if (context.region.width > narrowui):
+            if col2:
                 col = split.column()
             col.itemR(mat, "shadeless")
             sub = col.column()
@@ -165,6 +167,7 @@
 
         mat = context.material # dont use node material
         tan = mat.strand
+        col2 = context.region.width > narrowui
 
         split = layout.split()
 
@@ -180,7 +183,7 @@
         sub.itemR(tan, "tangent_shading")
         col.itemR(tan, "shape")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemL(text="Shading:")
         col.itemR(tan, "width_fade")
@@ -206,7 +209,8 @@
         layout = self.layout
 
         phys = context.material.physics # dont use node material
-
+        col2 = context.region.width > narrowui
+        
         split = layout.split()
 
         col = split.column()
@@ -214,7 +218,7 @@
         col.itemR(phys, "friction")
         col.itemR(phys, "align_to_normal")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(phys, "force", slider=True)
         col.itemR(phys, "elasticity", slider=True)
@@ -234,6 +238,7 @@
         layout = self.layout
 
         mat = active_node_mat(context.material)
+        col2 = context.region.width > narrowui
 
         split = layout.split()
 
@@ -253,7 +258,7 @@
         row.active = mat.light_group
         row.itemR(mat, "light_group_exclusive", text="Exclusive")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(mat, "face_texture")
         sub = col.column()
@@ -279,6 +284,7 @@
         layout = self.layout
 
         mat = active_node_mat(context.material)
+        col2 = context.region.width > narrowui
 
         split = layout.split()
 
@@ -289,7 +295,7 @@
         col.itemR(mat, "cast_shadows_only", text="Cast Only")
         col.itemR(mat, "shadow_casting_alpha", text="Casting Alpha")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(mat, "cast_buffer_shadows")
         sub = col.column()
@@ -314,6 +320,7 @@
         layout = self.layout
 
         mat = active_node_mat(context.material)
+        col2 = context.region.width > narrowui
 
         split = layout.split()
 
@@ -323,7 +330,7 @@
         sub.active = (not mat.shadeless)
         sub.itemR(mat, "diffuse_intensity", text="Intensity")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.active = (not mat.shadeless)
         col.itemR(mat, "diffuse_shader", text="")
@@ -341,7 +348,7 @@
             col = split.column()
             col.itemR(mat, "diffuse_toon_size", text="Size")
             
-            if (context.region.width > narrowui):
+            if col2:
                 col = split.column()
             col.itemR(mat, "diffuse_toon_smooth", text="Smooth")
         elif mat.diffuse_shader == 'FRESNEL':
@@ -350,7 +357,7 @@
             col = split.column()
             col.itemR(mat, "diffuse_fresnel", text="Fresnel")
             
-            if (context.region.width > narrowui):
+            if col2:
                 col = split.column()
             col.itemR(mat, "diffuse_fresnel_factor", text="Factor")
 
@@ -364,7 +371,7 @@
             col = split.column()
             col.itemR(mat, "diffuse_ramp_input", text="Input")
             
-            if (context.region.width > narrowui):
+            if col2:
                 col = split.column()
             col.itemR(mat, "diffuse_ramp_blend", text="Blend")
             row = layout.row()
@@ -384,6 +391,7 @@
         layout = self.layout
 
         mat = active_node_mat(context.material)
+        col2 = context.region.width > narrowui
 
         layout.active = (not mat.shadeless)
 
@@ -393,7 +401,7 @@
         col.itemR(mat, "specular_color", text="")
         col.itemR(mat, "specular_intensity", text="Intensity")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(mat, "specular_shader", text="")
         col.itemR(mat, "use_specular_ramp", text="Ramp")
@@ -407,7 +415,7 @@
             col = split.column()
             col.itemR(mat, "specular_hardness", text="Hardness")
             
-            if (context.region.width > narrowui):
+            if col2:
                 col = split.column()
             col.itemR(mat, "specular_ior", text="IOR")
         elif mat.specular_shader == 'WARDISO':
@@ -418,7 +426,7 @@
             col = split.column()
             col.itemR(mat, "specular_toon_size", text="Size")
             
-            if (context.region.width > narrowui):
+            if col2:
                 col = split.column()
             col.itemR(mat, "specular_toon_smooth", text="Smooth")
 
@@ -431,7 +439,7 @@
             col = split.column()
             col.itemR(mat, "specular_ramp_input", text="Input")
             
-            if (context.region.width > narrowui):
+            if col2:
                 col = split.column()
             col.itemR(mat, "specular_ramp_blend", text="Blend")
             
@@ -461,6 +469,7 @@
 
         mat = active_node_mat(context.material)
         sss = mat.subsurface_scattering
+        col2 = context.region.width > narrowui
 
         layout.active = sss.enabled
 
@@ -473,7 +482,7 @@
         col.itemR(sss, "color", text="")
         col.itemR(sss, "radius", text="RGB Radius")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         sub = col.column(align=True)
         sub.itemL(text="Blend:")
@@ -506,6 +515,7 @@
 
         mat = active_node_mat(context.material)
         raym = mat.raytrace_mirror
+        col2 = context.region.width > narrowui
 
         layout.active = raym.enabled
 
@@ -515,7 +525,7 @@
         col.itemR(raym, "reflect_factor")
         col.itemR(mat, "mirror_color", text="")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(raym, "fresnel")
         sub = col.column()
@@ -533,7 +543,7 @@
         sub.itemL(text="Fade To:")
         sub.itemR(raym, "fade_to", text="")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemL(text="Gloss:")
         col.itemR(raym, "gloss_factor", text="Amount")
@@ -564,10 +574,11 @@
 
         mat = active_node_mat(context.material)
         rayt = mat.raytrace_transparency
+        col2 = context.region.width > narrowui
 
         row = layout.row()
         row.active = mat.transparency and (not mat.shadeless)
-        if (context.region.width > narrowui):
+        if col2:
             row.itemR(mat, "transparency_method", expand=True)
         else:
             row.itemR(mat, "transparency_method", text="")
@@ -580,7 +591,7 @@
         row.active = mat.transparency and (not mat.shadeless)
         row.itemR(mat, "specular_alpha", text="Specular")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.active = (not mat.shadeless)
         col.itemR(rayt, "fresnel")
@@ -600,7 +611,7 @@
             col.itemR(rayt, "limit")
             col.itemR(rayt, "depth")
 
-            if (context.region.width > narrowui):
+            if col2:
                 col = split.column()
             col.itemL(text="Gloss:")
             col.itemR(rayt, "gloss_factor", text="Amount")
@@ -624,6 +635,7 @@
 
         mat = context.material # dont use node material
         halo = mat.halo
+        col2 = context.region.width > narrowui
 
         split = layout.split()
 
@@ -639,7 +651,7 @@
         col.itemR(halo, "shaded")
         col.itemR(halo, "soft")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(halo, "ring")
         sub = col.column()
@@ -678,6 +690,7 @@
 
         mat = context.material # dont use node material
         halo = mat.halo
+        col2 = context.region.width > narrowui
 
         layout.active = halo.flare_mode
 
@@ -687,7 +700,7 @@
         col.itemR(halo, "flare_size", text="Size")
         col.itemR(halo, "flare_boost", text="Boost")
         col.itemR(halo, "flare_seed", text="Seed")
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(halo, "flares_sub", text="Subflares")
         col.itemR(halo, "flare_subsize", text="Subsize")
@@ -728,12 +741,13 @@
         layout = self.layout
 
         vol = context.material.volume # dont use node material
+        col2 = context.region.width > narrowui
 
         split = layout.split()
         col = split.column()
         col.itemR(vol, "density")
         
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(vol, "density_scale")
 
@@ -747,6 +761,7 @@
         layout = self.layout
 

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list