-
Notifications
You must be signed in to change notification settings - Fork 12
/
ui.py
93 lines (74 loc) · 3.71 KB
/
ui.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import bpy
from .prefs import debug
class IMAGE_PT_tools_UV_HIGHLIGHT(bpy.types.Panel):
bl_label = "UV Highlight Tools"
bl_space_type = 'IMAGE_EDITOR'
bl_region_type = 'TOOLS'
bl_category = "Tools"
bl_context = 'mesh_edit'
@classmethod
def poll(cls, context):
sima = context.space_data
return sima.show_uvedit and not context.tool_settings.use_uv_sculpt
def draw(self, context):
layout = self.layout
'''
col = layout.column(align=True)
col.operator("uv.unwrap_selected_faces", text="Unwrap selected faces")
col = layout.column(align=True)
col.operator("uv.pin_islands", text="Pin unpinned UV Islands").action = "PIN"
col.operator("uv.pin_islands", text="Unpin pinned UV Islands").action = "UNPIN"
col.operator("uv.pin_islands", text="Unpin all UV Islands").action = "UNPIN_ALL"
'''
col = layout.column(align=True)
col.enabled = not context.scene.uv_highlight.auto_convert_uvmode
if bpy.context.scene.tool_settings.use_uv_select_sync:
col.operator("uv.selection_to_uv", text="Convert selection to UV Mode")
else:
col.operator("uv.uv_to_selection", text="Convert selection to Sync Mode")
col = layout.column(align=True)
col.prop(context.scene.uv_highlight, "auto_convert_uvmode", text="Auto convert sync uv mode")
col.separator()
col.prop(context.scene.uv_highlight, "boundaries_as_seams", text="Auto mark boundaries as seams")
col = layout.column(align=True)
col.prop(context.scene.uv_highlight, "boundaries_as_sharp", text="Auto mark boundaries as sharp")
col.enabled = context.scene.uv_highlight.boundaries_as_seams
class IMAGE_PT_view_UV_HIGHLIGHT(bpy.types.Panel):
bl_label = "UV Highlight"
bl_space_type = 'IMAGE_EDITOR'
bl_region_type = 'UI'
bl_context = 'mesh_edit'
@classmethod
def poll(cls, context):
sima = context.space_data
return sima.show_uvedit and not context.tool_settings.use_uv_sculpt
def draw(self, context):
layout = self.layout
col = layout.column(align=True)
col.label(text="Display:")
col.prop(context.scene.uv_highlight, "show_in_viewport", text="Show selection in viewport")
col.prop(context.scene.uv_highlight, "show_preselection", text="Show Preselection")
col.prop(context.scene.uv_highlight, "show_hidden_faces", text="Show non selected faces")
col.prop(context.scene.uv_highlight, "show_udim_indices", text="Show UDIM indices")
col = layout.column(align=True)
col.enabled = not context.scene.uv_highlight.auto_convert_uvmode
if bpy.context.scene.tool_settings.use_uv_select_sync:
col.operator("uv.selection_to_uv", text="Convert selection to UV Mode")
else:
col.operator("uv.uv_to_selection", text="Convert selection to Sync Mode")
col = layout.column(align=True)
col.prop(context.scene.uv_highlight, "auto_convert_uvmode", text="Auto convert sync uv mode")
col.separator()
col.prop(context.scene.uv_highlight, "boundaries_as_seams", text="Auto mark boundaries as seams")
col = layout.column(align=True)
col.prop(context.scene.uv_highlight, "boundaries_as_sharp", text="Auto mark boundaries as sharp")
col.enabled = context.scene.uv_highlight.boundaries_as_seams
layout.separator()
if debug:
pass
'''
layout.separator()
col = layout.column(align=True)
col.prop(context.scene.uv_highlight, "offset_factor", text="offset_factor")
col.prop(context.scene.uv_highlight, "offset_units", text="offset_units")
'''