diff options
Diffstat (limited to 'uv_magic_uv/legacy/ui')
-rw-r--r-- | uv_magic_uv/legacy/ui/IMAGE_MT_uvs.py | 197 | ||||
-rw-r--r-- | uv_magic_uv/legacy/ui/VIEW3D_MT_object.py | 54 | ||||
-rw-r--r-- | uv_magic_uv/legacy/ui/VIEW3D_MT_uv_map.py | 257 | ||||
-rw-r--r-- | uv_magic_uv/legacy/ui/__init__.py | 50 | ||||
-rw-r--r-- | uv_magic_uv/legacy/ui/uvedit_copy_paste_uv.py | 62 | ||||
-rw-r--r-- | uv_magic_uv/legacy/ui/uvedit_editor_enhancement.py | 149 | ||||
-rw-r--r-- | uv_magic_uv/legacy/ui/uvedit_uv_manipulation.py | 130 | ||||
-rw-r--r-- | uv_magic_uv/legacy/ui/view3d_copy_paste_uv_editmode.py | 93 | ||||
-rw-r--r-- | uv_magic_uv/legacy/ui/view3d_copy_paste_uv_objectmode.py | 65 | ||||
-rw-r--r-- | uv_magic_uv/legacy/ui/view3d_uv_manipulation.py | 289 | ||||
-rw-r--r-- | uv_magic_uv/legacy/ui/view3d_uv_mapping.py | 116 |
11 files changed, 1462 insertions, 0 deletions
diff --git a/uv_magic_uv/legacy/ui/IMAGE_MT_uvs.py b/uv_magic_uv/legacy/ui/IMAGE_MT_uvs.py new file mode 100644 index 00000000..bf071bf5 --- /dev/null +++ b/uv_magic_uv/legacy/ui/IMAGE_MT_uvs.py @@ -0,0 +1,197 @@ +# <pep8-80 compliant> + +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +__author__ = "Nutti <nutti.metro@gmail.com>" +__status__ = "production" +__version__ = "5.2" +__date__ = "17 Nov 2018" + +import bpy + +from ..op import ( + align_uv_cursor, + copy_paste_uv_uvedit, + align_uv, + select_uv, + uv_inspection +) +from ...utils.bl_class_registry import BlClassRegistry + +__all__ = [ + 'MUV_MT_CopyPasteUV_UVEdit', + 'MUV_MT_AlignUV', + 'MUV_MT_SelectUV', + 'MUV_MT_AlignUVCursor', + 'MUV_MT_UVInspection', +] + + +@BlClassRegistry(legacy=True) +class MUV_MT_CopyPasteUV_UVEdit(bpy.types.Menu): + """ + Menu class: Master menu of Copy/Paste UV coordinate on UV/ImageEditor + """ + + bl_idname = "uv.muv_copy_paste_uv_uvedit_menu" + bl_label = "Copy/Paste UV" + bl_description = "Copy and Paste UV coordinate among object" + + def draw(self, _): + layout = self.layout + + layout.operator( + copy_paste_uv_uvedit.MUV_OT_CopyPasteUVUVEdit_CopyUV.bl_idname, + text="Copy") + layout.operator( + copy_paste_uv_uvedit.MUV_OT_CopyPasteUVUVEdit_PasteUV.bl_idname, + text="Paste") + + +@BlClassRegistry(legacy=True) +class MUV_MT_AlignUV(bpy.types.Menu): + """ + Menu class: Master menu of Align UV + """ + + bl_idname = "uv.muv_align_uv_menu" + bl_label = "Align UV" + bl_description = "Align UV" + + def draw(self, context): + layout = self.layout + sc = context.scene + + ops = layout.operator(align_uv.MUV_OT_AlignUV_Circle.bl_idname, + text="Circle") + ops.transmission = sc.muv_align_uv_transmission + ops.select = sc.muv_align_uv_select + + ops = layout.operator(align_uv.MUV_OT_AlignUV_Straighten.bl_idname, + text="Straighten") + ops.transmission = sc.muv_align_uv_transmission + ops.select = sc.muv_align_uv_select + ops.vertical = sc.muv_align_uv_vertical + ops.horizontal = sc.muv_align_uv_horizontal + + ops = layout.operator(align_uv.MUV_OT_AlignUV_Axis.bl_idname, + text="XY-axis") + ops.transmission = sc.muv_align_uv_transmission + ops.select = sc.muv_align_uv_select + ops.vertical = sc.muv_align_uv_vertical + ops.horizontal = sc.muv_align_uv_horizontal + ops.location = sc.muv_align_uv_location + + +@BlClassRegistry(legacy=True) +class MUV_MT_SelectUV(bpy.types.Menu): + """ + Menu class: Master menu of Select UV + """ + + bl_idname = "uv.muv_select_uv_menu" + bl_label = "Select UV" + bl_description = "Select UV" + + def draw(self, _): + layout = self.layout + + layout.operator(select_uv.MUV_OT_SelectUV_SelectOverlapped.bl_idname, + text="Overlapped") + layout.operator(select_uv.MUV_OT_SelectUV_SelectFlipped.bl_idname, + text="Flipped") + + +@BlClassRegistry(legacy=True) +class MUV_MT_AlignUVCursor(bpy.types.Menu): + """ + Menu class: Master menu of Align UV Cursor + """ + + bl_idname = "uv.muv_align_uv_cursor_menu" + bl_label = "Align UV Cursor" + bl_description = "Align UV cursor" + + def draw(self, context): + layout = self.layout + sc = context.scene + + ops = layout.operator(align_uv_cursor.MUV_OT_AlignUVCursor.bl_idname, + text="Left Top") + ops.position = 'LEFT_TOP' + ops.base = sc.muv_align_uv_cursor_align_method + + ops = layout.operator(align_uv_cursor.MUV_OT_AlignUVCursor.bl_idname, + text="Middle Top") + ops.position = 'MIDDLE_TOP' + ops.base = sc.muv_align_uv_cursor_align_method + + ops = layout.operator(align_uv_cursor.MUV_OT_AlignUVCursor.bl_idname, + text="Right Top") + ops.position = 'RIGHT_TOP' + ops.base = sc.muv_align_uv_cursor_align_method + + ops = layout.operator(align_uv_cursor.MUV_OT_AlignUVCursor.bl_idname, + text="Left Middle") + ops.position = 'LEFT_MIDDLE' + ops.base = sc.muv_align_uv_cursor_align_method + + ops = layout.operator(align_uv_cursor.MUV_OT_AlignUVCursor.bl_idname, + text="Center") + ops.position = 'CENTER' + ops.base = sc.muv_align_uv_cursor_align_method + + ops = layout.operator(align_uv_cursor.MUV_OT_AlignUVCursor.bl_idname, + text="Right Middle") + ops.position = 'RIGHT_MIDDLE' + ops.base = sc.muv_align_uv_cursor_align_method + + ops = layout.operator(align_uv_cursor.MUV_OT_AlignUVCursor.bl_idname, + text="Left Bottom") + ops.position = 'LEFT_BOTTOM' + ops.base = sc.muv_align_uv_cursor_align_method + + ops = layout.operator(align_uv_cursor.MUV_OT_AlignUVCursor.bl_idname, + text="Middle Bottom") + ops.position = 'MIDDLE_BOTTOM' + ops.base = sc.muv_align_uv_cursor_align_method + + ops = layout.operator(align_uv_cursor.MUV_OT_AlignUVCursor.bl_idname, + text="Right Bottom") + ops.position = 'RIGHT_BOTTOM' + ops.base = sc.muv_align_uv_cursor_align_method + + +@BlClassRegistry(legacy=True) +class MUV_MT_UVInspection(bpy.types.Menu): + """ + Menu class: Master menu of UV Inspection + """ + + bl_idname = "uv.muv_uv_inspection_menu" + bl_label = "UV Inspection" + bl_description = "UV Inspection" + + def draw(self, context): + layout = self.layout + sc = context.scene + + layout.prop(sc, "muv_uv_inspection_show", text="UV Inspection") + layout.operator(uv_inspection.MUV_OT_UVInspection_Update.bl_idname, + text="Update") diff --git a/uv_magic_uv/legacy/ui/VIEW3D_MT_object.py b/uv_magic_uv/legacy/ui/VIEW3D_MT_object.py new file mode 100644 index 00000000..e1c751ae --- /dev/null +++ b/uv_magic_uv/legacy/ui/VIEW3D_MT_object.py @@ -0,0 +1,54 @@ +# <pep8-80 compliant> + +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +__author__ = "Nutti <nutti.metro@gmail.com>" +__status__ = "production" +__version__ = "5.2" +__date__ = "17 Nov 2018" + +import bpy + +from ..op import copy_paste_uv_object +from ...utils.bl_class_registry import BlClassRegistry + +__all__ = [ + 'MUV_MT_CopyPasteUV_Object', +] + + +@BlClassRegistry(legacy=True) +class MUV_MT_CopyPasteUV_Object(bpy.types.Menu): + """ + Menu class: Master menu of Copy/Paste UV coordinate among object + """ + + bl_idname = "uv.muv_copy_paste_uv_object_menu" + bl_label = "Copy/Paste UV" + bl_description = "Copy and Paste UV coordinate among object" + + def draw(self, _): + layout = self.layout + + layout.menu( + copy_paste_uv_object.MUV_MT_CopyPasteUVObject_CopyUV.bl_idname, + text="Copy") + layout.menu( + copy_paste_uv_object.MUV_MT_CopyPasteUVObject_PasteUV.bl_idname, + text="Paste") diff --git a/uv_magic_uv/legacy/ui/VIEW3D_MT_uv_map.py b/uv_magic_uv/legacy/ui/VIEW3D_MT_uv_map.py new file mode 100644 index 00000000..d229322a --- /dev/null +++ b/uv_magic_uv/legacy/ui/VIEW3D_MT_uv_map.py @@ -0,0 +1,257 @@ +# <pep8-80 compliant> + +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +__author__ = "Nutti <nutti.metro@gmail.com>" +__status__ = "production" +__version__ = "5.2" +__date__ = "17 Nov 2018" + +import bpy +import bpy.utils + +from ..op import ( + texture_lock, + copy_paste_uv, + preserve_uv_aspect, + texture_projection, + texture_wrap, + transfer_uv, + uvw, + world_scale_uv +) +from ..op.world_scale_uv import MUV_OT_WorldScaleUV_ApplyProportionalToMesh +from ...utils.bl_class_registry import BlClassRegistry + +__all__ = [ + 'MUV_MT_CopyPasteUV', + 'MUV_MT_TransferUV', + 'MUV_MT_TextureLock', + 'MUV_MT_WorldScaleUV', + 'MUV_MT_TextureWrap', + 'MUV_MT_UVW', + 'MUV_MT_TextureProjection', + 'MUV_MT_PreserveUVAspect', +] + + +@BlClassRegistry(legacy=True) +class MUV_MT_CopyPasteUV(bpy.types.Menu): + """ + Menu class: Master menu of Copy/Paste UV coordinate + """ + + bl_idname = "uv.muv_copy_paste_uv_menu" + bl_label = "Copy/Paste UV" + bl_description = "Copy and Paste UV coordinate" + + def draw(self, _): + layout = self.layout + + layout.label(text="Default") + layout.menu(copy_paste_uv.MUV_MT_CopyPasteUV_CopyUV.bl_idname, + text="Copy") + layout.menu(copy_paste_uv.MUV_MT_CopyPasteUV_PasteUV.bl_idname, + text="Paste") + + layout.separator() + + layout.label(text="Selection Sequence") + layout.menu(copy_paste_uv.MUV_MT_CopyPasteUV_SelSeqCopyUV.bl_idname, + text="Copy") + layout.menu(copy_paste_uv.MUV_MT_CopyPasteUV_SelSeqPasteUV.bl_idname, + text="Paste") + + +@BlClassRegistry(legacy=True) +class MUV_MT_TransferUV(bpy.types.Menu): + """ + Menu class: Master menu of Transfer UV coordinate + """ + + bl_idname = "uv.muv_transfer_uv_menu" + bl_label = "Transfer UV" + bl_description = "Transfer UV coordinate" + + def draw(self, context): + layout = self.layout + sc = context.scene + + layout.operator(transfer_uv.MUV_OT_TransferUV_CopyUV.bl_idname, + text="Copy") + ops = layout.operator(transfer_uv.MUV_OT_TransferUV_PasteUV.bl_idname, + text="Paste") + ops.invert_normals = sc.muv_transfer_uv_invert_normals + ops.copy_seams = sc.muv_transfer_uv_copy_seams + + +@BlClassRegistry(legacy=True) +class MUV_MT_TextureLock(bpy.types.Menu): + """ + Menu class: Master menu of Texture Lock + """ + + bl_idname = "uv.muv_texture_lock_menu" + bl_label = "Texture Lock" + bl_description = "Lock texture when vertices of mesh (Preserve UV)" + + def draw(self, context): + layout = self.layout + sc = context.scene + + layout.label("Normal Mode") + layout.operator( + texture_lock.MUV_OT_TextureLock_Lock.bl_idname, + text="Lock" + if not texture_lock.MUV_OT_TextureLock_Lock.is_ready(context) + else "ReLock") + ops = layout.operator(texture_lock.MUV_OT_TextureLock_Unlock.bl_idname, + text="Unlock") + ops.connect = sc.muv_texture_lock_connect + + layout.separator() + + layout.label("Interactive Mode") + layout.prop(sc, "muv_texture_lock_lock", text="Lock") + + +@BlClassRegistry(legacy=True) +class MUV_MT_WorldScaleUV(bpy.types.Menu): + """ + Menu class: Master menu of world scale UV + """ + + bl_idname = "uv.muv_world_scale_uv_menu" + bl_label = "World Scale UV" + bl_description = "" + + def draw(self, context): + layout = self.layout + sc = context.scene + + layout.operator(world_scale_uv.MUV_OT_WorldScaleUV_Measure.bl_idname, + text="Measure") + + layout.operator( + world_scale_uv.MUV_OT_WorldScaleUV_ApplyManual.bl_idname, + text="Apply (Manual)") + + ops = layout.operator( + world_scale_uv.MUV_OT_WorldScaleUV_ApplyScalingDensity.bl_idname, + text="Apply (Same Desity)") + ops.src_density = sc.muv_world_scale_uv_src_density + ops.same_density = True + + ops = layout.operator( + world_scale_uv.MUV_OT_WorldScaleUV_ApplyScalingDensity.bl_idname, + text="Apply (Scaling Desity)") + ops.src_density = sc.muv_world_scale_uv_src_density + ops.same_density = False + ops.tgt_scaling_factor = sc.muv_world_scale_uv_tgt_scaling_factor + + ops = layout.operator( + MUV_OT_WorldScaleUV_ApplyProportionalToMesh.bl_idname, + text="Apply (Proportional to Mesh)") + ops.src_density = sc.muv_world_scale_uv_src_density + ops.src_uv_area = sc.muv_world_scale_uv_src_uv_area + ops.src_mesh_area = sc.muv_world_scale_uv_src_mesh_area + ops.origin = sc.muv_world_scale_uv_origin + + +@BlClassRegistry(legacy=True) +class MUV_MT_TextureWrap(bpy.types.Menu): + """ + Menu class: Master menu of Texture Wrap + """ + + bl_idname = "uv.muv_texture_wrap_menu" + bl_label = "Texture Wrap" + bl_description = "" + + def draw(self, _): + layout = self.layout + + layout.operator(texture_wrap.MUV_OT_TextureWrap_Refer.bl_idname, + text="Refer") + layout.operator(texture_wrap.MUV_OT_TextureWrap_Set.bl_idname, + text="Set") + + +@BlClassRegistry(legacy=True) +class MUV_MT_UVW(bpy.types.Menu): + """ + Menu class: Master menu of UVW + """ + + bl_idname = "uv.muv_uvw_menu" + bl_label = "UVW" + bl_description = "" + + def draw(self, context): + layout = self.layout + sc = context.scene + + ops = layout.operator(uvw.MUV_OT_UVW_BoxMap.bl_idname, text="Box") + ops.assign_uvmap = sc.muv_uvw_assign_uvmap + + ops = layout.operator(uvw.MUV_OT_UVW_BestPlanerMap.bl_idname, + text="Best Planner") + ops.assign_uvmap = sc.muv_uvw_assign_uvmap + + +@BlClassRegistry(legacy=True) +class MUV_MT_TextureProjection(bpy.types.Menu): + """ + Menu class: Master menu of Texture Projection + """ + + bl_idname = "uv.muv_texture_projection_menu" + bl_label = "Texture Projection" + bl_description = "" + + def draw(self, context): + layout = self.layout + sc = context.scene + + layout.prop(sc, "muv_texture_projection_enable", + text="Texture Projection") + layout.operator( + texture_projection.MUV_OT_TextureProjection_Project.bl_idname, + text="Project") + + +@BlClassRegistry(legacy=True) +class MUV_MT_PreserveUVAspect(bpy.types.Menu): + """ + Menu class: Master menu of Preserve UV Aspect + """ + + bl_idname = "uv.muv_preserve_uv_aspect_menu" + bl_label = "Preserve UV Aspect" + bl_description = "" + + def draw(self, context): + layout = self.layout + sc = context.scene + + for key in bpy.data.images.keys(): + ops = layout.operator( + preserve_uv_aspect.MUV_OT_PreserveUVAspect.bl_idname, text=key) + ops.dest_img_name = key + ops.origin = sc.muv_preserve_uv_aspect_origin diff --git a/uv_magic_uv/legacy/ui/__init__.py b/uv_magic_uv/legacy/ui/__init__.py new file mode 100644 index 00000000..bf790a8e --- /dev/null +++ b/uv_magic_uv/legacy/ui/__init__.py @@ -0,0 +1,50 @@ +# <pep8-80 compliant> + +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +__author__ = "Nutti <nutti.metro@gmail.com>" +__status__ = "production" +__version__ = "5.2" +__date__ = "17 Nov 2018" + +if "bpy" in locals(): + import importlib + importlib.reload(view3d_copy_paste_uv_objectmode) + importlib.reload(view3d_copy_paste_uv_editmode) + importlib.reload(view3d_uv_manipulation) + importlib.reload(view3d_uv_mapping) + importlib.reload(uvedit_copy_paste_uv) + importlib.reload(uvedit_uv_manipulation) + importlib.reload(uvedit_editor_enhancement) + importlib.reload(VIEW3D_MT_uv_map) + importlib.reload(VIEW3D_MT_object) + importlib.reload(IMAGE_MT_uvs) +else: + from . import view3d_copy_paste_uv_objectmode + from . import view3d_copy_paste_uv_editmode + from . import view3d_uv_manipulation + from . import view3d_uv_mapping + from . import uvedit_copy_paste_uv + from . import uvedit_uv_manipulation + from . import uvedit_editor_enhancement + from . import VIEW3D_MT_uv_map + from . import VIEW3D_MT_object + from . import IMAGE_MT_uvs + +import bpy
\ No newline at end of file diff --git a/uv_magic_uv/legacy/ui/uvedit_copy_paste_uv.py b/uv_magic_uv/legacy/ui/uvedit_copy_paste_uv.py new file mode 100644 index 00000000..9848f03b --- /dev/null +++ b/uv_magic_uv/legacy/ui/uvedit_copy_paste_uv.py @@ -0,0 +1,62 @@ +# <pep8-80 compliant> + +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +__author__ = "Nutti <nutti.metro@gmail.com>" +__status__ = "production" +__version__ = "5.2" +__date__ = "17 Nov 2018" + +import bpy + +from ..op import copy_paste_uv_uvedit +from ...utils.bl_class_registry import BlClassRegistry + +__all__ = [ + 'MUV_PT_UVEdit_CopyPasteUV', +] + + +@BlClassRegistry(legacy=True) +class MUV_PT_UVEdit_CopyPasteUV(bpy.types.Panel): + """ + Panel class: Copy/Paste UV on Property Panel on UV/ImageEditor + """ + + bl_space_type = 'IMAGE_EDITOR' + bl_region_type = 'TOOLS' + bl_label = "Copy/Paste UV" + bl_category = "Magic UV" + bl_context = 'mesh_edit' + bl_options = {'DEFAULT_CLOSED'} + + def draw_header(self, _): + layout = self.layout + layout.label(text="", icon='IMAGE_COL') + + def draw(self, _): + layout = self.layout + + row = layout.row(align=True) + row.operator( + copy_paste_uv_uvedit.MUV_OT_CopyPasteUVUVEdit_CopyUV.bl_idname, + text="Copy") + row.operator( + copy_paste_uv_uvedit.MUV_OT_CopyPasteUVUVEdit_PasteUV.bl_idname, + text="Paste") diff --git a/uv_magic_uv/legacy/ui/uvedit_editor_enhancement.py b/uv_magic_uv/legacy/ui/uvedit_editor_enhancement.py new file mode 100644 index 00000000..3f750feb --- /dev/null +++ b/uv_magic_uv/legacy/ui/uvedit_editor_enhancement.py @@ -0,0 +1,149 @@ +# <pep8-80 compliant> + +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +__author__ = "Nutti <nutti.metro@gmail.com>" +__status__ = "production" +__version__ = "5.2" +__date__ = "17 Nov 2018" + +import bpy + +from ..op import ( + align_uv_cursor, + uv_bounding_box, + uv_inspection, +) +from ...utils.bl_class_registry import BlClassRegistry + +__all__ = [ + 'MUV_PT_UVEdit_EditorEnhancement', +] + + +@BlClassRegistry(legacy=True) +class MUV_PT_UVEdit_EditorEnhancement(bpy.types.Panel): + """ + Panel class: UV/Image Editor Enhancement + """ + + bl_space_type = 'IMAGE_EDITOR' + bl_region_type = 'TOOLS' + bl_label = "Editor Enhancement" + bl_category = "Magic UV" + bl_context = 'mesh_edit' + bl_options = {'DEFAULT_CLOSED'} + + def draw_header(self, _): + layout = self.layout + layout.label(text="", icon='IMAGE_COL') + + def draw(self, context): + layout = self.layout + sc = context.scene + + box = layout.box() + box.prop(sc, "muv_align_uv_cursor_enabled", text="Align UV Cursor") + if sc.muv_align_uv_cursor_enabled: + box.prop(sc, "muv_align_uv_cursor_align_method", expand=True) + + col = box.column(align=True) + + row = col.row(align=True) + ops = row.operator(align_uv_cursor.MUV_OT_AlignUVCursor.bl_idname, + text="Left Top") + ops.position = 'LEFT_TOP' + ops.base = sc.muv_align_uv_cursor_align_method + ops = row.operator(align_uv_cursor.MUV_OT_AlignUVCursor.bl_idname, + text="Middle Top") + ops.position = 'MIDDLE_TOP' + ops.base = sc.muv_align_uv_cursor_align_method + ops = row.operator(align_uv_cursor.MUV_OT_AlignUVCursor.bl_idname, + text="Right Top") + ops.position = 'RIGHT_TOP' + ops.base = sc.muv_align_uv_cursor_align_method + + row = col.row(align=True) + ops = row.operator(align_uv_cursor.MUV_OT_AlignUVCursor.bl_idname, + text="Left Middle") + ops.position = 'LEFT_MIDDLE' + ops.base = sc.muv_align_uv_cursor_align_method + ops = row.operator(align_uv_cursor.MUV_OT_AlignUVCursor.bl_idname, + text="Center") + ops.position = 'CENTER' + ops.base = sc.muv_align_uv_cursor_align_method + ops = row.operator(align_uv_cursor.MUV_OT_AlignUVCursor.bl_idname, + text="Right Middle") + ops.position = 'RIGHT_MIDDLE' + ops.base = sc.muv_align_uv_cursor_align_method + + row = col.row(align=True) + ops = row.operator(align_uv_cursor.MUV_OT_AlignUVCursor.bl_idname, + text="Left Bottom") + ops.position = 'LEFT_BOTTOM' + ops.base = sc.muv_align_uv_cursor_align_method + ops = row.operator(align_uv_cursor.MUV_OT_AlignUVCursor.bl_idname, + text="Middle Bottom") + ops.position = 'MIDDLE_BOTTOM' + ops.base = sc.muv_align_uv_cursor_align_method + ops = row.operator(align_uv_cursor.MUV_OT_AlignUVCursor.bl_idname, + text="Right Bottom") + ops.position = 'RIGHT_BOTTOM' + ops.base = sc.muv_align_uv_cursor_align_method + + box = layout.box() + box.prop(sc, "muv_uv_cursor_location_enabled", + text="UV Cursor Location") + if sc.muv_uv_cursor_location_enabled: + box.prop(sc, "muv_align_uv_cursor_cursor_loc", text="") + + box = layout.box() + box.prop(sc, "muv_uv_bounding_box_enabled", text="UV Bounding Box") + if sc.muv_uv_bounding_box_enabled: + box.prop( + sc, "muv_uv_bounding_box_show", + text="Hide" + if uv_bounding_box.MUV_OT_UVBoundingBox.is_running(context) + else "Show", + icon='RESTRICT_VIEW_OFF' + if uv_bounding_box.MUV_OT_UVBoundingBox.is_running(context) + else 'RESTRICT_VIEW_ON') + box.prop(sc, "muv_uv_bounding_box_uniform_scaling", + text="Uniform Scaling") + box.prop(sc, "muv_uv_bounding_box_boundary", text="Boundary") + + box = layout.box() + box.prop(sc, "muv_uv_inspection_enabled", text="UV Inspection") + if sc.muv_uv_inspection_enabled: + row = box.row() + row.prop( + sc, "muv_uv_inspection_show", + text="Hide" + if uv_inspection.MUV_OT_UVInspection_Render.is_running(context) + else "Show", + icon='RESTRICT_VIEW_OFF' + if uv_inspection.MUV_OT_UVInspection_Render.is_running(context) + else 'RESTRICT_VIEW_ON') + row.operator(uv_inspection.MUV_OT_UVInspection_Update.bl_idname, + text="Update") + row = box.row() + row.prop(sc, "muv_uv_inspection_show_overlapped") + row.prop(sc, "muv_uv_inspection_show_flipped") + row = box.row() + row.prop(sc, "muv_uv_inspection_show_mode") diff --git a/uv_magic_uv/legacy/ui/uvedit_uv_manipulation.py b/uv_magic_uv/legacy/ui/uvedit_uv_manipulation.py new file mode 100644 index 00000000..96cf17d3 --- /dev/null +++ b/uv_magic_uv/legacy/ui/uvedit_uv_manipulation.py @@ -0,0 +1,130 @@ +# <pep8-80 compliant> + +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +__author__ = "Nutti <nutti.metro@gmail.com>" +__status__ = "production" +__version__ = "5.2" +__date__ = "17 Nov 2018" + +import bpy + +from ..op import ( + align_uv, + smooth_uv, + pack_uv, + select_uv, +) +from ...utils.bl_class_registry import BlClassRegistry + +__all__ = [ + 'MUV_PT_UVEdit_UVManipulation', +] + + +@BlClassRegistry(legacy=True) +class MUV_PT_UVEdit_UVManipulation(bpy.types.Panel): + """ + Panel class: UV Manipulation on Property Panel on UV/ImageEditor + """ + + bl_space_type = 'IMAGE_EDITOR' + bl_region_type = 'TOOLS' + bl_label = "UV Manipulation" + bl_category = "Magic UV" + bl_context = 'mesh_edit' + bl_options = {'DEFAULT_CLOSED'} + + def draw_header(self, _): + layout = self.layout + layout.label(text="", icon='IMAGE_COL') + + def draw(self, context): + sc = context.scene + layout = self.layout + + box = layout.box() + box.prop(sc, "muv_align_uv_enabled", text="Align UV") + if sc.muv_align_uv_enabled: + col = box.column() + row = col.row(align=True) + ops = row.operator(align_uv.MUV_OT_AlignUV_Circle.bl_idname, + text="Circle") + ops.transmission = sc.muv_align_uv_transmission + ops.select = sc.muv_align_uv_select + ops = row.operator(align_uv.MUV_OT_AlignUV_Straighten.bl_idname, + text="Straighten") + ops.transmission = sc.muv_align_uv_transmission + ops.select = sc.muv_align_uv_select + ops.vertical = sc.muv_align_uv_vertical + ops.horizontal = sc.muv_align_uv_horizontal + ops.mesh_infl = sc.muv_align_uv_mesh_infl + row = col.row() + ops = row.operator(align_uv.MUV_OT_AlignUV_Axis.bl_idname, + text="XY-axis") + ops.transmission = sc.muv_align_uv_transmission + ops.select = sc.muv_align_uv_select + ops.vertical = sc.muv_align_uv_vertical + ops.horizontal = sc.muv_align_uv_horizontal + ops.location = sc.muv_align_uv_location + ops.mesh_infl = sc.muv_align_uv_mesh_infl + row.prop(sc, "muv_align_uv_location", text="") + + col = box.column(align=True) + row = col.row(align=True) + row.prop(sc, "muv_align_uv_transmission", text="Transmission") + row.prop(sc, "muv_align_uv_select", text="Select") + row = col.row(align=True) + row.prop(sc, "muv_align_uv_vertical", text="Vertical") + row.prop(sc, "muv_align_uv_horizontal", text="Horizontal") + col.prop(sc, "muv_align_uv_mesh_infl", text="Mesh Influence") + + box = layout.box() + box.prop(sc, "muv_smooth_uv_enabled", text="Smooth UV") + if sc.muv_smooth_uv_enabled: + ops = box.operator(smooth_uv.MUV_OT_SmoothUV.bl_idname, + text="Smooth") + ops.transmission = sc.muv_smooth_uv_transmission + ops.select = sc.muv_smooth_uv_select + ops.mesh_infl = sc.muv_smooth_uv_mesh_infl + col = box.column(align=True) + row = col.row(align=True) + row.prop(sc, "muv_smooth_uv_transmission", text="Transmission") + row.prop(sc, "muv_smooth_uv_select", text="Select") + col.prop(sc, "muv_smooth_uv_mesh_infl", text="Mesh Influence") + + box = layout.box() + box.prop(sc, "muv_select_uv_enabled", text="Select UV") + if sc.muv_select_uv_enabled: + row = box.row(align=True) + row.operator(select_uv.MUV_OT_SelectUV_SelectOverlapped.bl_idname) + row.operator(select_uv.MUV_OT_SelectUV_SelectFlipped.bl_idname) + + box = layout.box() + box.prop(sc, "muv_pack_uv_enabled", text="Pack UV (Extension)") + if sc.muv_pack_uv_enabled: + ops = box.operator(pack_uv.MUV_OT_PackUV.bl_idname, text="Pack UV") + ops.allowable_center_deviation = \ + sc.muv_pack_uv_allowable_center_deviation + ops.allowable_size_deviation = \ + sc.muv_pack_uv_allowable_size_deviation + box.label("Allowable Center Deviation:") + box.prop(sc, "muv_pack_uv_allowable_center_deviation", text="") + box.label("Allowable Size Deviation:") + box.prop(sc, "muv_pack_uv_allowable_size_deviation", text="") diff --git a/uv_magic_uv/legacy/ui/view3d_copy_paste_uv_editmode.py b/uv_magic_uv/legacy/ui/view3d_copy_paste_uv_editmode.py new file mode 100644 index 00000000..ee2713b2 --- /dev/null +++ b/uv_magic_uv/legacy/ui/view3d_copy_paste_uv_editmode.py @@ -0,0 +1,93 @@ +# <pep8-80 compliant> + +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +__author__ = "Nutti <nutti.metro@gmail.com>" +__status__ = "production" +__version__ = "5.2" +__date__ = "17 Nov 2018" + +import bpy + +from ..op import ( + transfer_uv, + copy_paste_uv, +) +from ...utils.bl_class_registry import BlClassRegistry + +__all__ = [ + 'MUV_PT_View3D_Edit_CopyPasteUV', +] + + +@BlClassRegistry(legacy=True) +class MUV_PT_View3D_Edit_CopyPasteUV(bpy.types.Panel): + """ + Panel class: Copy/Paste UV on Property Panel on View3D + """ + + bl_space_type = 'VIEW_3D' + bl_region_type = 'TOOLS' + bl_label = "Copy/Paste UV" + bl_category = "Magic UV" + bl_context = 'mesh_edit' + bl_options = {'DEFAULT_CLOSED'} + + def draw_header(self, _): + layout = self.layout + layout.label(text="", icon='IMAGE_COL') + + def draw(self, context): + sc = context.scene + layout = self.layout + + box = layout.box() + box.prop(sc, "muv_copy_paste_uv_enabled", text="Copy/Paste UV") + if sc.muv_copy_paste_uv_enabled: + row = box.row(align=True) + if sc.muv_copy_paste_uv_mode == 'DEFAULT': + row.menu(copy_paste_uv.MUV_MT_CopyPasteUV_CopyUV.bl_idname, + text="Copy") + row.menu(copy_paste_uv.MUV_MT_CopyPasteUV_PasteUV.bl_idname, + text="Paste") + elif sc.muv_copy_paste_uv_mode == 'SEL_SEQ': + row.menu( + copy_paste_uv.MUV_MT_CopyPasteUV_SelSeqCopyUV.bl_idname, + text="Copy") + row.menu( + copy_paste_uv.MUV_MT_CopyPasteUV_SelSeqPasteUV.bl_idname, + text="Paste") + box.prop(sc, "muv_copy_paste_uv_mode", expand=True) + box.prop(sc, "muv_copy_paste_uv_copy_seams", text="Seams") + box.prop(sc, "muv_copy_paste_uv_strategy", text="Strategy") + + box = layout.box() + box.prop(sc, "muv_transfer_uv_enabled", text="Transfer UV") + if sc.muv_transfer_uv_enabled: + row = box.row(align=True) + row.operator(transfer_uv.MUV_OT_TransferUV_CopyUV.bl_idname, + text="Copy") + ops = row.operator(transfer_uv.MUV_OT_TransferUV_PasteUV.bl_idname, + text="Paste") + ops.invert_normals = sc.muv_transfer_uv_invert_normals + ops.copy_seams = sc.muv_transfer_uv_copy_seams + row = box.row() + row.prop(sc, "muv_transfer_uv_invert_normals", + text="Invert Normals") + row.prop(sc, "muv_transfer_uv_copy_seams", text="Seams") diff --git a/uv_magic_uv/legacy/ui/view3d_copy_paste_uv_objectmode.py b/uv_magic_uv/legacy/ui/view3d_copy_paste_uv_objectmode.py new file mode 100644 index 00000000..58031b0f --- /dev/null +++ b/uv_magic_uv/legacy/ui/view3d_copy_paste_uv_objectmode.py @@ -0,0 +1,65 @@ +# <pep8-80 compliant> + +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +__author__ = "Nutti <nutti.metro@gmail.com>" +__status__ = "production" +__version__ = "5.2" +__date__ = "17 Nov 2018" + +import bpy + +from ..op import copy_paste_uv_object +from ...utils.bl_class_registry import BlClassRegistry + +__all__ = [ + 'MUV_PT_View3D_Object_CopyPasteUV', +] + + +@BlClassRegistry(legacy=True) +class MUV_PT_View3D_Object_CopyPasteUV(bpy.types.Panel): + """ + Panel class: Copy/Paste UV on Property Panel on View3D + """ + + bl_space_type = 'VIEW_3D' + bl_region_type = 'TOOLS' + bl_label = "Copy/Paste UV" + bl_category = "Magic UV" + bl_context = 'objectmode' + bl_options = {'DEFAULT_CLOSED'} + + def draw_header(self, _): + layout = self.layout + layout.label(text="", icon='IMAGE_COL') + + def draw(self, context): + sc = context.scene + layout = self.layout + + row = layout.row(align=True) + row.menu( + copy_paste_uv_object.MUV_MT_CopyPasteUVObject_CopyUV.bl_idname, + text="Copy") + row.menu( + copy_paste_uv_object.MUV_MT_CopyPasteUVObject_PasteUV.bl_idname, + text="Paste") + layout.prop(sc, "muv_copy_paste_uv_object_copy_seams", + text="Seams") diff --git a/uv_magic_uv/legacy/ui/view3d_uv_manipulation.py b/uv_magic_uv/legacy/ui/view3d_uv_manipulation.py new file mode 100644 index 00000000..7d828a38 --- /dev/null +++ b/uv_magic_uv/legacy/ui/view3d_uv_manipulation.py @@ -0,0 +1,289 @@ +# <pep8-80 compliant> + +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +__author__ = "Nutti <nutti.metro@gmail.com>" +__status__ = "production" +__version__ = "5.2" +__date__ = "17 Nov 2018" + +import bpy + +from ..op import ( + move_uv, + flip_rotate_uv, + mirror_uv, + preserve_uv_aspect, + texture_lock, + texture_wrap, + uv_sculpt, + world_scale_uv, +) +from ..op.world_scale_uv import ( + MUV_OT_WorldScaleUV_ApplyProportionalToMesh, + MUV_OT_WorldScaleUV_ApplyScalingDensity +) +from ...utils.bl_class_registry import BlClassRegistry + +__all__ = [ + 'MUV_PT_View3D_UVManipulation', +] + + +@BlClassRegistry(legacy=True) +class MUV_PT_View3D_UVManipulation(bpy.types.Panel): + """ + Panel class: UV Manipulation on Property Panel on View3D + """ + + bl_space_type = 'VIEW_3D' + bl_region_type = 'TOOLS' + bl_label = "UV Manipulation" + bl_category = "Magic UV" + bl_context = 'mesh_edit' + bl_options = {'DEFAULT_CLOSED'} + + def draw_header(self, _): + layout = self.layout + layout.label(text="", icon='IMAGE_COL') + + def draw(self, context): + sc = context.scene + layout = self.layout + + box = layout.box() + box.prop(sc, "muv_flip_rotate_uv_enabled", text="Flip/Rotate UV") + if sc.muv_flip_rotate_uv_enabled: + row = box.row() + ops = row.operator(flip_rotate_uv.MUV_OT_FlipRotate.bl_idname, + text="Flip/Rotate") + ops.seams = sc.muv_flip_rotate_uv_seams + row.prop(sc, "muv_flip_rotate_uv_seams", text="Seams") + + box = layout.box() + box.prop(sc, "muv_mirror_uv_enabled", text="Mirror UV") + if sc.muv_mirror_uv_enabled: + row = box.row() + ops = row.operator(mirror_uv.MUV_OT_MirrorUV.bl_idname, + text="Mirror") + ops.axis = sc.muv_mirror_uv_axis + row.prop(sc, "muv_mirror_uv_axis", text="") + + box = layout.box() + box.prop(sc, "muv_move_uv_enabled", text="Move UV") + if sc.muv_move_uv_enabled: + col = box.column() + if not move_uv.MUV_OT_MoveUV.is_running(context): + col.operator(move_uv.MUV_OT_MoveUV.bl_idname, icon='PLAY', + text="Start") + else: + col.operator(move_uv.MUV_OT_MoveUV.bl_idname, icon='PAUSE', + text="Stop") + + box = layout.box() + box.prop(sc, "muv_world_scale_uv_enabled", text="World Scale UV") + if sc.muv_world_scale_uv_enabled: + box.prop(sc, "muv_world_scale_uv_mode", text="") + + if sc.muv_world_scale_uv_mode == 'MANUAL': + sp = box.split(percentage=0.5) + col = sp.column() + col.prop(sc, "muv_world_scale_uv_tgt_texture_size", + text="Texture Size") + sp = sp.split(percentage=1.0) + col = sp.column() + col.label("Density:") + col.prop(sc, "muv_world_scale_uv_tgt_density", text="") + box.prop(sc, "muv_world_scale_uv_origin", text="Origin") + ops = box.operator( + world_scale_uv.MUV_OT_WorldScaleUV_ApplyManual.bl_idname, + text="Apply") + ops.tgt_density = sc.muv_world_scale_uv_tgt_density + ops.tgt_texture_size = sc.muv_world_scale_uv_tgt_texture_size + ops.origin = sc.muv_world_scale_uv_origin + ops.show_dialog = False + + elif sc.muv_world_scale_uv_mode == 'SAME_DENSITY': + sp = box.split(percentage=0.4) + col = sp.column(align=True) + col.label("Source:") + sp = sp.split(percentage=1.0) + col = sp.column(align=True) + col.operator( + world_scale_uv.MUV_OT_WorldScaleUV_Measure.bl_idname, + text="Measure") + + sp = box.split(percentage=0.7) + col = sp.column(align=True) + col.prop(sc, "muv_world_scale_uv_src_density", text="Density") + col.enabled = False + sp = sp.split(percentage=1.0) + col = sp.column(align=True) + col.label("px2/cm2") + + box.separator() + box.prop(sc, "muv_world_scale_uv_origin", text="Origin") + ops = box.operator( + MUV_OT_WorldScaleUV_ApplyScalingDensity.bl_idname, + text="Apply") + ops.src_density = sc.muv_world_scale_uv_src_density + ops.origin = sc.muv_world_scale_uv_origin + ops.same_density = True + ops.show_dialog = False + + elif sc.muv_world_scale_uv_mode == 'SCALING_DENSITY': + sp = box.split(percentage=0.4) + col = sp.column(align=True) + col.label("Source:") + sp = sp.split(percentage=1.0) + col = sp.column(align=True) + col.operator( + world_scale_uv.MUV_OT_WorldScaleUV_Measure.bl_idname, + text="Measure") + + sp = box.split(percentage=0.7) + col = sp.column(align=True) + col.prop(sc, "muv_world_scale_uv_src_density", text="Density") + col.enabled = False + sp = sp.split(percentage=1.0) + col = sp.column(align=True) + col.label("px2/cm2") + + box.separator() + box.prop(sc, "muv_world_scale_uv_tgt_scaling_factor", + text="Scaling Factor") + box.prop(sc, "muv_world_scale_uv_origin", text="Origin") + ops = box.operator( + MUV_OT_WorldScaleUV_ApplyScalingDensity.bl_idname, + text="Apply") + ops.src_density = sc.muv_world_scale_uv_src_density + ops.origin = sc.muv_world_scale_uv_origin + ops.same_density = False + ops.show_dialog = False + ops.tgt_scaling_factor = \ + sc.muv_world_scale_uv_tgt_scaling_factor + + elif sc.muv_world_scale_uv_mode == 'PROPORTIONAL_TO_MESH': + sp = box.split(percentage=0.4) + col = sp.column(align=True) + col.label("Source:") + sp = sp.split(percentage=1.0) + col = sp.column(align=True) + col.operator( + world_scale_uv.MUV_OT_WorldScaleUV_Measure.bl_idname, + text="Measure") + + sp = box.split(percentage=0.7) + col = sp.column(align=True) + col.prop(sc, "muv_world_scale_uv_src_mesh_area", + text="Mesh Area") + col.prop(sc, "muv_world_scale_uv_src_uv_area", text="UV Area") + col.prop(sc, "muv_world_scale_uv_src_density", text="Density") + col.enabled = False + sp = sp.split(percentage=1.0) + col = sp.column(align=True) + col.label("cm2") + col.label("px2") + col.label("px2/cm2") + col.enabled = False + + box.separator() + box.prop(sc, "muv_world_scale_uv_origin", text="Origin") + ops = box.operator( + MUV_OT_WorldScaleUV_ApplyProportionalToMesh.bl_idname, + text="Apply") + ops.src_density = sc.muv_world_scale_uv_src_density + ops.src_uv_area = sc.muv_world_scale_uv_src_uv_area + ops.src_mesh_area = sc.muv_world_scale_uv_src_mesh_area + ops.origin = sc.muv_world_scale_uv_origin + ops.show_dialog = False + + box = layout.box() + box.prop(sc, "muv_preserve_uv_aspect_enabled", + text="Preserve UV Aspect") + if sc.muv_preserve_uv_aspect_enabled: + row = box.row() + ops = row.operator( + preserve_uv_aspect.MUV_OT_PreserveUVAspect.bl_idname, + text="Change Image") + ops.dest_img_name = sc.muv_preserve_uv_aspect_tex_image + ops.origin = sc.muv_preserve_uv_aspect_origin + row.prop(sc, "muv_preserve_uv_aspect_tex_image", text="") + box.prop(sc, "muv_preserve_uv_aspect_origin", text="Origin") + + box = layout.box() + box.prop(sc, "muv_texture_lock_enabled", text="Texture Lock") + if sc.muv_texture_lock_enabled: + row = box.row(align=True) + col = row.column(align=True) + col.label("Normal Mode:") + col = row.column(align=True) + col.operator( + texture_lock.MUV_OT_TextureLock_Lock.bl_idname, + text="Lock" + if not texture_lock.MUV_OT_TextureLock_Lock.is_ready(context) + else "ReLock") + ops = col.operator( + texture_lock.MUV_OT_TextureLock_Unlock.bl_idname, + text="Unlock") + ops.connect = sc.muv_texture_lock_connect + col.prop(sc, "muv_texture_lock_connect", text="Connect") + + row = box.row(align=True) + row.label("Interactive Mode:") + box.prop( + sc, "muv_texture_lock_lock", + text="Unlock" + if texture_lock.MUV_OT_TextureLock_Intr.is_running(context) + else "Lock", + icon='RESTRICT_VIEW_OFF' + if texture_lock.MUV_OT_TextureLock_Intr.is_running(context) + else 'RESTRICT_VIEW_ON') + + box = layout.box() + box.prop(sc, "muv_texture_wrap_enabled", text="Texture Wrap") + if sc.muv_texture_wrap_enabled: + row = box.row(align=True) + row.operator(texture_wrap.MUV_OT_TextureWrap_Refer.bl_idname, + text="Refer") + row.operator(texture_wrap.MUV_OT_TextureWrap_Set.bl_idname, + text="Set") + box.prop(sc, "muv_texture_wrap_set_and_refer") + box.prop(sc, "muv_texture_wrap_selseq") + + box = layout.box() + box.prop(sc, "muv_uv_sculpt_enabled", text="UV Sculpt") + if sc.muv_uv_sculpt_enabled: + box.prop( + sc, "muv_uv_sculpt_enable", + text="Disable"if uv_sculpt.MUV_OT_UVSculpt.is_running(context) + else "Enable", + icon='RESTRICT_VIEW_OFF' + if uv_sculpt.MUV_OT_UVSculpt.is_running(context) + else 'RESTRICT_VIEW_ON') + col = box.column() + col.label("Brush:") + col.prop(sc, "muv_uv_sculpt_radius") + col.prop(sc, "muv_uv_sculpt_strength") + box.prop(sc, "muv_uv_sculpt_tools") + if sc.muv_uv_sculpt_tools == 'PINCH': + box.prop(sc, "muv_uv_sculpt_pinch_invert") + elif sc.muv_uv_sculpt_tools == 'RELAX': + box.prop(sc, "muv_uv_sculpt_relax_method") + box.prop(sc, "muv_uv_sculpt_show_brush") diff --git a/uv_magic_uv/legacy/ui/view3d_uv_mapping.py b/uv_magic_uv/legacy/ui/view3d_uv_mapping.py new file mode 100644 index 00000000..3de86d0d --- /dev/null +++ b/uv_magic_uv/legacy/ui/view3d_uv_mapping.py @@ -0,0 +1,116 @@ +# <pep8-80 compliant> + +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +__author__ = "Nutti <nutti.metro@gmail.com>" +__status__ = "production" +__version__ = "5.2" +__date__ = "17 Nov 2018" + +import bpy + +from ..op import ( + uvw, + texture_projection, + unwrap_constraint, +) +from ..op.texture_projection import ( + MUV_OT_TextureProjection +) +from ...utils.bl_class_registry import BlClassRegistry + +__all__ = [ + 'MUV_PT_View3D_UVMapping', +] + + +@BlClassRegistry(legacy=True) +class MUV_PT_View3D_UVMapping(bpy.types.Panel): + """ + Panel class: UV Mapping on Property Panel on View3D + """ + + bl_space_type = 'VIEW_3D' + bl_region_type = 'TOOLS' + bl_label = "UV Mapping" + bl_category = "Magic UV" + bl_context = 'mesh_edit' + bl_options = {'DEFAULT_CLOSED'} + + def draw_header(self, _): + layout = self.layout + layout.label(text="", icon='IMAGE_COL') + + def draw(self, context): + sc = context.scene + layout = self.layout + + box = layout.box() + box.prop(sc, "muv_unwrap_constraint_enabled", text="Unwrap Constraint") + if sc.muv_unwrap_constraint_enabled: + ops = box.operator( + unwrap_constraint.MUV_OT_UnwrapConstraint.bl_idname, + text="Unwrap") + ops.u_const = sc.muv_unwrap_constraint_u_const + ops.v_const = sc.muv_unwrap_constraint_v_const + row = box.row(align=True) + row.prop(sc, "muv_unwrap_constraint_u_const", text="U-Constraint") + row.prop(sc, "muv_unwrap_constraint_v_const", text="V-Constraint") + + box = layout.box() + box.prop(sc, "muv_texture_projection_enabled", + text="Texture Projection") + if sc.muv_texture_projection_enabled: + row = box.row() + row.prop( + sc, "muv_texture_projection_enable", + text="Disable" + if MUV_OT_TextureProjection.is_running(context) + else "Enable", + icon='RESTRICT_VIEW_OFF' + if MUV_OT_TextureProjection.is_running(context) + else 'RESTRICT_VIEW_ON') + row.prop(sc, "muv_texture_projection_tex_image", text="") + box.prop(sc, "muv_texture_projection_tex_transparency", + text="Transparency") + col = box.column(align=True) + row = col.row() + row.prop(sc, "muv_texture_projection_adjust_window", + text="Adjust Window") + if not sc.muv_texture_projection_adjust_window: + row.prop(sc, "muv_texture_projection_tex_magnitude", + text="Magnitude") + col.prop(sc, "muv_texture_projection_apply_tex_aspect", + text="Texture Aspect Ratio") + col.prop(sc, "muv_texture_projection_assign_uvmap", + text="Assign UVMap") + box.operator( + texture_projection.MUV_OT_TextureProjection_Project.bl_idname, + text="Project") + + box = layout.box() + box.prop(sc, "muv_uvw_enabled", text="UVW") + if sc.muv_uvw_enabled: + row = box.row(align=True) + ops = row.operator(uvw.MUV_OT_UVW_BoxMap.bl_idname, text="Box") + ops.assign_uvmap = sc.muv_uvw_assign_uvmap + ops = row.operator(uvw.MUV_OT_UVW_BestPlanerMap.bl_idname, + text="Best Planner") + ops.assign_uvmap = sc.muv_uvw_assign_uvmap + box.prop(sc, "muv_uvw_assign_uvmap", text="Assign UVMap") |