1 # SPDX-FileCopyrightText: 2018-2022 Blender Foundation
3 # SPDX-License-Identifier: GPL-2.0-or-later
5 __author__
= "Nutti <nutti.metro@gmail.com>"
6 __status__
= "production"
8 __date__
= "22 Apr 2022"
12 from ..op
.copy_paste_uv_uvedit
import (
13 MUV_OT_CopyPasteUVUVEdit_CopyUV
,
14 MUV_OT_CopyPasteUVUVEdit_PasteUV
,
15 MUV_OT_CopyPasteUVUVEdit_CopyUVIsland
,
16 MUV_OT_CopyPasteUVUVEdit_PasteUVIsland
,
18 from ..op
.align_uv_cursor
import MUV_OT_AlignUVCursor
19 from ..op
.align_uv
import (
20 MUV_OT_AlignUV_Circle
,
21 MUV_OT_AlignUV_Straighten
,
23 MUV_OT_AlignUV_SnapToPoint
,
24 MUV_OT_AlignUV_SnapToEdge
,
26 from ..op
.select_uv
import (
27 MUV_OT_SelectUV_SelectOverlapped
,
28 MUV_OT_SelectUV_SelectFlipped
,
30 from ..op
.uv_inspection
import (
31 MUV_OT_UVInspection_Update
,
32 MUV_OT_UVInspection_PaintUVIsland
,
34 from ..utils
.bl_class_registry
import BlClassRegistry
38 class MUV_MT_CopyPasteUV_UVEdit(bpy
.types
.Menu
):
40 Menu class: Master menu of Copy/Paste UV coordinate on UV/ImageEditor
43 bl_idname
= "MUV_MT_CopyPasteUV_UVEdit"
44 bl_label
= "Copy/Paste UV"
45 bl_description
= "Copy and Paste UV coordinate among object"
47 def draw(self
, context
):
51 layout
.label(text
="Face")
52 layout
.operator(MUV_OT_CopyPasteUVUVEdit_CopyUV
.bl_idname
, text
="Copy")
53 layout
.operator(MUV_OT_CopyPasteUVUVEdit_PasteUV
.bl_idname
,
56 layout
.label(text
="Island")
57 layout
.operator(MUV_OT_CopyPasteUVUVEdit_CopyUVIsland
.bl_idname
,
59 ops
= layout
.operator(MUV_OT_CopyPasteUVUVEdit_PasteUVIsland
.bl_idname
,
61 ops
.unique_target
= sc
.muv_copy_paste_uv_uvedit_unique_target
65 class MUV_MT_AlignUV(bpy
.types
.Menu
):
67 Menu class: Master menu of Align UV
70 bl_idname
= "MUV_MT_AlignUV"
72 bl_description
= "Align UV"
74 def draw(self
, context
):
78 layout
.label(text
="Align")
80 ops
= layout
.operator(MUV_OT_AlignUV_Circle
.bl_idname
, text
="Circle")
81 ops
.transmission
= sc
.muv_align_uv_transmission
82 ops
.select
= sc
.muv_align_uv_select
84 ops
= layout
.operator(MUV_OT_AlignUV_Straighten
.bl_idname
,
86 ops
.transmission
= sc
.muv_align_uv_transmission
87 ops
.select
= sc
.muv_align_uv_select
88 ops
.vertical
= sc
.muv_align_uv_vertical
89 ops
.horizontal
= sc
.muv_align_uv_horizontal
91 ops
= layout
.operator(MUV_OT_AlignUV_Axis
.bl_idname
, text
="XY-axis")
92 ops
.transmission
= sc
.muv_align_uv_transmission
93 ops
.select
= sc
.muv_align_uv_select
94 ops
.vertical
= sc
.muv_align_uv_vertical
95 ops
.horizontal
= sc
.muv_align_uv_horizontal
96 ops
.location
= sc
.muv_align_uv_location
98 layout
.label(text
="Snap")
100 ops
= layout
.operator(MUV_OT_AlignUV_SnapToPoint
.bl_idname
,
101 text
="Snap to Point")
102 ops
.group
= sc
.muv_align_uv_snap_point_group
103 ops
.target
= sc
.muv_align_uv_snap_point_target
105 ops
= layout
.operator(MUV_OT_AlignUV_SnapToEdge
.bl_idname
,
107 ops
.group
= sc
.muv_align_uv_snap_edge_group
108 ops
.target_1
= sc
.muv_align_uv_snap_edge_target_1
109 ops
.target_2
= sc
.muv_align_uv_snap_edge_target_2
113 class MUV_MT_SelectUV(bpy
.types
.Menu
):
115 Menu class: Master menu of Select UV
118 bl_idname
= "MUV_MT_SelectUV"
119 bl_label
= "Select UV"
120 bl_description
= "Select UV"
122 def draw(self
, context
):
126 ops
= layout
.operator(MUV_OT_SelectUV_SelectOverlapped
.bl_idname
,
128 MUV_OT_SelectUV_SelectOverlapped
.setup_argument(ops
, sc
)
129 ops
= layout
.operator(MUV_OT_SelectUV_SelectFlipped
.bl_idname
,
131 MUV_OT_SelectUV_SelectFlipped
.setup_argument(ops
, sc
)
135 class MUV_MT_AlignUVCursor(bpy
.types
.Menu
):
137 Menu class: Master menu of Align UV Cursor
140 bl_idname
= "MUV_MT_AlignUVCursor"
141 bl_label
= "Align UV Cursor"
142 bl_description
= "Align UV cursor"
144 def draw(self
, context
):
148 ops
= layout
.operator(MUV_OT_AlignUVCursor
.bl_idname
, text
="Left Top")
149 ops
.position
= 'LEFT_TOP'
150 ops
.base
= sc
.muv_align_uv_cursor_align_method
152 ops
= layout
.operator(MUV_OT_AlignUVCursor
.bl_idname
,
154 ops
.position
= 'MIDDLE_TOP'
155 ops
.base
= sc
.muv_align_uv_cursor_align_method
157 ops
= layout
.operator(MUV_OT_AlignUVCursor
.bl_idname
, text
="Right Top")
158 ops
.position
= 'RIGHT_TOP'
159 ops
.base
= sc
.muv_align_uv_cursor_align_method
161 ops
= layout
.operator(MUV_OT_AlignUVCursor
.bl_idname
,
163 ops
.position
= 'LEFT_MIDDLE'
164 ops
.base
= sc
.muv_align_uv_cursor_align_method
166 ops
= layout
.operator(MUV_OT_AlignUVCursor
.bl_idname
, text
="Center")
167 ops
.position
= 'CENTER'
168 ops
.base
= sc
.muv_align_uv_cursor_align_method
170 ops
= layout
.operator(MUV_OT_AlignUVCursor
.bl_idname
,
172 ops
.position
= 'RIGHT_MIDDLE'
173 ops
.base
= sc
.muv_align_uv_cursor_align_method
175 ops
= layout
.operator(MUV_OT_AlignUVCursor
.bl_idname
,
177 ops
.position
= 'LEFT_BOTTOM'
178 ops
.base
= sc
.muv_align_uv_cursor_align_method
180 ops
= layout
.operator(MUV_OT_AlignUVCursor
.bl_idname
,
181 text
="Middle Bottom")
182 ops
.position
= 'MIDDLE_BOTTOM'
183 ops
.base
= sc
.muv_align_uv_cursor_align_method
185 ops
= layout
.operator(MUV_OT_AlignUVCursor
.bl_idname
,
187 ops
.position
= 'RIGHT_BOTTOM'
188 ops
.base
= sc
.muv_align_uv_cursor_align_method
192 class MUV_MT_UVInspection(bpy
.types
.Menu
):
194 Menu class: Master menu of UV Inspection
197 bl_idname
= "MUV_MT_UVInspection"
198 bl_label
= "UV Inspection"
199 bl_description
= "UV Inspection"
201 def draw(self
, context
):
205 layout
.prop(sc
, "muv_uv_inspection_show",
206 text
="Show Overlapped/Flipped")
207 layout
.operator(MUV_OT_UVInspection_Update
.bl_idname
, text
="Update")
209 layout
.operator(MUV_OT_UVInspection_PaintUVIsland
.bl_idname
)