tabs to spaces, remove trailing white space. (apart of pep8)
[blender-staging.git] / release / scripts / ui / buttons_data_lattice.py
1
2 import bpy
3
4 class DataButtonsPanel(bpy.types.Panel):
5     bl_space_type = 'PROPERTIES'
6     bl_region_type = 'WINDOW'
7     bl_context = "data"
8
9     def poll(self, context):
10         return context.lattice
11
12 class DATA_PT_context_lattice(DataButtonsPanel):
13     bl_label = ""
14     bl_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 class DATA_PT_lattice(DataButtonsPanel):
33     bl_label = "Lattice"
34
35     def draw(self, context):
36         layout = self.layout
37
38         lat = context.lattice
39
40         row = layout.row()
41         row.itemR(lat, "points_u")
42         row.itemR(lat, "interpolation_type_u", expand=True)
43
44         row = layout.row()
45         row.itemR(lat, "points_v")
46         row.itemR(lat, "interpolation_type_v", expand=True)
47
48         row = layout.row()
49         row.itemR(lat, "points_w")
50         row.itemR(lat, "interpolation_type_w", expand=True)
51
52         row = layout.row()
53         row.itemO("lattice.make_regular")
54         row.itemR(lat, "outside")
55
56 bpy.types.register(DATA_PT_context_lattice)
57 bpy.types.register(DATA_PT_lattice)