* projection paint options in the toolbar
[blender.git] / release / ui / buttons_data_lattice.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                 return (context.lattice != None)
11         
12 class DATA_PT_context_lattice(DataButtonsPanel):
13         __idname__ = "DATA_PT_context_lattice"
14         __show_header__ = False
15         
16         def draw(self, context):
17                 layout = self.layout
18                 
19                 ob = context.object
20                 lat = context.lattice
21                 space = context.space_data
22
23                 split = layout.split(percentage=0.65)
24
25                 if ob:
26                         split.template_ID(ob, "data")
27                         split.itemS()
28                 elif lat:
29                         split.template_ID(space, "pin_id")
30                         split.itemS()
31
32
33 class DATA_PT_lattice(DataButtonsPanel):
34         __idname__ = "DATA_PT_lattice"
35         __label__ = "Lattice"
36
37         def draw(self, context):
38                 layout = self.layout
39                 
40                 lat = context.lattice
41
42                 row = layout.row()
43                 row.itemR(lat, "points_u")
44                 row.itemR(lat, "interpolation_type_u", expand=True)
45                         
46                 row = layout.row()
47                 row.itemR(lat, "points_v")
48                 row.itemR(lat, "interpolation_type_v", expand=True)
49                         
50                 row = layout.row()
51                 row.itemR(lat, "points_w")
52                 row.itemR(lat, "interpolation_type_w", expand=True)
53                         
54                 row = layout.row()
55                 row.itemO("lattice.make_regular")
56                 row.itemR(lat, "outside")
57
58 bpy.types.register(DATA_PT_context_lattice)
59 bpy.types.register(DATA_PT_lattice)
60