[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43153] trunk/blender/release/scripts/ startup/bl_ui/space_logic.py: edit on recent font UI changes.

Campbell Barton ideasman42 at gmail.com
Thu Jan 5 07:12:37 CET 2012


Revision: 43153
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43153
Author:   campbellbarton
Date:     2012-01-05 06:12:26 +0000 (Thu, 05 Jan 2012)
Log Message:
-----------
edit on recent font UI changes.

don't show the text objects body in the ui - this could be pages of text and even though it only draws part of this, it still allocates and frees the string on every draw.

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/space_logic.py

Modified: trunk/blender/release/scripts/startup/bl_ui/space_logic.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_logic.py	2012-01-05 06:05:45 UTC (rev 43152)
+++ trunk/blender/release/scripts/startup/bl_ui/space_logic.py	2012-01-05 06:12:26 UTC (rev 43153)
@@ -20,6 +20,7 @@
 import bpy
 from bpy.types import Header, Menu, Panel
 
+
 class LOGIC_PT_properties(Panel):
     bl_space_type = 'LOGIC_EDITOR'
     bl_region_type = 'UI'
@@ -42,17 +43,22 @@
             if prop_index != -1:
                 layout.operator("object.game_property_remove", text="Renove Text Game Property", icon='X').index = prop_index
                 row = layout.row()
-                sub=row.row()
-                sub.enabled=0
+                sub = row.row()
+                sub.enabled = 0
                 prop = game.properties[prop_index]
                 sub.prop(prop, "name", text="")
                 row.prop(prop, "type", text="")
                 # get the property from the body, not the game property
-                row.prop(ob.data, "body", text="")
+                # note, dont do this - its too slow and body can potentually be a really long string.
+                # row.prop(ob.data, "body", text="")
+                if prop.type == 'STRING':
+                    row.label("*See Font Object*")
+                else:
+                    row.prop(prop, "value", text="", toggle=True)
             else:
-                props=layout.operator("object.game_property_new", text="Add Text Game Property", icon='ZOOMIN')
-                props.name='Text'
-                props.type='STRING'
+                props = layout.operator("object.game_property_new", text="Add Text Game Property", icon='ZOOMIN')
+                props.name = 'Text'
+                props.type = 'STRING'
 
         layout.operator("object.game_property_new", text="Add Game Property", icon='ZOOMIN')
 




More information about the Bf-blender-cvs mailing list