diff options
Diffstat (limited to 'uv_magic_uv/ui')
-rw-r--r-- | uv_magic_uv/ui/IMAGE_MT_uvs.py | 56 | ||||
-rw-r--r-- | uv_magic_uv/ui/VIEW3D_MT_object.py | 54 | ||||
-rw-r--r-- | uv_magic_uv/ui/VIEW3D_MT_uv_map.py | 111 | ||||
-rw-r--r-- | uv_magic_uv/ui/__init__.py | 18 | ||||
-rw-r--r-- | uv_magic_uv/ui/uvedit_copy_paste_uv.py | 26 | ||||
-rw-r--r-- | uv_magic_uv/ui/uvedit_editor_enhance.py | 136 | ||||
-rw-r--r-- | uv_magic_uv/ui/uvedit_uv_manipulation.py | 117 | ||||
-rw-r--r-- | uv_magic_uv/ui/view3d_copy_paste_uv_editmode.py | 68 | ||||
-rw-r--r-- | uv_magic_uv/ui/view3d_copy_paste_uv_objectmode.py | 29 | ||||
-rw-r--r-- | uv_magic_uv/ui/view3d_uv_manipulation.py | 160 | ||||
-rw-r--r-- | uv_magic_uv/ui/view3d_uv_mapping.py | 63 |
11 files changed, 357 insertions, 481 deletions
diff --git a/uv_magic_uv/ui/IMAGE_MT_uvs.py b/uv_magic_uv/ui/IMAGE_MT_uvs.py new file mode 100644 index 00000000..e7dda379 --- /dev/null +++ b/uv_magic_uv/ui/IMAGE_MT_uvs.py @@ -0,0 +1,56 @@ +# <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_MT_CopyPasteUV_UVEdit', +] + + +@BlClassRegistry() +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") diff --git a/uv_magic_uv/ui/VIEW3D_MT_object.py b/uv_magic_uv/ui/VIEW3D_MT_object.py new file mode 100644 index 00000000..318cd82c --- /dev/null +++ b/uv_magic_uv/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() +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/ui/VIEW3D_MT_uv_map.py b/uv_magic_uv/ui/VIEW3D_MT_uv_map.py new file mode 100644 index 00000000..c5698504 --- /dev/null +++ b/uv_magic_uv/ui/VIEW3D_MT_uv_map.py @@ -0,0 +1,111 @@ +# <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.utils + +from ..op import ( + copy_paste_uv, + transfer_uv, + uvw, +) +from ..utils.bl_class_registry import BlClassRegistry + +__all__ = [ + 'MUV_MT_CopyPasteUV', + 'MUV_MT_TransferUV', + 'MUV_MT_UVW', +] + + +@BlClassRegistry() +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() +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() +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 diff --git a/uv_magic_uv/ui/__init__.py b/uv_magic_uv/ui/__init__.py index ad56aeb3..5f7e0c5e 100644 --- a/uv_magic_uv/ui/__init__.py +++ b/uv_magic_uv/ui/__init__.py @@ -20,25 +20,27 @@ __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" -__version__ = "5.1" -__date__ = "24 Feb 2018" +__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_copy_paste_uv_objectmode) 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_enhance) + importlib.reload(VIEW3D_MT_object) + importlib.reload(VIEW3D_MT_uv_map) + importlib.reload(IMAGE_MT_uvs) else: - from . import view3d_copy_paste_uv_objectmode from . import view3d_copy_paste_uv_editmode + from . import view3d_copy_paste_uv_objectmode 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_enhance + from . import VIEW3D_MT_object + from . import VIEW3D_MT_uv_map + from . import IMAGE_MT_uvs import bpy diff --git a/uv_magic_uv/ui/uvedit_copy_paste_uv.py b/uv_magic_uv/ui/uvedit_copy_paste_uv.py index d87dbef3..e21a5abd 100644 --- a/uv_magic_uv/ui/uvedit_copy_paste_uv.py +++ b/uv_magic_uv/ui/uvedit_copy_paste_uv.py @@ -20,21 +20,27 @@ __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" -__version__ = "5.1" -__date__ = "24 Feb 2018" +__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', +] -class IMAGE_PT_MUV_CPUV(bpy.types.Panel): + +@BlClassRegistry() +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_region_type = 'UI' bl_label = "Copy/Paste UV" bl_category = "Magic UV" bl_context = 'mesh_edit' @@ -42,13 +48,15 @@ class IMAGE_PT_MUV_CPUV(bpy.types.Panel): def draw_header(self, _): layout = self.layout - layout.label(text="", icon='IMAGE_COL') + layout.label(text="", icon='IMAGE') def draw(self, _): layout = self.layout row = layout.row(align=True) - row.operator(copy_paste_uv_uvedit.MUV_CPUVIECopyUV.bl_idname, - text="Copy") - row.operator(copy_paste_uv_uvedit.MUV_CPUVIEPasteUV.bl_idname, - text="Paste") + 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/ui/uvedit_editor_enhance.py b/uv_magic_uv/ui/uvedit_editor_enhance.py deleted file mode 100644 index 88a2492c..00000000 --- a/uv_magic_uv/ui/uvedit_editor_enhance.py +++ /dev/null @@ -1,136 +0,0 @@ -# <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.1" -__date__ = "24 Feb 2018" - -import bpy - -from ..op import align_uv_cursor -from ..op import uv_bounding_box -from ..op import uv_inspection - - -class IMAGE_PT_MUV_EE(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 - props = sc.muv_props - - box = layout.box() - box.prop(sc, "muv_auvc_enabled", text="Align UV Cursor") - if sc.muv_auvc_enabled: - box.prop(sc, "muv_auvc_align_menu", expand=True) - - col = box.column(align=True) - - row = col.row(align=True) - ops = row.operator(align_uv_cursor.MUV_AUVCAlignOps.bl_idname, - text="Left Top") - ops.position = 'LEFT_TOP' - ops.base = sc.muv_auvc_align_menu - ops = row.operator(align_uv_cursor.MUV_AUVCAlignOps.bl_idname, - text="Middle Top") - ops.position = 'MIDDLE_TOP' - ops.base = sc.muv_auvc_align_menu - ops = row.operator(align_uv_cursor.MUV_AUVCAlignOps.bl_idname, - text="Right Top") - ops.position = 'RIGHT_TOP' - ops.base = sc.muv_auvc_align_menu - - row = col.row(align=True) - ops = row.operator(align_uv_cursor.MUV_AUVCAlignOps.bl_idname, - text="Left Middle") - ops.position = 'LEFT_MIDDLE' - ops.base = sc.muv_auvc_align_menu - ops = row.operator(align_uv_cursor.MUV_AUVCAlignOps.bl_idname, - text="Center") - ops.position = 'CENTER' - ops.base = sc.muv_auvc_align_menu - ops = row.operator(align_uv_cursor.MUV_AUVCAlignOps.bl_idname, - text="Right Middle") - ops.position = 'RIGHT_MIDDLE' - ops.base = sc.muv_auvc_align_menu - - row = col.row(align=True) - ops = row.operator(align_uv_cursor.MUV_AUVCAlignOps.bl_idname, - text="Left Bottom") - ops.position = 'LEFT_BOTTOM' - ops.base = sc.muv_auvc_align_menu - ops = row.operator(align_uv_cursor.MUV_AUVCAlignOps.bl_idname, - text="Middle Bottom") - ops.position = 'MIDDLE_BOTTOM' - ops.base = sc.muv_auvc_align_menu - ops = row.operator(align_uv_cursor.MUV_AUVCAlignOps.bl_idname, - text="Right Bottom") - ops.position = 'RIGHT_BOTTOM' - ops.base = sc.muv_auvc_align_menu - - box = layout.box() - box.prop(sc, "muv_uvcloc_enabled", text="UV Cursor Location") - if sc.muv_uvcloc_enabled: - box.prop(sc, "muv_auvc_cursor_loc", text="") - - box = layout.box() - box.prop(sc, "muv_uvbb_enabled", text="UV Bounding Box") - if sc.muv_uvbb_enabled: - if props.uvbb.running is False: - box.operator(uv_bounding_box.MUV_UVBBUpdater.bl_idname, - text="Display", icon='PLAY') - else: - box.operator(uv_bounding_box.MUV_UVBBUpdater.bl_idname, - text="Hide", icon='PAUSE') - box.prop(sc, "muv_uvbb_uniform_scaling", text="Uniform Scaling") - box.prop(sc, "muv_uvbb_boundary", text="Boundary") - - box = layout.box() - box.prop(sc, "muv_uvinsp_enabled", text="UV Inspection") - if sc.muv_uvinsp_enabled: - row = box.row() - if not sc.muv_props.uvinsp.display_running: - row.operator(uv_inspection.MUV_UVInspDisplay.bl_idname, - text="Display", icon='PLAY') - else: - row.operator(uv_inspection.MUV_UVInspDisplay.bl_idname, - text="Hide", icon='PAUSE') - row.operator(uv_inspection.MUV_UVInspUpdate.bl_idname, - text="Update") - row = box.row() - row.prop(sc, "muv_uvinsp_show_overlapped") - row.prop(sc, "muv_uvinsp_show_flipped") - row = box.row() - row.prop(sc, "muv_uvinsp_show_mode") diff --git a/uv_magic_uv/ui/uvedit_uv_manipulation.py b/uv_magic_uv/ui/uvedit_uv_manipulation.py deleted file mode 100644 index f391c4cb..00000000 --- a/uv_magic_uv/ui/uvedit_uv_manipulation.py +++ /dev/null @@ -1,117 +0,0 @@ -# <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.1" -__date__ = "24 Feb 2018" - -import bpy - -from ..op import uv_inspection -from ..op import align_uv -from ..op import smooth_uv -from ..op import pack_uv - - -class IMAGE_PT_MUV_UVManip(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_auv_enabled", text="Align UV") - if sc.muv_auv_enabled: - col = box.column() - row = col.row(align=True) - ops = row.operator(align_uv.MUV_AUVCircle.bl_idname, text="Circle") - ops.transmission = sc.muv_auv_transmission - ops.select = sc.muv_auv_select - ops = row.operator(align_uv.MUV_AUVStraighten.bl_idname, - text="Straighten") - ops.transmission = sc.muv_auv_transmission - ops.select = sc.muv_auv_select - ops.vertical = sc.muv_auv_vertical - ops.horizontal = sc.muv_auv_horizontal - row = col.row() - ops = row.operator(align_uv.MUV_AUVAxis.bl_idname, text="XY-axis") - ops.transmission = sc.muv_auv_transmission - ops.select = sc.muv_auv_select - ops.vertical = sc.muv_auv_vertical - ops.horizontal = sc.muv_auv_horizontal - ops.location = sc.muv_auv_location - row.prop(sc, "muv_auv_location", text="") - - col = box.column(align=True) - row = col.row(align=True) - row.prop(sc, "muv_auv_transmission", text="Transmission") - row.prop(sc, "muv_auv_select", text="Select") - row = col.row(align=True) - row.prop(sc, "muv_auv_vertical", text="Vertical") - row.prop(sc, "muv_auv_horizontal", text="Horizontal") - - box = layout.box() - box.prop(sc, "muv_smuv_enabled", text="Smooth UV") - if sc.muv_smuv_enabled: - ops = box.operator(smooth_uv.MUV_AUVSmooth.bl_idname, - text="Smooth") - ops.transmission = sc.muv_smuv_transmission - ops.select = sc.muv_smuv_select - ops.mesh_infl = sc.muv_smuv_mesh_infl - col = box.column(align=True) - row = col.row(align=True) - row.prop(sc, "muv_smuv_transmission", text="Transmission") - row.prop(sc, "muv_smuv_select", text="Select") - col.prop(sc, "muv_smuv_mesh_infl", text="Mesh Influence") - - box = layout.box() - box.prop(sc, "muv_seluv_enabled", text="Select UV") - if sc.muv_seluv_enabled: - row = box.row(align=True) - row.operator(uv_inspection.MUV_UVInspSelectOverlapped.bl_idname) - row.operator(uv_inspection.MUV_UVInspSelectFlipped.bl_idname) - - box = layout.box() - box.prop(sc, "muv_packuv_enabled", text="Pack UV (Extension)") - if sc.muv_packuv_enabled: - ops = box.operator(pack_uv.MUV_PackUV.bl_idname, text="Pack UV") - ops.allowable_center_deviation = \ - sc.muv_packuv_allowable_center_deviation - ops.allowable_size_deviation = \ - sc.muv_packuv_allowable_size_deviation - box.label("Allowable Center Deviation:") - box.prop(sc, "muv_packuv_allowable_center_deviation", text="") - box.label("Allowable Size Deviation:") - box.prop(sc, "muv_packuv_allowable_size_deviation", text="") diff --git a/uv_magic_uv/ui/view3d_copy_paste_uv_editmode.py b/uv_magic_uv/ui/view3d_copy_paste_uv_editmode.py index a22adf03..14fba24a 100644 --- a/uv_magic_uv/ui/view3d_copy_paste_uv_editmode.py +++ b/uv_magic_uv/ui/view3d_copy_paste_uv_editmode.py @@ -20,22 +20,30 @@ __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" -__version__ = "5.1" -__date__ = "24 Feb 2018" +__version__ = "5.2" +__date__ = "17 Nov 2018" import bpy -from ..op import copy_paste_uv -from ..op import transfer_uv +from ..op import ( + copy_paste_uv, + transfer_uv, +) +from ..utils.bl_class_registry import BlClassRegistry +__all__ = [ + 'MUV_PT_CopyPasteUVEditMode', +] -class OBJECT_PT_MUV_CPUV(bpy.types.Panel): + +@BlClassRegistry() +class MUV_PT_CopyPasteUVEditMode(bpy.types.Panel): """ Panel class: Copy/Paste UV on Property Panel on View3D """ bl_space_type = 'VIEW_3D' - bl_region_type = 'TOOLS' + bl_region_type = 'UI' bl_label = "Copy/Paste UV" bl_category = "Magic UV" bl_context = 'mesh_edit' @@ -43,39 +51,43 @@ class OBJECT_PT_MUV_CPUV(bpy.types.Panel): def draw_header(self, _): layout = self.layout - layout.label(text="", icon='IMAGE_COL') + layout.label(text="", icon='IMAGE') def draw(self, context): sc = context.scene layout = self.layout box = layout.box() - box.prop(sc, "muv_cpuv_enabled", text="Copy/Paste UV") - if sc.muv_cpuv_enabled: + 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_cpuv_mode == 'DEFAULT': - row.menu(copy_paste_uv.MUV_CPUVCopyUVMenu.bl_idname, - text="Copy") - row.menu(copy_paste_uv.MUV_CPUVPasteUVMenu.bl_idname, - text="Paste") - elif sc.muv_cpuv_mode == 'SEL_SEQ': - row.menu(copy_paste_uv.MUV_CPUVSelSeqCopyUVMenu.bl_idname, + 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_CPUVSelSeqPasteUVMenu.bl_idname, + row.menu(copy_paste_uv.MUV_MT_CopyPasteUV_PasteUV.bl_idname, text="Paste") - box.prop(sc, "muv_cpuv_mode", expand=True) - box.prop(sc, "muv_cpuv_copy_seams", text="Seams") - box.prop(sc, "muv_cpuv_strategy", text="Strategy") + 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_transuv_enabled", text="Transfer UV") - if sc.muv_transuv_enabled: + 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_TransUVCopy.bl_idname, text="Copy") - ops = row.operator(transfer_uv.MUV_TransUVPaste.bl_idname, + 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_transuv_invert_normals - ops.copy_seams = sc.muv_transuv_copy_seams + 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_transuv_invert_normals", text="Invert Normals") - row.prop(sc, "muv_transuv_copy_seams", text="Seams") + 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/ui/view3d_copy_paste_uv_objectmode.py b/uv_magic_uv/ui/view3d_copy_paste_uv_objectmode.py index f9e2bec0..6dd0d3b4 100644 --- a/uv_magic_uv/ui/view3d_copy_paste_uv_objectmode.py +++ b/uv_magic_uv/ui/view3d_copy_paste_uv_objectmode.py @@ -20,21 +20,27 @@ __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" -__version__ = "5.1" -__date__ = "24 Feb 2018" +__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', +] -class OBJECT_PT_MUV_CPUVObj(bpy.types.Panel): + +@BlClassRegistry() +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_region_type = 'UI' bl_label = "Copy/Paste UV" bl_category = "Magic UV" bl_context = 'objectmode' @@ -42,15 +48,18 @@ class OBJECT_PT_MUV_CPUVObj(bpy.types.Panel): def draw_header(self, _): layout = self.layout - layout.label(text="", icon='IMAGE_COL') + layout.label(text="", icon='IMAGE') def draw(self, context): sc = context.scene layout = self.layout row = layout.row(align=True) - row.menu(copy_paste_uv_object.MUV_CPUVObjCopyUVMenu.bl_idname, - text="Copy") - row.menu(copy_paste_uv_object.MUV_CPUVObjPasteUVMenu.bl_idname, - text="Paste") - layout.prop(sc, "muv_cpuv_copy_seams", text="Copy Seams") + 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/ui/view3d_uv_manipulation.py b/uv_magic_uv/ui/view3d_uv_manipulation.py index 1e9b7d7e..365a0dc8 100644 --- a/uv_magic_uv/ui/view3d_uv_manipulation.py +++ b/uv_magic_uv/ui/view3d_uv_manipulation.py @@ -20,28 +20,31 @@ __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" -__version__ = "5.1" -__date__ = "24 Feb 2018" +__version__ = "5.2" +__date__ = "17 Nov 2018" import bpy -from ..op import flip_rotate_uv -from ..op import mirror_uv -from ..op import move_uv -from ..op import preserve_uv_aspect -from ..op import texture_lock -from ..op import texture_wrap -from ..op import uv_sculpt -from ..op import world_scale_uv +from ..op import ( + flip_rotate_uv, + mirror_uv, + move_uv, +) +from ..utils.bl_class_registry import BlClassRegistry +__all__ = [ + 'MUV_PT_View3D_UVManipulation', +] -class OBJECT_PT_MUV_UVManip(bpy.types.Panel): + +@BlClassRegistry() +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_region_type = 'UI' bl_label = "UV Manipulation" bl_category = "Magic UV" bl_context = 'mesh_edit' @@ -49,132 +52,37 @@ class OBJECT_PT_MUV_UVManip(bpy.types.Panel): def draw_header(self, _): layout = self.layout - layout.label(text="", icon='IMAGE_COL') + layout.label(text="", icon='IMAGE') def draw(self, context): sc = context.scene - props = sc.muv_props layout = self.layout box = layout.box() - box.prop(sc, "muv_fliprot_enabled", text="Flip/Rotate UV") - if sc.muv_fliprot_enabled: + 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_FlipRot.bl_idname, + ops = row.operator(flip_rotate_uv.MUV_OT_FlipRotate.bl_idname, text="Flip/Rotate") - ops.seams = sc.muv_fliprot_seams - row.prop(sc, "muv_fliprot_seams", text="Seams") + 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_mirroruv_enabled", text="Mirror UV") - if sc.muv_mirroruv_enabled: + 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_MirrorUV.bl_idname, text="Mirror") - ops.axis = sc.muv_mirroruv_axis - row.prop(sc, "muv_mirroruv_axis", text="") + 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_mvuv_enabled", text="Move UV") - if sc.muv_mvuv_enabled: + box.prop(sc, "muv_move_uv_enabled", text="Move UV") + if sc.muv_move_uv_enabled: col = box.column() - col.operator(move_uv.MUV_MVUV.bl_idname, icon='PLAY', text="Start") - if props.mvuv.running: - col.enabled = False - else: - col.enabled = True - - box = layout.box() - box.prop(sc, "muv_wsuv_enabled", text="World Scale UV") - if sc.muv_wsuv_enabled: - row = box.row(align=True) - row.operator(world_scale_uv.MUV_WSUVMeasure.bl_idname, - text="Measure") - ops = row.operator(world_scale_uv.MUV_WSUVApply.bl_idname, - text="Apply") - ops.origin = sc.muv_wsuv_origin - box.label("Source:") - sp = box.split(percentage=0.7) - col = sp.column(align=True) - col.prop(sc, "muv_wsuv_src_mesh_area", text="Mesh Area") - col.prop(sc, "muv_wsuv_src_uv_area", text="UV Area") - col.prop(sc, "muv_wsuv_src_density", text="Density") - col.enabled = False - sp = sp.split(percentage=1.0) - col = sp.column(align=True) - col.label("cm x cm") - col.label("px x px") - col.label("px/cm") - col.enabled = False - sp = box.split(percentage=0.3) - sp.label("Mode:") - sp = sp.split(percentage=1.0) - col = sp.column() - col.prop(sc, "muv_wsuv_mode", text="") - if sc.muv_wsuv_mode == 'USER': - col.prop(sc, "muv_wsuv_tgt_density", text="Density") - if sc.muv_wsuv_mode == 'SCALING': - col.prop(sc, "muv_wsuv_scaling_factor", text="Scaling Factor") - box.prop(sc, "muv_wsuv_origin", text="Origin") - - box = layout.box() - box.prop(sc, "muv_preserve_uv_enabled", text="Preserve UV Aspect") - if sc.muv_preserve_uv_enabled: - row = box.row() - ops = row.operator( - preserve_uv_aspect.MUV_PreserveUVAspect.bl_idname, - text="Change Image") - ops.dest_img_name = sc.muv_preserve_uv_tex_image - ops.origin = sc.muv_preserve_uv_origin - row.prop(sc, "muv_preserve_uv_tex_image", text="") - box.prop(sc, "muv_preserve_uv_origin", text="Origin") - - box = layout.box() - box.prop(sc, "muv_texlock_enabled", text="Texture Lock") - if sc.muv_texlock_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_TexLockStart.bl_idname, text="Lock") - ops = col.operator(texture_lock.MUV_TexLockStop.bl_idname, - text="Unlock") - ops.connect = sc.muv_texlock_connect - col.prop(sc, "muv_texlock_connect", text="Connect") - - row = box.row(align=True) - row.label("Interactive Mode:") - if not props.texlock.intr_running: - row.operator(texture_lock.MUV_TexLockIntrStart.bl_idname, - icon='PLAY', text="Start") - else: - row.operator(texture_lock.MUV_TexLockIntrStop.bl_idname, - icon="PAUSE", text="Stop") - - box = layout.box() - box.prop(sc, "muv_texwrap_enabled", text="Texture Wrap") - if sc.muv_texwrap_enabled: - row = box.row(align=True) - row.operator(texture_wrap.MUV_TexWrapRefer.bl_idname, text="Refer") - row.operator(texture_wrap.MUV_TexWrapSet.bl_idname, text="Set") - box.prop(sc, "muv_texwrap_set_and_refer") - box.prop(sc, "muv_texwrap_selseq") - - box = layout.box() - box.prop(sc, "muv_uvsculpt_enabled", text="UV Sculpt") - if sc.muv_uvsculpt_enabled: - if not props.uvsculpt.running: - box.operator(uv_sculpt.MUV_UVSculptOps.bl_idname, - icon='PLAY', text="Start") + if not move_uv.MUV_OT_MoveUV.is_running(context): + col.operator(move_uv.MUV_OT_MoveUV.bl_idname, icon='PLAY', + text="Start") else: - box.operator(uv_sculpt.MUV_UVSculptOps.bl_idname, - icon='PAUSE', text="Stop") - col = box.column() - col.label("Brush:") - col.prop(sc, "muv_uvsculpt_radius") - col.prop(sc, "muv_uvsculpt_strength") - box.prop(sc, "muv_uvsculpt_tools") - if sc.muv_uvsculpt_tools == 'PINCH': - box.prop(sc, "muv_uvsculpt_pinch_invert") - elif sc.muv_uvsculpt_tools == 'RELAX': - box.prop(sc, "muv_uvsculpt_relax_method") - box.prop(sc, "muv_uvsculpt_show_brush") + col.operator(move_uv.MUV_OT_MoveUV.bl_idname, icon='PAUSE', + text="Stop") diff --git a/uv_magic_uv/ui/view3d_uv_mapping.py b/uv_magic_uv/ui/view3d_uv_mapping.py index 2dc241c0..c596008e 100644 --- a/uv_magic_uv/ui/view3d_uv_mapping.py +++ b/uv_magic_uv/ui/view3d_uv_mapping.py @@ -20,23 +20,29 @@ __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" -__version__ = "5.1" -__date__ = "24 Feb 2018" +__version__ = "5.2" +__date__ = "17 Nov 2018" import bpy -from ..op import texture_projection -from ..op import unwrap_constraint -from ..op import uvw +from ..op import ( + uvw, +) +from ..utils.bl_class_registry import BlClassRegistry +__all__ = [ + 'MUV_PT_View3D_UVMapping', +] -class OBJECT_PT_MUV_UVMapping(bpy.types.Panel): + +@BlClassRegistry() +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_region_type = 'UI' bl_label = "UV Mapping" bl_category = "Magic UV" bl_context = 'mesh_edit' @@ -44,56 +50,19 @@ class OBJECT_PT_MUV_UVMapping(bpy.types.Panel): def draw_header(self, _): layout = self.layout - layout.label(text="", icon='IMAGE_COL') + layout.label(text="", icon='IMAGE') def draw(self, context): sc = context.scene - props = sc.muv_props layout = self.layout box = layout.box() - box.prop(sc, "muv_unwrapconst_enabled", text="Unwrap Constraint") - if sc.muv_unwrapconst_enabled: - ops = box.operator( - unwrap_constraint.MUV_UnwrapConstraint.bl_idname, - text="Unwrap") - ops.u_const = sc.muv_unwrapconst_u_const - ops.v_const = sc.muv_unwrapconst_v_const - row = box.row(align=True) - row.prop(sc, "muv_unwrapconst_u_const", text="U-Constraint") - row.prop(sc, "muv_unwrapconst_v_const", text="V-Constraint") - - box = layout.box() - box.prop(sc, "muv_texproj_enabled", text="Texture Projection") - if sc.muv_texproj_enabled: - row = box.row() - if not props.texproj.running: - row.operator(texture_projection.MUV_TexProjStart.bl_idname, - text="Start", icon='PLAY') - else: - row.operator(texture_projection.MUV_TexProjStop.bl_idname, - text="Stop", icon='PAUSE') - row.prop(sc, "muv_texproj_tex_image", text="") - box.prop(sc, "muv_texproj_tex_transparency", text="Transparency") - col = box.column(align=True) - row = col.row() - row.prop(sc, "muv_texproj_adjust_window", text="Adjust Window") - if not sc.muv_texproj_adjust_window: - row.prop(sc, "muv_texproj_tex_magnitude", text="Magnitude") - col.prop(sc, "muv_texproj_apply_tex_aspect", - text="Texture Aspect Ratio") - col.prop(sc, "muv_texproj_assign_uvmap", text="Assign UVMap") - if props.texproj.running: - box.operator(texture_projection.MUV_TexProjProject.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_UVWBoxMap.bl_idname, text="Box") + 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_UVWBestPlanerMap.bl_idname, + 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") |