[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24530] trunk/blender/release/scripts/ui: Implemented single column UI for textures, curve, mesh and empty.

William Reynish william at reynish.com
Thu Nov 12 16:41:44 CET 2009


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

Log Message:
-----------
Implemented single column UI for textures, curve, mesh and empty.

Reverted 24524 materials change because it it made greying out not work correctly.

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/properties_data_curve.py
    trunk/blender/release/scripts/ui/properties_data_empty.py
    trunk/blender/release/scripts/ui/properties_data_mesh.py
    trunk/blender/release/scripts/ui/properties_material.py
    trunk/blender/release/scripts/ui/properties_texture.py

Modified: trunk/blender/release/scripts/ui/properties_data_curve.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_data_curve.py	2009-11-12 15:18:01 UTC (rev 24529)
+++ trunk/blender/release/scripts/ui/properties_data_curve.py	2009-11-12 15:41:44 UTC (rev 24530)
@@ -19,6 +19,7 @@
 # <pep8 compliant>
 import bpy
 
+narrowui = 180
 
 class DataButtonsPanel(bpy.types.Panel):
     bl_space_type = 'PROPERTIES'
@@ -54,17 +55,21 @@
         ob = context.object
         curve = context.curve
         space = context.space_data
+        col2 = context.region.width > narrowui
 
-        split = layout.split(percentage=0.65)
+        
+        if col2:
+            split = layout.split(percentage=0.65)
 
-        if ob:
-            split.template_ID(ob, "data")
-            split.itemS()
-        elif curve:
-            split.template_ID(space, "pin_id")
-            split.itemS()
+            if ob:
+                split.template_ID(ob, "data")
+                split.itemS()
+            elif curve:
+                split.template_ID(space, "pin_id")
+                split.itemS()
+        else:
+            layout.template_ID(ob, "data")
 
-
 class DATA_PT_shape_curve(DataButtonsPanel):
     bl_label = "Shape"
 
@@ -74,6 +79,7 @@
         ob = context.object
         curve = context.curve
         space = context.space_data
+        col2 = context.region.width > narrowui
         is_surf = (ob.type == 'SURFACE')
 
         if not is_surf:
@@ -96,7 +102,8 @@
 #		col.itemR(curve, "uv_orco")
         col.itemR(curve, "auto_texspace")
 
-        col = split.column()
+        if col2:
+            col = split.column()
         col.itemL(text="Resolution:")
         sub = col.column(align=True)
         sub.itemR(curve, "resolution_u", text="Preview U")
@@ -108,14 +115,14 @@
             sub.itemR(curve, "render_resolution_v", text="Render V")
 
         # XXX - put somewhere nicer.
-        row = layout.row()
-        row.itemR(curve, "twist_mode")
-        row.itemR(curve, "twist_smooth") # XXX - may not be kept
+        split = layout.split()
 
-#		col.itemL(text="Display:")
-#		col.itemL(text="HANDLES")
-#		col.itemL(text="NORMALS")
-#		col.itemR(curve, "vertex_normal_flip")
+        col = split.column()
+        col.itemR(curve, "twist_mode", text="Twist")
+        
+        if col2:
+            col = split.column()
+        col.itemR(curve, "twist_smooth") # XXX - may not be kept
 
 
 class DATA_PT_geometry_curve(DataButtonsPanel):
@@ -125,6 +132,7 @@
         layout = self.layout
 
         curve = context.curve
+        col2 = context.region.width > narrowui
 
         split = layout.split()
 
@@ -135,7 +143,8 @@
         col.itemL(text="Taper Object:")
         col.itemR(curve, "taper_object", text="")
 
-        col = split.column()
+        if col2:
+            col = split.column()
         col.itemL(text="Bevel:")
         col.itemR(curve, "bevel_depth", text="Depth")
         col.itemR(curve, "bevel_resolution", text="Resolution")
@@ -155,6 +164,7 @@
         layout = self.layout
 
         curve = context.curve
+        col2 = context.region.width > narrowui
 
         layout.active = curve.use_path
 
@@ -164,7 +174,8 @@
         col.itemR(curve, "path_length", text="Frames")
         col.itemR(curve, "use_path_follow")
 
-        col = split.column()
+        if col2:
+            col = split.column()
         col.itemR(curve, "use_stretch")
         col.itemR(curve, "use_radius")
         col.itemR(curve, "use_time_offset", text="Offset Children")

Modified: trunk/blender/release/scripts/ui/properties_data_empty.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_data_empty.py	2009-11-12 15:18:01 UTC (rev 24529)
+++ trunk/blender/release/scripts/ui/properties_data_empty.py	2009-11-12 15:41:44 UTC (rev 24530)
@@ -19,6 +19,7 @@
 # <pep8 compliant>
 import bpy
 
+narrowui = 180
 
 class DataButtonsPanel(bpy.types.Panel):
     bl_space_type = 'PROPERTIES'
@@ -36,8 +37,12 @@
         layout = self.layout
 
         ob = context.object
+        col2 = context.region.width > narrowui
 
-        layout.itemR(ob, "empty_draw_type", text="Display")
+        if col2:
+            layout.itemR(ob, "empty_draw_type", text="Display")
+        else:
+            layout.itemR(ob, "empty_draw_type", text="")
         layout.itemR(ob, "empty_draw_size", text="Size")
 
 bpy.types.register(DATA_PT_empty)

Modified: trunk/blender/release/scripts/ui/properties_data_mesh.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_data_mesh.py	2009-11-12 15:18:01 UTC (rev 24529)
+++ trunk/blender/release/scripts/ui/properties_data_mesh.py	2009-11-12 15:41:44 UTC (rev 24530)
@@ -19,6 +19,7 @@
 # <pep8 compliant>
 import bpy
 
