Undo revision 23130 which was a merge with 2.5, a messy one because I did something...
[blender.git] / release / ui / buttons_data_lattice.py
1
2 import bpy
3
4 class DataButtonsPanel(bpy.types.Panel):
5         __space_type__ = "PROPERTIES"
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         __show_header__ = False
14         
15         def draw(self, context):
16                 layout = self.layout
17                 
18                 ob = context.object
19                 lat = context.lattice
20                 space = context.space_data
21
22                 split = layout.split(percentage=0.65)
23
24                 if ob:
25                         split.template_ID(ob, "data")
26                         split.itemS()
27                 elif lat:
28                         split.template_ID(space, "pin_id")
29                         split.itemS()
30
31 class DATA_PT_lattice(DataButtonsPanel):
32         __label__ = "Lattice"
33
34         def draw(self, context):
35                 layout = self.layout
36                 
37                 lat = context.lattice
38
39                 row = layout.row()
40                 row.itemR(lat, "points_u")
41                 row.itemR(lat, "interpolation_type_u", expand=True)
42                         
43                 row = layout.row()
44                 row.itemR(lat, "points_v")
45                 row.itemR(lat, "interpolation_type_v", expand=True)
46                         
47                 row = layout.row()
48                 row.itemR(lat, "points_w")
49                 row.itemR(lat, "interpolation_type_w", expand=True)
50                         
51                 row = layout.row()
52                 row.itemO("lattice.make_regular")
53                 row.itemR(lat, "outside")
54
55 bpy.types.register(DATA_PT_context_lattice)
56 bpy.types.register(DATA_PT_lattice)