2.5 Buttons
[blender.git] / release / ui / buttons_data_mesh.py
1
2 import bpy
3
4 class DataButtonsPanel(bpy.types.Panel):
5         __space_type__ = "BUTTONS_WINDOW"
6         __region_type__ = "WINDOW"
7         __context__ = "data"
8         
9         def poll(self, context):
10                 ob = context.active_object
11                 return (ob and ob.type == 'MESH')
12
13 class DATA_PT_surface(DataButtonsPanel):
14                 __idname__ = "DATA_PT_surface"
15                 __label__ = "Mesh"
16
17                 def draw(self, context):
18                         mesh = context.active_object.data
19                         layout = self.layout
20
21                         split = layout.split()
22                 
23                         col = split.column()
24                         col.itemR(mesh, "autosmooth")
25                         colsub = col.column()
26                         colsub.active = mesh.autosmooth
27                         colsub.itemR(mesh, "autosmooth_angle", text="Angle")
28                         sub = split.column()
29                         sub.itemR(mesh, "vertex_normal_flip")
30                         sub.itemR(mesh, "double_sided")
31                         
32                         layout.itemR(mesh, "texco_mesh")                        
33                                                 
34 bpy.types.register(DATA_PT_surface)