diff options
author | Joshua Leung <aligorith@gmail.com> | 2011-07-07 08:31:53 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2011-07-07 08:31:53 +0400 |
commit | cff7c61ddbecf9b66a4d58d1237ffb100633efaa (patch) | |
tree | f1145282ab36f2a248e48064763af07c58acd042 /release/scripts/startup/bl_ui/properties_data_armature.py | |
parent | 0eacdc94ba7bf51b48c977c3d0fc07ef4f70e384 (diff) |
Patch [#23682] Add sort+move to bone group list in panel
Thanks Torsten Rupp (rupp) for the patch!
This patch adds the abilities to sort the bone group list in the
properties panel and to move bone groups up/down in the list (similar
like for vertex groups)
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_data_armature.py')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_armature.py | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py index 9477dc866ab..217cd59f0de 100644 --- a/release/scripts/startup/bl_ui/properties_data_armature.py +++ b/release/scripts/startup/bl_ui/properties_data_armature.py @@ -96,6 +96,16 @@ class DATA_PT_display(ArmatureButtonsPanel, bpy.types.Panel): col.prop(arm, "use_deform_delay", text="Delay Refresh") +class DATA_PT_bone_group_specials(bpy.types.Menu): + bl_label = "Bone Group Specials" + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + + def draw(self, context): + layout = self.layout + + layout.operator("pose.group_sort", icon='SORTALPHA') + + class DATA_PT_bone_groups(ArmatureButtonsPanel, bpy.types.Panel): bl_label = "Bone Groups" @@ -108,16 +118,25 @@ class DATA_PT_bone_groups(ArmatureButtonsPanel, bpy.types.Panel): ob = context.object pose = ob.pose + group = pose.bone_groups.active row = layout.row() - row.template_list(pose, "bone_groups", pose.bone_groups, "active_index", rows=2) + + rows = 2 + if group: + rows = 5 + row.template_list(pose, "bone_groups", pose.bone_groups, "active_index", rows=rows) col = row.column(align=True) col.active = (ob.proxy is None) col.operator("pose.group_add", icon='ZOOMIN', text="") col.operator("pose.group_remove", icon='ZOOMOUT', text="") + col.menu("DATA_PT_bone_group_specials", icon='DOWNARROW_HLT', text="") + if group: + col.separator() + col.operator("pose.group_move", icon='TRIA_UP', text="").direction = 'UP' + col.operator("pose.group_move", icon='TRIA_DOWN', text="").direction = 'DOWN' - group = pose.bone_groups.active if group: col = layout.column() col.active = (ob.proxy is None) |