[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24566] trunk/blender/release/scripts/ui: *More single column stuff.

William Reynish william at reynish.com
Sun Nov 15 00:24:15 CET 2009


Revision: 24566
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24566
Author:   billrey
Date:     2009-11-15 00:24:15 +0100 (Sun, 15 Nov 2009)

Log Message:
-----------
*More single column stuff.
*Fixed and changed minor layout issues in curve and game properties
*Merged Curve and Text properties py file as they share a lot of options.

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/properties_data_camera.py
    trunk/blender/release/scripts/ui/properties_data_curve.py
    trunk/blender/release/scripts/ui/properties_data_lamp.py
    trunk/blender/release/scripts/ui/properties_data_lattice.py
    trunk/blender/release/scripts/ui/properties_data_mesh.py
    trunk/blender/release/scripts/ui/properties_data_metaball.py
    trunk/blender/release/scripts/ui/properties_game.py
    trunk/blender/release/scripts/ui/properties_material.py

Removed Paths:
-------------
    trunk/blender/release/scripts/ui/properties_data_text.py

Modified: trunk/blender/release/scripts/ui/properties_data_camera.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_data_camera.py	2009-11-14 23:11:46 UTC (rev 24565)
+++ trunk/blender/release/scripts/ui/properties_data_camera.py	2009-11-14 23:24:15 UTC (rev 24566)
@@ -45,7 +45,6 @@
 
         if col2:
             split = layout.split(percentage=0.65)
-
             if ob:
                 split.template_ID(ob, "data")
                 split.itemS()
@@ -53,7 +52,10 @@
                 split.template_ID(space, "pin_id")
                 split.itemS()
         else:
-            layout.template_ID(ob, "data")
+            if ob:
+                layout.template_ID(ob, "data")
+            elif cam:
+                layout.template_ID(space, "pin_id")
 
 
 class DATA_PT_camera(DataButtonsPanel):

Modified: trunk/blender/release/scripts/ui/properties_data_curve.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_data_curve.py	2009-11-14 23:11:46 UTC (rev 24565)
+++ trunk/blender/release/scripts/ui/properties_data_curve.py	2009-11-14 23:24:15 UTC (rev 24566)
@@ -28,7 +28,7 @@
     bl_context = "data"
 
     def poll(self, context):
-        return (context.object and context.object.type in ('CURVE', 'SURFACE') and context.curve)
+        return (context.object and context.object.type in ('CURVE', 'SURFACE', 'TEXT') and context.curve)
 
 
 class DataButtonsPanelCurve(DataButtonsPanel):
@@ -82,50 +82,49 @@
         curve = context.curve
         col2 = context.region.width > narrowui
         is_surf = (ob.type == 'SURFACE')
+        is_curve = (ob.type == 'CURVE')
+        is_text = (ob.type == 'TEXT')
 
-        if not is_surf:
+        if is_curve:
             row = layout.row()
             row.itemR(curve, "dimensions", expand=True)
 
         split = layout.split()
 
         col = split.column()
-
-        if not is_surf:
-            sub = col.column()
-            sub.active = (curve.dimensions == '2D')
-            sub.itemL(text="Caps:")
-            row = sub.row()
-            row.itemR(curve, "front")
-            row.itemR(curve, "back")
-
-        col.itemL(text="Textures:")
-#		col.itemR(curve, "uv_orco")
-        col.itemR(curve, "auto_texspace")
-
-        if col2:
-            col = split.column()
         col.itemL(text="Resolution:")
         sub = col.column(align=True)
         sub.itemR(curve, "resolution_u", text="Preview U")
         sub.itemR(curve, "render_resolution_u", text="Render U")
-
+        if is_curve:
+            col.itemL(text="Twisting:")
+            col.itemR(curve, "twist_mode", text="")
+            col.itemR(curve, "twist_smooth", text="Smooth")
+        if is_text:
+            col.itemL(text="Display:")
+            col.itemR(curve, "fast", text="Fast Editing")
+        
+        if col2:
+            col = split.column()
+        
         if is_surf:
             sub = col.column(align=True)
+            sub.itemL(text="")
             sub.itemR(curve, "resolution_v", text="Preview V")
             sub.itemR(curve, "render_resolution_v", text="Render V")
+        
+        if is_curve or is_text:
+            sub = col.column()
+            sub.active = (curve.dimensions == '2D')
+            sub.itemL(text="Caps:")
+            sub.itemR(curve, "front")
+            sub.itemR(curve, "back")
 
-        # XXX - put somewhere nicer.
-        split = layout.split()
+        col.itemL(text="Textures:")
+#		col.itemR(curve, "uv_orco")
+        col.itemR(curve, "auto_texspace")
 
-        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):
     bl_label = "Geometry"
 
@@ -173,11 +172,18 @@
 
         col = split.column()
         col.itemR(curve, "path_length", text="Frames")
+        if col2:
+            col = split.column()
+        
+        split = layout.split()
+
+        col = split.column()
         col.itemR(curve, "use_path_follow")
+        col.itemR(curve, "use_stretch")
 
         if col2:
             col = split.column()
-        col.itemR(curve, "use_stretch")
+        
         col.itemR(curve, "use_radius")
         col.itemR(curve, "use_time_offset", text="Offset Children")
 
@@ -255,8 +261,122 @@
             col = split.column()
             col.itemR(act_spline, "smooth")
 
