diff options
Diffstat (limited to 'release/ui/buttons_data_mesh.py')
-rw-r--r-- | release/ui/buttons_data_mesh.py | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/release/ui/buttons_data_mesh.py b/release/ui/buttons_data_mesh.py index fb64f42c24a..e5c1b8fc9ee 100644 --- a/release/ui/buttons_data_mesh.py +++ b/release/ui/buttons_data_mesh.py @@ -46,6 +46,34 @@ class DATA_PT_mesh(DataButtonsPanel): sub.itemR(mesh, "vertex_normal_flip") sub.itemR(mesh, "double_sided") - layout.itemR(mesh, "texco_mesh") - + layout.itemR(mesh, "texco_mesh") + + +class DATA_PT_materials(DataButtonsPanel): + __idname__ = "DATA_PT_materials" + __label__ = "Materials" + + def poll(self, context): + return (context.object and context.object.type in ('MESH', 'CURVE', 'FONT', 'SURFACE')) + + def draw(self, context): + layout = self.layout + ob = context.object + + row = layout.row() + + row.template_list(ob, "materials", "active_material_index", items=10) + + col = row.column(align=True) + col.itemO("OBJECT_OT_material_slot_add", icon="ICON_ZOOMIN", text="") + col.itemO("OBJECT_OT_material_slot_remove", icon="ICON_ZOOMOUT", text="") + + row = layout.row(align=True) + + row.itemO("OBJECT_OT_material_slot_assign", text="Assign"); + row.itemO("OBJECT_OT_material_slot_select", text="Select"); + row.itemO("OBJECT_OT_material_slot_deselect", text="Deselect"); + bpy.types.register(DATA_PT_mesh) +bpy.types.register(DATA_PT_materials) + |