diff options
Diffstat (limited to 'magic_uv/ui')
-rw-r--r-- | magic_uv/ui/IMAGE_MT_uvs.py | 14 | ||||
-rw-r--r-- | magic_uv/ui/VIEW3D_MT_object.py | 6 | ||||
-rw-r--r-- | magic_uv/ui/VIEW3D_MT_uv_map.py | 20 | ||||
-rw-r--r-- | magic_uv/ui/__init__.py | 4 | ||||
-rw-r--r-- | magic_uv/ui/uvedit_copy_paste_uv.py | 5 | ||||
-rw-r--r-- | magic_uv/ui/uvedit_editor_enhancement.py | 5 | ||||
-rw-r--r-- | magic_uv/ui/uvedit_uv_manipulation.py | 5 | ||||
-rw-r--r-- | magic_uv/ui/view3d_copy_paste_uv_editmode.py | 4 | ||||
-rw-r--r-- | magic_uv/ui/view3d_copy_paste_uv_objectmode.py | 4 | ||||
-rw-r--r-- | magic_uv/ui/view3d_uv_manipulation.py | 95 | ||||
-rw-r--r-- | magic_uv/ui/view3d_uv_mapping.py | 4 |
11 files changed, 101 insertions, 65 deletions
diff --git a/magic_uv/ui/IMAGE_MT_uvs.py b/magic_uv/ui/IMAGE_MT_uvs.py index ab7e33f8..f723a007 100644 --- a/magic_uv/ui/IMAGE_MT_uvs.py +++ b/magic_uv/ui/IMAGE_MT_uvs.py @@ -20,8 +20,8 @@ __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" -__version__ = "6.0" -__date__ = "26 Jan 2019" +__version__ = "6.1" +__date__ = "19 May 2019" import bpy @@ -49,7 +49,7 @@ class MUV_MT_CopyPasteUV_UVEdit(bpy.types.Menu): Menu class: Master menu of Copy/Paste UV coordinate on UV/ImageEditor """ - bl_idname = "uv.muv_mt_copy_paste_uv_uvedit" + bl_idname = "MUV_MT_CopyPasteUV_UVEdit" bl_label = "Copy/Paste UV" bl_description = "Copy and Paste UV coordinate among object" @@ -67,7 +67,7 @@ class MUV_MT_AlignUV(bpy.types.Menu): Menu class: Master menu of Align UV """ - bl_idname = "uv.muv_mt_align_uv" + bl_idname = "MUV_MT_AlignUV" bl_label = "Align UV" bl_description = "Align UV" @@ -100,7 +100,7 @@ class MUV_MT_SelectUV(bpy.types.Menu): Menu class: Master menu of Select UV """ - bl_idname = "uv.muv_mt_select_uv" + bl_idname = "MUV_MT_SelectUV" bl_label = "Select UV" bl_description = "Select UV" @@ -119,7 +119,7 @@ class MUV_MT_AlignUVCursor(bpy.types.Menu): Menu class: Master menu of Align UV Cursor """ - bl_idname = "uv.muv_mt_align_uv_cursor" + bl_idname = "MUV_MT_AlignUVCursor" bl_label = "Align UV Cursor" bl_description = "Align UV cursor" @@ -176,7 +176,7 @@ class MUV_MT_UVInspection(bpy.types.Menu): Menu class: Master menu of UV Inspection """ - bl_idname = "uv.muv_mt_uv_inspection" + bl_idname = "MUV_MT_UVInspection" bl_label = "UV Inspection" bl_description = "UV Inspection" diff --git a/magic_uv/ui/VIEW3D_MT_object.py b/magic_uv/ui/VIEW3D_MT_object.py index b691bdd5..54f0c3b0 100644 --- a/magic_uv/ui/VIEW3D_MT_object.py +++ b/magic_uv/ui/VIEW3D_MT_object.py @@ -20,8 +20,8 @@ __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" -__version__ = "6.0" -__date__ = "26 Jan 2019" +__version__ = "6.1" +__date__ = "19 May 2019" import bpy @@ -38,7 +38,7 @@ class MUV_MT_CopyPasteUV_Object(bpy.types.Menu): Menu class: Master menu of Copy/Paste UV coordinate among object """ - bl_idname = "uv.muv_mt_copy_paste_uv_object" + bl_idname = "MUV_MT_CopyPasteUV_Object" bl_label = "Copy/Paste UV" bl_description = "Copy and Paste UV coordinate among object" diff --git a/magic_uv/ui/VIEW3D_MT_uv_map.py b/magic_uv/ui/VIEW3D_MT_uv_map.py index 12202602..28a125f5 100644 --- a/magic_uv/ui/VIEW3D_MT_uv_map.py +++ b/magic_uv/ui/VIEW3D_MT_uv_map.py @@ -20,8 +20,8 @@ __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" -__version__ = "6.0" -__date__ = "26 Jan 2019" +__version__ = "6.1" +__date__ = "19 May 2019" import bpy.utils @@ -64,7 +64,7 @@ class MUV_MT_CopyPasteUV(bpy.types.Menu): Menu class: Master menu of Copy/Paste UV coordinate """ - bl_idname = "uv.muv_mt_copy_paste_uv" + bl_idname = "MUV_MT_CopyPasteUV" bl_label = "Copy/Paste UV" bl_description = "Copy and Paste UV coordinate" @@ -88,7 +88,7 @@ class MUV_MT_TransferUV(bpy.types.Menu): Menu class: Master menu of Transfer UV coordinate """ - bl_idname = "uv.muv_mt_transfer_uv" + bl_idname = "MUV_MT_TransferUV" bl_label = "Transfer UV" bl_description = "Transfer UV coordinate" @@ -109,7 +109,7 @@ class MUV_MT_TextureLock(bpy.types.Menu): Menu class: Master menu of Texture Lock """ - bl_idname = "uv.muv_mt_texture_lock" + bl_idname = "MUV_MT_TextureLock" bl_label = "Texture Lock" bl_description = "Lock texture when vertices of mesh (Preserve UV)" @@ -139,7 +139,7 @@ class MUV_MT_WorldScaleUV(bpy.types.Menu): Menu class: Master menu of world scale UV """ - bl_idname = "uv.muv_mt_world_scale_uv" + bl_idname = "MUV_MT_WorldScaleUV" bl_label = "World Scale UV" bl_description = "" @@ -181,7 +181,7 @@ class MUV_MT_TextureWrap(bpy.types.Menu): Menu class: Master menu of Texture Wrap """ - bl_idname = "uv.muv_mt_texture_wrap" + bl_idname = "MUV_MT_TextureWrap" bl_label = "Texture Wrap" bl_description = "" @@ -198,7 +198,7 @@ class MUV_MT_UVW(bpy.types.Menu): Menu class: Master menu of UVW """ - bl_idname = "uv.muv_mt_uvw" + bl_idname = "MUV_MT_UVW" bl_label = "UVW" bl_description = "" @@ -220,7 +220,7 @@ class MUV_MT_PreserveUVAspect(bpy.types.Menu): Menu class: Master menu of Preserve UV Aspect """ - bl_idname = "uv.muv_mt_preserve_uv_aspect" + bl_idname = "MUV_MT_PreserveUVAspect" bl_label = "Preserve UV Aspect" bl_description = "" @@ -240,7 +240,7 @@ class MUV_MT_TextureProjection(bpy.types.Menu): Menu class: Master menu of Texture Projection """ - bl_idname = "uv.muv_mt_texture_projection" + bl_idname = "MUV_MT_TextureProjection" bl_label = "Texture Projection" bl_description = "" diff --git a/magic_uv/ui/__init__.py b/magic_uv/ui/__init__.py index 032cc3bd..57f6a9d8 100644 --- a/magic_uv/ui/__init__.py +++ b/magic_uv/ui/__init__.py @@ -20,8 +20,8 @@ __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" -__version__ = "6.0" -__date__ = "26 Jan 2019" +__version__ = "6.1" +__date__ = "19 May 2019" if "bpy" in locals(): import importlib diff --git a/magic_uv/ui/uvedit_copy_paste_uv.py b/magic_uv/ui/uvedit_copy_paste_uv.py index 39259649..91705a66 100644 --- a/magic_uv/ui/uvedit_copy_paste_uv.py +++ b/magic_uv/ui/uvedit_copy_paste_uv.py @@ -20,8 +20,8 @@ __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" -__version__ = "6.0" -__date__ = "26 Jan 2019" +__version__ = "6.1" +__date__ = "19 May 2019" import bpy @@ -44,7 +44,6 @@ class MUV_PT_UVEdit_CopyPasteUV(bpy.types.Panel): bl_region_type = 'UI' bl_label = "Copy/Paste UV" bl_category = "Magic UV" - bl_context = 'mesh_edit' bl_options = {'DEFAULT_CLOSED'} def draw_header(self, _): diff --git a/magic_uv/ui/uvedit_editor_enhancement.py b/magic_uv/ui/uvedit_editor_enhancement.py index dbae514f..f30e0c58 100644 --- a/magic_uv/ui/uvedit_editor_enhancement.py +++ b/magic_uv/ui/uvedit_editor_enhancement.py @@ -20,8 +20,8 @@ __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" -__version__ = "6.0" -__date__ = "26 Jan 2019" +__version__ = "6.1" +__date__ = "19 May 2019" import bpy @@ -48,7 +48,6 @@ class MUV_PT_UVEdit_EditorEnhancement(bpy.types.Panel): bl_region_type = 'UI' bl_label = "Editor Enhancement" bl_category = "Magic UV" - bl_context = 'mesh_edit' bl_options = {'DEFAULT_CLOSED'} def draw_header(self, _): diff --git a/magic_uv/ui/uvedit_uv_manipulation.py b/magic_uv/ui/uvedit_uv_manipulation.py index 96c8b54b..ec2045ca 100644 --- a/magic_uv/ui/uvedit_uv_manipulation.py +++ b/magic_uv/ui/uvedit_uv_manipulation.py @@ -20,8 +20,8 @@ __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" -__version__ = "6.0" -__date__ = "26 Jan 2019" +__version__ = "6.1" +__date__ = "19 May 2019" import bpy @@ -53,7 +53,6 @@ class MUV_PT_UVEdit_UVManipulation(bpy.types.Panel): bl_region_type = 'UI' bl_label = "UV Manipulation" bl_category = "Magic UV" - bl_context = 'mesh_edit' bl_options = {'DEFAULT_CLOSED'} def draw_header(self, _): diff --git a/magic_uv/ui/view3d_copy_paste_uv_editmode.py b/magic_uv/ui/view3d_copy_paste_uv_editmode.py index 49a4e0a3..87d5e8f0 100644 --- a/magic_uv/ui/view3d_copy_paste_uv_editmode.py +++ b/magic_uv/ui/view3d_copy_paste_uv_editmode.py @@ -20,8 +20,8 @@ __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" -__version__ = "6.0" -__date__ = "26 Jan 2019" +__version__ = "6.1" +__date__ = "19 May 2019" import bpy diff --git a/magic_uv/ui/view3d_copy_paste_uv_objectmode.py b/magic_uv/ui/view3d_copy_paste_uv_objectmode.py index 574a0e43..9f29f1be 100644 --- a/magic_uv/ui/view3d_copy_paste_uv_objectmode.py +++ b/magic_uv/ui/view3d_copy_paste_uv_objectmode.py @@ -20,8 +20,8 @@ __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" -__version__ = "6.0" -__date__ = "26 Jan 2019" +__version__ = "6.1" +__date__ = "19 May 2019" import bpy diff --git a/magic_uv/ui/view3d_uv_manipulation.py b/magic_uv/ui/view3d_uv_manipulation.py index 312ae171..4c519b76 100644 --- a/magic_uv/ui/view3d_uv_manipulation.py +++ b/magic_uv/ui/view3d_uv_manipulation.py @@ -20,8 +20,8 @@ __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" -__version__ = "6.0" -__date__ = "26 Jan 2019" +__version__ = "6.1" +__date__ = "19 May 2019" import bpy @@ -43,12 +43,18 @@ from ..op.world_scale_uv import ( MUV_OT_WorldScaleUV_ApplyScalingDensity, MUV_OT_WorldScaleUV_ApplyProportionalToMesh, ) -from ..op.flip_rotate_uv import MUV_OT_FlipRotate +from ..op.flip_rotate_uv import MUV_OT_FlipRotateUV from ..op.mirror_uv import MUV_OT_MirrorUV from ..op.move_uv import MUV_OT_MoveUV from ..op.preserve_uv_aspect import MUV_OT_PreserveUVAspect from ..utils.bl_class_registry import BlClassRegistry from ..utils import compatibility as compat +from .. import common + + +def get_apply_target_texture_name(): + images = common.find_images(bpy.context.active_object) + return images.keys() @BlClassRegistry() @@ -77,7 +83,8 @@ class MUV_PT_View3D_UVManipulation(bpy.types.Panel): 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(MUV_OT_FlipRotate.bl_idname, text="Flip/Rotate") + ops = row.operator(MUV_OT_FlipRotateUV.bl_idname, + text="Flip/Rotate") ops.seams = sc.muv_flip_rotate_uv_seams row.prop(sc, "muv_flip_rotate_uv_seams", text="Seams") @@ -106,6 +113,17 @@ class MUV_PT_View3D_UVManipulation(bpy.types.Panel): box.prop(sc, "muv_world_scale_uv_mode", text="") if sc.muv_world_scale_uv_mode == 'MANUAL': + sp = compat.layout_split(box, 0.4) + col = sp.column(align=True) + col.label(text="Target:") + sp = compat.layout_split(sp, 1.0) + col = sp.column(align=True) + ops = col.operator(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 sp = compat.layout_split(box, 0.5) col = sp.column() col.prop(sc, "muv_world_scale_uv_tgt_texture_size", @@ -113,14 +131,8 @@ class MUV_PT_View3D_UVManipulation(bpy.types.Panel): sp = compat.layout_split(sp, 1.0) col = sp.column() col.label(text="Density:") - col.prop(sc, "muv_world_scale_uv_tgt_density", text="") + col.prop(sc, "muv_world_scale_uv_tgt_density") box.prop(sc, "muv_world_scale_uv_origin", text="Origin") - ops = box.operator(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 = compat.layout_split(box, 0.4) @@ -128,9 +140,11 @@ class MUV_PT_View3D_UVManipulation(bpy.types.Panel): col.label(text="Source:") sp = compat.layout_split(sp, 1.0) col = sp.column(align=True) - col.operator(MUV_OT_WorldScaleUV_Measure.bl_idname, - text="Measure") - + ops = col.operator(MUV_OT_WorldScaleUV_Measure.bl_idname, + text="Measure") + ops.tgt_texture = sc.muv_world_scale_uv_measure_tgt_texture + col = box.column(align=True) + col.prop(sc, "muv_world_scale_uv_measure_tgt_texture") sp = compat.layout_split(box, 0.7) col = sp.column(align=True) col.prop(sc, "muv_world_scale_uv_src_density", text="Density") @@ -140,14 +154,20 @@ class MUV_PT_View3D_UVManipulation(bpy.types.Panel): col.label(text="px2/cm2") box.separator() - box.prop(sc, "muv_world_scale_uv_origin", text="Origin") - ops = box.operator( + sp = compat.layout_split(box, 0.4) + col = sp.column(align=True) + col.label(text="Target:") + sp = compat.layout_split(sp, 1.0) + col = sp.column(align=True) + ops = col.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 + ops.tgt_texture = sc.muv_world_scale_uv_apply_tgt_texture + box.prop(sc, "muv_world_scale_uv_origin", text="Origin") elif sc.muv_world_scale_uv_mode == 'SCALING_DENSITY': sp = compat.layout_split(box, 0.4) @@ -155,9 +175,11 @@ class MUV_PT_View3D_UVManipulation(bpy.types.Panel): col.label(text="Source:") sp = compat.layout_split(sp, 1.0) col = sp.column(align=True) - col.operator(MUV_OT_WorldScaleUV_Measure.bl_idname, - text="Measure") - + ops = col.operator(MUV_OT_WorldScaleUV_Measure.bl_idname, + text="Measure") + ops.tgt_texture = sc.muv_world_scale_uv_measure_tgt_texture + col = box.column(align=True) + col.prop(sc, "muv_world_scale_uv_measure_tgt_texture") sp = compat.layout_split(box, 0.7) col = sp.column(align=True) col.prop(sc, "muv_world_scale_uv_src_density", text="Density") @@ -167,10 +189,12 @@ class MUV_PT_View3D_UVManipulation(bpy.types.Panel): col.label(text="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( + sp = compat.layout_split(box, 0.4) + col = sp.column(align=True) + col.label(text="Target:") + sp = compat.layout_split(sp, 1.0) + col = sp.column(align=True) + ops = col.operator( MUV_OT_WorldScaleUV_ApplyScalingDensity.bl_idname, text="Apply") ops.src_density = sc.muv_world_scale_uv_src_density @@ -179,6 +203,10 @@ class MUV_PT_View3D_UVManipulation(bpy.types.Panel): ops.show_dialog = False ops.tgt_scaling_factor = \ sc.muv_world_scale_uv_tgt_scaling_factor + ops.tgt_texture = sc.muv_world_scale_uv_apply_tgt_texture + box.prop(sc, "muv_world_scale_uv_tgt_scaling_factor", + text="Scaling Factor") + box.prop(sc, "muv_world_scale_uv_origin", text="Origin") elif sc.muv_world_scale_uv_mode == 'PROPORTIONAL_TO_MESH': sp = compat.layout_split(box, 0.4) @@ -186,9 +214,11 @@ class MUV_PT_View3D_UVManipulation(bpy.types.Panel): col.label(text="Source:") sp = compat.layout_split(sp, 1.0) col = sp.column(align=True) - col.operator(MUV_OT_WorldScaleUV_Measure.bl_idname, - text="Measure") - + ops = col.operator(MUV_OT_WorldScaleUV_Measure.bl_idname, + text="Measure") + ops.tgt_texture = sc.muv_world_scale_uv_measure_tgt_texture + col = box.column(align=True) + col.prop(sc, "muv_world_scale_uv_measure_tgt_texture") sp = compat.layout_split(box, 0.7) col = sp.column(align=True) col.prop(sc, "muv_world_scale_uv_src_mesh_area", @@ -204,8 +234,12 @@ class MUV_PT_View3D_UVManipulation(bpy.types.Panel): col.enabled = False box.separator() - box.prop(sc, "muv_world_scale_uv_origin", text="Origin") - ops = box.operator( + sp = compat.layout_split(box, 0.4) + col = sp.column(align=True) + col.label(text="Target:") + sp = compat.layout_split(sp, 1.0) + col = sp.column(align=True) + ops = col.operator( MUV_OT_WorldScaleUV_ApplyProportionalToMesh.bl_idname, text="Apply") ops.src_density = sc.muv_world_scale_uv_src_density @@ -213,6 +247,11 @@ class MUV_PT_View3D_UVManipulation(bpy.types.Panel): ops.src_mesh_area = sc.muv_world_scale_uv_src_mesh_area ops.origin = sc.muv_world_scale_uv_origin ops.show_dialog = False + ops.tgt_texture = sc.muv_world_scale_uv_apply_tgt_texture + box.prop(sc, "muv_world_scale_uv_origin", text="Origin") + + col = box.column(align=True) + col.prop(sc, "muv_world_scale_uv_apply_tgt_texture") box = layout.box() box.prop(sc, "muv_preserve_uv_aspect_enabled", diff --git a/magic_uv/ui/view3d_uv_mapping.py b/magic_uv/ui/view3d_uv_mapping.py index 278d1725..ca8dfae8 100644 --- a/magic_uv/ui/view3d_uv_mapping.py +++ b/magic_uv/ui/view3d_uv_mapping.py @@ -20,8 +20,8 @@ __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" -__version__ = "6.0" -__date__ = "26 Jan 2019" +__version__ = "6.1" +__date__ = "19 May 2019" import bpy |