Welcome to mirror list, hosted at ThFree Co, Russian Federation.

buttons_data_lattice.py « ui « release - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ad9b1b518b8eafea8c96e1d200ce020e29883be1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54

import bpy

class DataButtonsPanel(bpy.types.Panel):
	__space_type__ = "BUTTONS_WINDOW"
	__region_type__ = "WINDOW"
	__context__ = "data"
	
	def poll(self, context):
		return (context.lattice != None)
	
class DATA_PT_lattice(DataButtonsPanel):
	__idname__ = "DATA_PT_lattice"
	__label__ = "Lattice"
	
	def poll(self, context):
		return (context.object and context.object.type == 'LATTICE')

	def draw(self, context):
		layout = self.layout
		
		ob = context.object
		lat = context.lattice
		space = context.space_data

		split = layout.split(percentage=0.65)

		if ob:
			split.template_ID(context, ob, "data")
			split.itemS()
		elif lat:
			split.template_ID(context, space, "pin_id")
			split.itemS()

		if lat:
			layout.itemS()

			row = layout.row()
			row.itemR(lat, "points_u")
			row.itemR(lat, "interpolation_type_u", expand=True)
			
			row = layout.row()
			row.itemR(lat, "points_v")
			row.itemR(lat, "interpolation_type_v", expand=True)
			
			row = layout.row()
			row.itemR(lat, "points_w")
			row.itemR(lat, "interpolation_type_w", expand=True)
			
			row = layout.row()
			row.itemR(lat, "outside")
			row.itemR(lat, "shape_keys")

bpy.types.register(DATA_PT_lattice)