diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-02-05 17:29:05 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-02-05 17:29:05 +0300 |
commit | 2973ffbb49251d7cfb22af6033c91f74f0ca03b6 (patch) | |
tree | 0e1a38fbfb5af74775c202748da25ab34b0cb8e7 /release/scripts/ui/properties_data_mesh.py | |
parent | 61755860ea73250ce21f9d85cd5689eb9cb2bc6e (diff) |
add menus for vertex group and shape key panels, functionality wasnt communicated well with icons and getting cluttered.
also made 'transfer shape' script copy into the active object to match 'join as shape', which was quite confusing before.
Diffstat (limited to 'release/scripts/ui/properties_data_mesh.py')
-rw-r--r-- | release/scripts/ui/properties_data_mesh.py | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/release/scripts/ui/properties_data_mesh.py b/release/scripts/ui/properties_data_mesh.py index 9128a742adb..63daf3fc701 100644 --- a/release/scripts/ui/properties_data_mesh.py +++ b/release/scripts/ui/properties_data_mesh.py @@ -23,6 +23,29 @@ from rna_prop_ui import PropertyPanel narrowui = 180 +class MESH_MT_vertex_group_specials(bpy.types.Menu): + bl_label = "Vertex Group Specials" + + def draw(self, context): + layout = self.layout + + layout.operator("object.vertex_group_sort", icon='SORTALPHA') + layout.operator("object.vertex_group_copy", icon='COPY_ID') + layout.operator("object.vertex_group_copy_to_linked", icon='LINK_AREA') + layout.operator("object.vertex_group_mirror", icon='ARROW_LEFTRIGHT') + + +class MESH_MT_shape_key_specials(bpy.types.Menu): + bl_label = "Shape Key Specials" + + def draw(self, context): + layout = self.layout + + layout.operator("object.shape_key_transfer", icon='COPY_ID') # icon is not ideal + layout.operator("object.join_shapes", icon='COPY_ID') # icon is not ideal + layout.operator("object.shape_key_mirror", icon='ARROW_LEFTRIGHT') + + class DataButtonsPanel(bpy.types.Panel): bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' @@ -121,11 +144,7 @@ class DATA_PT_vertex_groups(DataButtonsPanel): col = row.column(align=True) col.operator("object.vertex_group_add", icon='ZOOMIN', text="") col.operator("object.vertex_group_remove", icon='ZOOMOUT', text="") - col.operator("object.vertex_group_sort", icon='SORTALPHA', text="") - - col.operator("object.vertex_group_copy", icon='COPY_ID', text="") - if ob.data.users > 1: - col.operator("object.vertex_group_copy_to_linked", icon='LINK_AREA', text="") + col.menu("MESH_MT_vertex_group_specials", icon='DOWNARROW_HLT', text="") if group: row = layout.row() @@ -178,6 +197,7 @@ class DATA_PT_shape_keys(DataButtonsPanel): sub = col.column(align=True) sub.operator("object.shape_key_add", icon='ZOOMIN', text="") sub.operator("object.shape_key_remove", icon='ZOOMOUT', text="") + sub.menu("MESH_MT_shape_key_specials", icon='DOWNARROW_HLT', text="") if kb: col.separator() @@ -206,13 +226,10 @@ class DATA_PT_shape_keys(DataButtonsPanel): subsub.prop(ob, "shape_key_lock", text="") subsub.prop(kb, "mute", text="") sub.prop(ob, "shape_key_edit_mode", text="") - - sub = row.row(align=True) - sub.operator("object.shape_key_transfer", icon='COPY_ID', text="") # icon is not ideal - sub.operator("object.shape_key_mirror", icon='ARROW_LEFTRIGHT', text="") + + sub = row.row() sub.operator("object.shape_key_clear", icon='X', text="") - row = layout.row() row.prop(kb, "name") @@ -286,6 +303,9 @@ class DATA_PT_vertex_colors(DataButtonsPanel): if lay: layout.prop(lay, "name") +bpy.types.register(MESH_MT_vertex_group_specials) +bpy.types.register(MESH_MT_shape_key_specials) + bpy.types.register(DATA_PT_context_mesh) bpy.types.register(DATA_PT_normals) bpy.types.register(DATA_PT_settings) |