[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55435] trunk/blender/release/scripts/ startup/bl_ui/properties_object.py: UI Tweak: "Add to Group" button creates new group if no groups exist

Joshua Leung aligorith at gmail.com
Wed Mar 20 02:41:33 CET 2013


Revision: 55435
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55435
Author:   aligorith
Date:     2013-03-20 01:41:33 +0000 (Wed, 20 Mar 2013)
Log Message:
-----------
UI Tweak: "Add to Group" button creates new group if no groups exist

Previously, the "Add to Group" button would show an empty search popup when there were no existing groups. While this does mean that the button behaves differently at different times, this way is more streamlined and should be less confusing than seeing an empty search popup or a greyed out "add to group" button or a "+" button which jumps around in different situations.

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

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_object.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_object.py	2013-03-20 01:39:05 UTC (rev 55434)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_object.py	2013-03-20 01:41:33 UTC (rev 55435)
@@ -162,7 +162,10 @@
         obj = context.object
 
         row = layout.row(align=True)
-        row.operator("object.group_link", text="Add to Group")
+        if bpy.data.groups:
+            row.operator("object.group_link", text="Add to Group")
+        else:
+            row.operator("object.group_add", text="Add to Group")
         row.operator("object.group_add", text="", icon='ZOOMIN')
 
         # XXX, this is bad practice, yes, I wrote it :( - campbell




More information about the Bf-blender-cvs mailing list