diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2015-04-28 00:24:56 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-04-28 00:30:04 +0300 |
commit | 4288ab16e5c83bd0763d8ee580731d9ea7eacde1 (patch) | |
tree | 76f101e6849d8fcdfa6ec334b4a97b7f84c752b1 /release | |
parent | 58a2b10a65872b2e4a3654a54a83e6f94bf4e229 (diff) |
Add material slot reorder buttons
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_material.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py index cea0c9aef95..79199400b63 100644 --- a/release/scripts/startup/bl_ui/properties_material.py +++ b/release/scripts/startup/bl_ui/properties_material.py @@ -123,11 +123,16 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel, Panel): ob = context.object slot = context.material_slot space = context.space_data + is_sortable = (len(ob.material_slots) > 1) if ob: + rows = 1 + if is_sortable: + rows = 4 + row = layout.row() - row.template_list("MATERIAL_UL_matslots", "", ob, "material_slots", ob, "active_material_index", rows=1) + row.template_list("MATERIAL_UL_matslots", "", ob, "material_slots", ob, "active_material_index", rows=rows) col = row.column(align=True) col.operator("object.material_slot_add", icon='ZOOMIN', text="") @@ -135,6 +140,12 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel, Panel): col.menu("MATERIAL_MT_specials", icon='DOWNARROW_HLT', text="") + if is_sortable: + col.separator() + + col.operator("object.material_slot_move", icon='TRIA_UP', text="").direction = 'UP' + col.operator("object.material_slot_move", icon='TRIA_DOWN', text="").direction = 'DOWN' + if ob.mode == 'EDIT': row = layout.row(align=True) row.operator("object.material_slot_assign", text="Assign") |