-
Notifications
You must be signed in to change notification settings - Fork 14
/
ptm_panel.py
44 lines (30 loc) · 1.29 KB
/
ptm_panel.py
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
import bpy
from bpy.types import Panel
from . ptm_mapping_op import PTM_MappingOperator
# Add this when icon_value works again in Blender 2.8
# from . ptm_icon_manager import PTM_IconMgr
class PTM_Panel(Panel):
bl_space_type = "NODE_EDITOR"
bl_region_type = "UI"
bl_label = "PTM"
bl_category = "PTM"
def draw(self, context):
layout = self.layout
scene = context.scene
# Mapping operator
row = layout.row()
row.operator('object.ptm_mapping_op', text="Map textures", icon="NODE")
layout.row().separator()
# Alignment (4 columns)
row = layout.row()
split = row.split(factor=0.2)
col = split.column()
col.operator('object.ptm_align_op', text="←", icon="NODE").align = 0
col = split.column()
col.operator('object.ptm_align_op', text="→", icon="NODE").align = 1
col = split.column()
col.operator('object.ptm_align_op', text="↑", icon="NODE").align = 2
col = split.column()
col.operator('object.ptm_align_op', text="↓", icon="NODE").align = 3
col = split.column()
col.operator('object.ptm_align_op', text="↔", icon="NODE").align = 4