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

buttons_data_mesh.py « ui « release - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c3742b38cc17ec9834d12a3b687a38b959cf4abb (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

import bpy

class DataButtonsPanel(bpy.types.Panel):
	__space_type__ = "BUTTONS_WINDOW"
	__region_type__ = "WINDOW"
	__context__ = "data"
	
	def poll(self, context):
		return (context.mesh != None)

class DATA_PT_mesh(DataButtonsPanel):
	__idname__ = "DATA_PT_mesh"
	__label__ = "Mesh"

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

		split = layout.split(percentage=0.65)

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

		if mesh:
			layout.itemS()

			split = layout.split()
		
			col = split.column()
			col.itemR(mesh, "autosmooth")
			colsub = col.column()
			colsub.active = mesh.autosmooth
			colsub.itemR(mesh, "autosmooth_angle", text="Angle")
			sub = split.column()
			sub.itemR(mesh, "vertex_normal_flip")
			sub.itemR(mesh, "double_sided")
			
			layout.itemR(mesh, "texco_mesh")			
					
bpy.types.register(DATA_PT_mesh)