+class DATA_PT_font(DataButtonsPanel):
+    bl_label = "Font"
+    
+    def poll(self, context):
+        return (context.object and context.object.type == 'TEXT' and context.curve)
+
+    def draw(self, context):
+        layout = self.layout
+
+        text = context.curve
+        char = context.curve.edit_format
+        col2 = context.region.width > narrowui
+
+        if col2:
+            layout.itemR(text, "font")
+        else:
+            layout.itemR(text, "font", text="")
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemR(text, "text_size", text="Size")
+        if col2:
+            col = split.column()
+        col.itemR(text, "shear")
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemL(text="Object Font:")
+        col.itemR(text, "family", text="")
+
+        if col2:
+            col = split.column()
+        col.itemL(text="Text on Curve:")
+        col.itemR(text, "text_on_curve", text="")
+
+        split = layout.split()
+        
+        col = split.column(align=True)
+        col.itemL(text="Underline:")
+        col.itemR(text, "ul_position", text="Position")
+        col.itemR(text, "ul_height", text="Thickness")
+        
+        if col2:
+            col = split.column()
+        col.itemL(text="Character:")
+        col.itemR(char, "bold")
+        col.itemR(char, "italic")
+        col.itemR(char, "underline")
+#		col.itemR(char, "style")
+#		col.itemR(char, "wrap")
+
+
+class DATA_PT_paragraph(DataButtonsPanel):
+    bl_label = "Paragraph"
+    def poll(self, context):
+        return (context.object and context.object.type == 'TEXT' and context.curve)
+
+    def draw(self, context):
+        layout = self.layout
+
+        text = context.curve
+        col2 = context.region.width > narrowui
+        
+        layout.itemL(text="Align:")
+        if col2:
+            layout.itemR(text, "spacemode", expand=True)
+        else:
+            layout.itemR(text, "spacemode", text="")
+
+        split = layout.split()
+
+        col = split.column(align=True)
+        col.itemL(text="Spacing:")
+        col.itemR(text, "spacing", text="Character")
+        col.itemR(text, "word_spacing", text="Word")
+        col.itemR(text, "line_dist", text="Line")
+
+        if col2:
+            col = split.column(align=True)
+        col.itemL(text="Offset:")
+        col.itemR(text, "offset_x", text="X")
+        col.itemR(text, "offset_y", text="Y")
+
+
+class DATA_PT_textboxes(DataButtonsPanel):
+    bl_label = "Text Boxes"
+    def poll(self, context):
+        return (context.object and context.object.type == 'TEXT' and context.curve)
+        
+    def draw(self, context):
+        layout = self.layout
+
+        text = context.curve
+        col2 = context.region.width > narrowui
+
+        for box in text.textboxes:
+            split = layout.box().split()
+
+            col = split.column(align=True)
+            col.itemL(text="Dimensions:")
+            col.itemR(box, "width", text="Width")
+            col.itemR(box, "height", text="Height")
+
+            if col2:
+                col = split.column(align=True)
+            col.itemL(text="Offset:")
+            col.itemR(box, "x", text="X")
+            col.itemR(box, "y", text="Y")
+
 bpy.types.register(DATA_PT_context_curve)
 bpy.types.register(DATA_PT_shape_curve)
 bpy.types.register(DATA_PT_geometry_curve)
 bpy.types.register(DATA_PT_pathanim)
 bpy.types.register(DATA_PT_active_spline)
+bpy.types.register(DATA_PT_font)
+bpy.types.register(DATA_PT_paragraph)
+bpy.types.register(DATA_PT_textboxes)

Modified: trunk/blender/release/scripts/ui/properties_data_lamp.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_data_lamp.py	2009-11-14 23:11:46 UTC (rev 24565)
+++ trunk/blender/release/scripts/ui/properties_data_lamp.py	2009-11-14 23:24:15 UTC (rev 24566)
@@ -60,7 +60,10 @@
                 split.template_ID(space, "pin_id")
                 split.itemS()
         else:
-            layout.template_ID(ob, "data")
+            if ob:
+                layout.template_ID(ob, "data")
+            elif lamp:
+                layout.template_ID(space, "pin_id")
 
 
 class DATA_PT_lamp(DataButtonsPanel):

Modified: trunk/blender/release/scripts/ui/properties_data_lattice.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_data_lattice.py	2009-11-14 23:11:46 UTC (rev 24565)
+++ trunk/blender/release/scripts/ui/properties_data_lattice.py	2009-11-14 23:24:15 UTC (rev 24566)
@@ -19,6 +19,7 @@
 # <pep8 compliant>
 import bpy
 
+narrowui = 180
 
 class DataButtonsPanel(bpy.types.Panel):
     bl_space_type = 'PROPERTIES'
@@ -39,17 +40,23 @@
         ob = context.object
         lat = context.lattice
         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 lat:
+                split.template_ID(space, "pin_id")
+                split.itemS()
+        else:
+            if ob:
+                layout.template_ID(ob, "data")
+            elif lat:
+                layout.template_ID(space, "pin_id")
 
-        if ob:
-            split.template_ID(ob, "data")
-            split.itemS()
-        elif lat:
-            split.template_ID(space, "pin_id")
-            split.itemS()
 
-
 class DATA_PT_lattice(DataButtonsPanel):
     bl_label = "Lattice"
 
@@ -57,21 +64,30 @@
         layout = self.layout
 
         lat = context.lattice
+        col2 = context.region.width > narrowui
 
-        row = layout.row()
-        row.itemR(lat, "points_u")
-        row.itemR(lat, "interpolation_type_u", expand=True)
+        split = layout.split()
+        col = split.column()

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list