[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44050] trunk/blender/release/scripts/ startup/bl_ui/space_logic.py: Fix #30132: "Add Game Property" works incorrect after "Add Text Game Property"

Sergey Sharybin sergey.vfx at gmail.com
Sun Feb 12 11:23:21 CET 2012


Revision: 44050
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44050
Author:   nazgul
Date:     2012-02-12 10:23:06 +0000 (Sun, 12 Feb 2012)
Log Message:
-----------
Fix #30132: "Add Game Property" works incorrect after "Add Text Game Property"

Issues was caused by operator props "presets" which was reusing name of property
on every run of OBJECT_OT_game_property_new. This run into conflict with how text
property is determining -- it's stupid name comparsion which worked unexpectable
after adding and removing text property.

Solved by using empty (default) name for game_property_new when crating game property.

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-02-12 09:04:12 UTC (rev 44049)
+++ trunk/blender/release/scripts/startup/bl_ui/space_logic.py	2012-02-12 10:23:06 UTC (rev 44050)
@@ -57,7 +57,8 @@
                 props.name = 'Text'
                 props.type = 'STRING'
 
-        layout.operator("object.game_property_new", text="Add Game Property", icon='ZOOMIN')
+        props = layout.operator("object.game_property_new", text="Add Game Property", icon='ZOOMIN')
+        props.name = ''
 
         for i, prop in enumerate(game.properties):
 




More information about the Bf-blender-cvs mailing list