diff options
author | Joshua Leung <aligorith@gmail.com> | 2013-03-20 05:41:33 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2013-03-20 05:41:33 +0400 |
commit | 08a7b607f7750348f6e2d3c375b1ee7665c06d35 (patch) | |
tree | d5e2eecbc1111bafca74d82276631c982eb6ae5a | |
parent | e7c15beaf68217b2dad2143c17ba88024e3de49f (diff) |
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.
-rw-r--r-- | release/scripts/startup/bl_ui/properties_object.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py index b9dcdc19162..c5dbe946012 100644 --- a/release/scripts/startup/bl_ui/properties_object.py +++ b/release/scripts/startup/bl_ui/properties_object.py @@ -162,7 +162,10 @@ class OBJECT_PT_groups(ObjectButtonsPanel, Panel): 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 |