Import_3ds: Improved distance cue node setup
[blender-addons.git] / magic_uv / ui / IMAGE_MT_uvs.py
blob036e7e3abbcf92c36266053c7865b9c1477da5ad
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"
7 __version__ = "6.6"
8 __date__ = "22 Apr 2022"
10 import bpy
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,
22 MUV_OT_AlignUV_Axis,
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
37 @BlClassRegistry()
38 class MUV_MT_CopyPasteUV_UVEdit(bpy.types.Menu):
39 """
40 Menu class: Master menu of Copy/Paste UV coordinate on UV/ImageEditor
41 """
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):
48 layout = self.layout
49 sc = context.scene
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,
54 text="Paste")
56 layout.label(text="Island")
57 layout.operator(MUV_OT_CopyPasteUVUVEdit_CopyUVIsland.bl_idname,
58 text="Copy")
59 ops = layout.operator(MUV_OT_CopyPasteUVUVEdit_PasteUVIsland.bl_idname,
60 text="Paste")
61 ops.unique_target = sc.muv_copy_paste_uv_uvedit_unique_target
64 @BlClassRegistry()
65 class MUV_MT_AlignUV(bpy.types.Menu):
66 """
67 Menu class: Master menu of Align UV
68 """
70 bl_idname = "MUV_MT_AlignUV"
71 bl_label = "Align UV"
72 bl_description = "Align UV"
74 def draw(self, context):
75 layout = self.layout
76 sc = context.scene
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,
85 text="Straighten")
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,
106 text="Snap to Edge")
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
112 @BlClassRegistry()
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):
123 sc = context.scene
124 layout = self.layout
126 ops = layout.operator(MUV_OT_SelectUV_SelectOverlapped.bl_idname,
127 text="Overlapped")
128 MUV_OT_SelectUV_SelectOverlapped.setup_argument(ops, sc)
129 ops = layout.operator(MUV_OT_SelectUV_SelectFlipped.bl_idname,
130 text="Flipped")
131 MUV_OT_SelectUV_SelectFlipped.setup_argument(ops, sc)
134 @BlClassRegistry()
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):
145 layout = self.layout
146 sc = context.scene
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,
153 text="Middle Top")
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,
162 text="Left Middle")
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,
171 text="Right Middle")
172 ops.position = 'RIGHT_MIDDLE'
173 ops.base = sc.muv_align_uv_cursor_align_method
175 ops = layout.operator(MUV_OT_AlignUVCursor.bl_idname,
176 text="Left Bottom")
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,
186 text="Right Bottom")
187 ops.position = 'RIGHT_BOTTOM'
188 ops.base = sc.muv_align_uv_cursor_align_method
191 @BlClassRegistry()
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):
202 layout = self.layout
203 sc = context.scene
205 layout.prop(sc, "muv_uv_inspection_show",
206 text="Show Overlapped/Flipped")
207 layout.operator(MUV_OT_UVInspection_Update.bl_idname, text="Update")
208 layout.separator()
209 layout.operator(MUV_OT_UVInspection_PaintUVIsland.bl_idname)