+narrowui = 180
 
 class DataButtonsPanel(bpy.types.Panel):
     bl_space_type = 'PROPERTIES'
@@ -57,6 +58,7 @@
         layout = self.layout
 
         mesh = context.mesh
+        col2 = context.region.width > narrowui
 
         split = layout.split()
 
@@ -66,7 +68,10 @@
         sub.active = mesh.autosmooth
         sub.itemR(mesh, "autosmooth_angle", text="Angle")
 
-        col = split.column()
+        if col2:
+            col = split.column()
+        else:
+            col.itemS()
         col.itemR(mesh, "vertex_normal_flip")
         col.itemR(mesh, "double_sided")
 
@@ -142,6 +147,7 @@
         ob = context.object
         key = ob.data.shape_keys
         kb = ob.active_shape_key
+        col2 = context.region.width > narrowui
 
         enable_edit = ob.mode != 'EDIT'
         enable_edit_value = False
@@ -173,11 +179,17 @@
             split = layout.split(percentage=0.4)
             row = split.row()
             row.enabled = enable_edit
-            row.itemR(key, "relative")
+            if col2:
+                row.itemR(key, "relative")
 
             row = split.row()
             row.alignment = 'RIGHT'
-
+            
+            if not col2:
+                layout.itemR(key, "relative")
+                row = layout.row()
+                
+            
             sub = row.row(align=True)
             subsub = sub.row(align=True)
             subsub.active = enable_edit_value
@@ -213,7 +225,8 @@
                     col.itemR(kb, "slider_min", text="Min")
                     col.itemR(kb, "slider_max", text="Max")
 
-                    col = split.column(align=True)
+                    if col2:
+                        col = split.column(align=True)
                     col.active = enable_edit_value
                     col.itemL(text="Blend:")
                     col.item_pointerR(kb, "vertex_group", ob, "vertex_groups", text="")

Modified: trunk/blender/release/scripts/ui/properties_material.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_material.py	2009-11-12 15:18:01 UTC (rev 24529)
+++ trunk/blender/release/scripts/ui/properties_material.py	2009-11-12 15:41:44 UTC (rev 24530)
@@ -137,7 +137,8 @@
             sub.active = not mat.shadeless
             sub.itemR(mat, "emit")
             sub.itemR(mat, "ambient")
-            col.itemR(mat, "translucency")
+            sub = col.column()
+            sub.itemR(mat, "translucency")
 
             if col2:
                 col = split.column()

Modified: trunk/blender/release/scripts/ui/properties_texture.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_texture.py	2009-11-12 15:18:01 UTC (rev 24529)
+++ trunk/blender/release/scripts/ui/properties_texture.py	2009-11-12 15:41:44 UTC (rev 24530)
@@ -19,6 +19,7 @@
 # <pep8 compliant>
 import bpy
 
+narrowui = 180
 
 def active_node_mat(mat):
     if mat:
@@ -87,7 +88,7 @@
         layout = self.layout
 
         tex = context.texture
-
+        col2 = context.region.width > narrowui
         idblock = context_tex_datablock(context)
 
         space = context.space_data
@@ -102,12 +103,16 @@
             col.item_enumO("texture.slot_move", "type", 'DOWN', text="", icon='ICON_TRIA_DOWN')
 
 
-        split = layout.split(percentage=0.65)
+        
 
-        if idblock:
-            split.template_ID(idblock, "active_texture", new="texture.new")
-        elif tex:
-            split.template_ID(space, "pin_id")
+        if col2:
+            split = layout.split(percentage=0.65)
+            if idblock:
+                split.template_ID(idblock, "active_texture", new="texture.new")
+            elif tex:
+                split.template_ID(space, "pin_id")
+        else:
+            layout.template_ID(idblock, "active_texture", new="texture.new")
 
         if (not space.pin_id) and (
             context.sculpt_object or
@@ -130,8 +135,11 @@
                     split.itemR(slot, "output_node", text="")
 
             else:
-                split.itemL(text="Type:")
-                split.itemR(tex, "type", text="")
+                if col2:
+                    split.itemL(text="Type:")
+                    split.itemR(tex, "type", text="")
+                else:
+                    layout.itemR(tex, "type", text="")
 
 
 class TEXTURE_PT_colors(TextureButtonsPanel):
@@ -142,6 +150,7 @@
         layout = self.layout
 
         tex = context.texture
+        col2 = context.region.width > narrowui
 
         layout.itemR(tex, "use_color_ramp", text="Ramp")
         if tex.use_color_ramp:
@@ -156,7 +165,8 @@
         sub.itemR(tex, "factor_green", text="G")
         sub.itemR(tex, "factor_blue", text="B")
 
-        col = split.column()
+        if col2:
+            col = split.column()
         col.itemL(text="Adjust:")
         col.itemR(tex, "brightness")
         col.itemR(tex, "contrast")
@@ -181,6 +191,7 @@
 
         tex = context.texture_slot
         textype = context.texture
+        col2 = context.region.width > narrowui
 
         if type(idblock) != bpy.types.Brush:
             split = layout.split(percentage=0.3)
@@ -234,19 +245,25 @@
                     col.itemR(tex, "from_dupli")
                 elif tex.texture_coordinates == 'OBJECT':
                     col.itemR(tex, "from_original")
-                else:
+                elif col2:
                     col.itemL()
 
-                col = split.column()
+                if col2:
+                    col = split.column()
                 row = col.row()
                 row.itemR(tex, "x_mapping", text="")

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list