diff options
Diffstat (limited to 'uv_magic_uv/ui/view3d_copy_paste_uv_editmode.py')
-rw-r--r-- | uv_magic_uv/ui/view3d_copy_paste_uv_editmode.py | 68 |
1 files changed, 40 insertions, 28 deletions
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") |