diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-04-30 16:38:47 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-04-30 16:38:47 +0300 |
commit | be6b526d00d81a09a2e385b9ebf6bf5f002dee75 (patch) | |
tree | e91bf0796858d87a99ecaebc4728f6134f2df89d /uv_magic_uv/ui | |
parent | e6a5a2a679b3502505810ddb72423ab9f3098fee (diff) | |
parent | 4b91309b122bcdcddd1854b1137407b2c4f55c7e (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'uv_magic_uv/ui')
-rw-r--r-- | uv_magic_uv/ui/__init__.py | 44 | ||||
-rw-r--r-- | uv_magic_uv/ui/uvedit_copy_paste_uv.py | 54 | ||||
-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 | 81 | ||||
-rw-r--r-- | uv_magic_uv/ui/view3d_copy_paste_uv_objectmode.py | 56 | ||||
-rw-r--r-- | uv_magic_uv/ui/view3d_uv_manipulation.py | 180 | ||||
-rw-r--r-- | uv_magic_uv/ui/view3d_uv_mapping.py | 99 |
8 files changed, 767 insertions, 0 deletions
diff --git a/uv_magic_uv/ui/__init__.py b/uv_magic_uv/ui/__init__.py new file mode 100644 index 00000000..ad56aeb3 --- /dev/null +++ b/uv_magic_uv/ui/__init__.py @@ -0,0 +1,44 @@ +# <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" + +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_enhance) +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_enhance + +import bpy diff --git a/uv_magic_uv/ui/uvedit_copy_paste_uv.py b/uv_magic_uv/ui/uvedit_copy_paste_uv.py new file mode 100644 index 00000000..d87dbef3 --- /dev/null +++ b/uv_magic_uv/ui/uvedit_copy_paste_uv.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.1" +__date__ = "24 Feb 2018" + +import bpy + +from ..op import copy_paste_uv_uvedit + + +class IMAGE_PT_MUV_CPUV(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_CPUVIECopyUV.bl_idname, + text="Copy") + row.operator(copy_paste_uv_uvedit.MUV_CPUVIEPasteUV.bl_idname, + text="Paste") diff --git a/uv_magic_uv/ui/uvedit_editor_enhance.py b/uv_magic_uv/ui/uvedit_editor_enhance.py new file mode 100644 index 00000000..88a2492c --- /dev/null +++ b/uv_magic_uv/ui/uvedit_editor_enhance.py @@ -0,0 +1,136 @@ +# <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 new file mode 100644 index 00000000..f391c4cb --- /dev/null +++ b/uv_magic_uv/ui/uvedit_uv_manipulation.py @@ -0,0 +1,117 @@ +# <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 new file mode 100644 index 00000000..a22adf03 --- /dev/null +++ b/uv_magic_uv/ui/view3d_copy_paste_uv_editmode.py @@ -0,0 +1,81 @@ +# <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 copy_paste_uv +from ..op import transfer_uv + + +class OBJECT_PT_MUV_CPUV(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_cpuv_enabled", text="Copy/Paste UV") + if sc.muv_cpuv_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, + text="Copy") + row.menu(copy_paste_uv.MUV_CPUVSelSeqPasteUVMenu.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") + + box = layout.box() + box.prop(sc, "muv_transuv_enabled", text="Transfer UV") + if sc.muv_transuv_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, + text="Paste") + ops.invert_normals = sc.muv_transuv_invert_normals + ops.copy_seams = sc.muv_transuv_copy_seams + row = box.row() + row.prop(sc, "muv_transuv_invert_normals", text="Invert Normals") + row.prop(sc, "muv_transuv_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 new file mode 100644 index 00000000..f9e2bec0 --- /dev/null +++ b/uv_magic_uv/ui/view3d_copy_paste_uv_objectmode.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.1" +__date__ = "24 Feb 2018" + +import bpy + +from ..op import copy_paste_uv_object + + +class OBJECT_PT_MUV_CPUVObj(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_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") diff --git a/uv_magic_uv/ui/view3d_uv_manipulation.py b/uv_magic_uv/ui/view3d_uv_manipulation.py new file mode 100644 index 00000000..1e9b7d7e --- /dev/null +++ b/uv_magic_uv/ui/view3d_uv_manipulation.py @@ -0,0 +1,180 @@ +# <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 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 + + +class OBJECT_PT_MUV_UVManip(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 + 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: + row = box.row() + ops = row.operator(flip_rotate_uv.MUV_FlipRot.bl_idname, + text="Flip/Rotate") + ops.seams = sc.muv_fliprot_seams + row.prop(sc, "muv_fliprot_seams", text="Seams") + + box = layout.box() + box.prop(sc, "muv_mirroruv_enabled", text="Mirror UV") + if sc.muv_mirroruv_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="") + + box = layout.box() + box.prop(sc, "muv_mvuv_enabled", text="Move UV") + if sc.muv_mvuv_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") + 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") diff --git a/uv_magic_uv/ui/view3d_uv_mapping.py b/uv_magic_uv/ui/view3d_uv_mapping.py new file mode 100644 index 00000000..2dc241c0 --- /dev/null +++ b/uv_magic_uv/ui/view3d_uv_mapping.py @@ -0,0 +1,99 @@ +# <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 texture_projection +from ..op import unwrap_constraint +from ..op import uvw + + +class OBJECT_PT_MUV_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 + 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.assign_uvmap = sc.muv_uvw_assign_uvmap + ops = row.operator(uvw.MUV_UVWBestPlanerMap.bl_idname, + text="Best Planner") + ops.assign_uvmap = sc.muv_uvw_assign_uvmap + box.prop(sc, "muv_uvw_assign_uvmap", text="Assign UVMap") |