[Bf-extensions-cvs] [906ed66f] master: Magic UV: Update to Version 4.2
Nutti
noreply at git.blender.org
Sat Mar 4 07:54:43 CET 2017
Commit: 906ed66f42888e84b38272db48efdc96c8c959f9
Author: Nutti
Date: Sat Mar 4 15:53:10 2017 +0900
Branches: master
https://developer.blender.org/rBAC906ed66f42888e84b38272db48efdc96c8c959f9
Magic UV: Update to Version 4.2
[1] Add feature
- Preserve UV Aspect
[2] Improve feature
- Texture Projection
(1) Add option: Texture rendering method
[3] Improve UI
[4] Optimization/Refactoring
[5] Fixed bug
===================================================================
M uv_magic_uv/__init__.py
M uv_magic_uv/muv_common.py
M uv_magic_uv/muv_cpuv_ops.py
M uv_magic_uv/muv_cpuv_selseq_ops.py
M uv_magic_uv/muv_fliprot_ops.py
M uv_magic_uv/muv_menu.py
M uv_magic_uv/muv_mirroruv_ops.py
M uv_magic_uv/muv_mvuv_ops.py
M uv_magic_uv/muv_packuv_ops.py
M uv_magic_uv/muv_preferences.py
A uv_magic_uv/muv_preserve_uv_aspect.py
M uv_magic_uv/muv_props.py
M uv_magic_uv/muv_texlock_ops.py
M uv_magic_uv/muv_texproj_ops.py
M uv_magic_uv/muv_transuv_ops.py
M uv_magic_uv/muv_unwrapconst_ops.py
M uv_magic_uv/muv_uvbb_ops.py
M uv_magic_uv/muv_wsuv_ops.py
===================================================================
diff --git a/uv_magic_uv/__init__.py b/uv_magic_uv/__init__.py
index e13e11eb..67d1f68f 100644
--- a/uv_magic_uv/__init__.py
+++ b/uv_magic_uv/__init__.py
@@ -20,20 +20,20 @@
__author__ = "Nutti <nutti.metro at gmail.com>"
__status__ = "production"
-__version__ = "4.1"
-__date__ = "13 Nov 2016"
+__version__ = "4.2"
+__date__ = "4 Mar 2017"
bl_info = {
"name": "Magic UV",
- "author": "Nutti",
- "version": (4, 1),
+ "author": "Nutti, Mifth, kgeogeo, mem, Keith (Wahooney) Boshoff, McBuff, MaxRobinot",
+ "version": (4, 2),
"blender": (2, 77, 0),
- "location": "View3D > U, View3D > Property Panel, ImageEditor > Property Panel, ImageEditor > UVs",
- "description": "UV Manipulator Tools",
+ "location": "See Add-ons Preferences",
+ "description": "UV Manipulator Tools. See Add-ons Preferences for details",
"warning": "",
"support": "COMMUNITY",
- "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/UV/Copy_Paste_UVs",
+ "wiki_url": "https://github.com/nutti/Magic-UV/wikil",
"tracker_url": "https://github.com/nutti/Copy-And-Paste-UV",
"category": "UV"
}
@@ -56,6 +56,7 @@ if "bpy" in locals():
imp.reload(muv_mirroruv_ops)
imp.reload(muv_wsuv_ops)
imp.reload(muv_unwrapconst_ops)
+ imp.reload(muv_preserve_uv_aspect)
else:
from . import muv_preferences
from . import muv_menu
@@ -73,6 +74,7 @@ else:
from . import muv_mirroruv_ops
from . import muv_wsuv_ops
from . import muv_unwrapconst_ops
+ from . import muv_preserve_uv_aspect
import bpy
@@ -84,9 +86,14 @@ def view3d_uvmap_menu_fn(self, context):
self.layout.menu(muv_menu.MUV_TransUVMenu.bl_idname, icon="PLUGIN")
self.layout.operator(muv_mvuv_ops.MUV_MVUV.bl_idname, icon="PLUGIN")
self.layout.menu(muv_menu.MUV_TexLockMenu.bl_idname, icon="PLUGIN")
- self.layout.operator(muv_mirroruv_ops.MUV_MirrorUV.bl_idname, icon="PLUGIN")
+ self.layout.operator(
+ muv_mirroruv_ops.MUV_MirrorUV.bl_idname, icon="PLUGIN")
self.layout.menu(muv_menu.MUV_WSUVMenu.bl_idname, icon="PLUGIN")
- self.layout.operator(muv_unwrapconst_ops.MUV_UnwrapConstraint.bl_idname, icon='PLUGIN')
+ self.layout.operator(
+ muv_unwrapconst_ops.MUV_UnwrapConstraint.bl_idname, icon='PLUGIN')
+ self.layout.menu(
+ muv_preserve_uv_aspect.MUV_PreserveUVAspectMenu.bl_idname,
+ icon='PLUGIN')
def image_uvs_menu_fn(self, context):
diff --git a/uv_magic_uv/muv_common.py b/uv_magic_uv/muv_common.py
index 83df3671..8b495df9 100644
--- a/uv_magic_uv/muv_common.py
+++ b/uv_magic_uv/muv_common.py
@@ -20,17 +20,14 @@
__author__ = "Nutti <nutti.metro at gmail.com>"
__status__ = "production"
-__version__ = "4.1"
-__date__ = "13 Nov 2016"
+__version__ = "4.2"
+__date__ = "4 Mar 2017"
import bpy
from . import muv_props
-PHI = 3.1415926535
-
-
def debug_print(*s):
"""
Print message to console in debugging mode
diff --git a/uv_magic_uv/muv_cpuv_ops.py b/uv_magic_uv/muv_cpuv_ops.py
index 7804a665..e3d71b40 100644
--- a/uv_magic_uv/muv_cpuv_ops.py
+++ b/uv_magic_uv/muv_cpuv_ops.py
@@ -20,8 +20,8 @@
__author__ = "Nutti <nutti.metro at gmail.com>"
__status__ = "production"
-__version__ = "4.1"
-__date__ = "13 Nov 2016"
+__version__ = "4.2"
+__date__ = "4 Mar 2017"
import bpy
@@ -49,7 +49,7 @@ class MUV_CPUVCopyUV(bpy.types.Operator):
bl_description = "Copy UV coordinate (Operation)"
bl_options = {'REGISTER', 'UNDO'}
- uv_map = bpy.props.StringProperty(options={'HIDDEN'})
+ uv_map = StringProperty(options={'HIDDEN'})
def execute(self, context):
props = context.scene.muv_props.cpuv
@@ -57,7 +57,7 @@ class MUV_CPUVCopyUV(bpy.types.Operator):
self.report({'INFO'}, "Copy UV coordinate")
else:
self.report(
- {'INFO'}, "Copy UV coordinate (UV map:" + self.uv_map + ")")
+ {'INFO'}, "Copy UV coordinate (UV map:%s)" % (self.uv_map))
obj = context.active_object
bm = bmesh.from_edit_mesh(obj.data)
if muv_common.check_version(2, 73, 0) >= 0:
@@ -107,11 +107,13 @@ class MUV_CPUVCopyUVMenu(bpy.types.Menu):
uv_maps = bm.loops.layers.uv.keys()
layout.operator(
MUV_CPUVCopyUV.bl_idname,
- text="[Default]", icon="PLUGIN").uv_map = ""
+ text="[Default]",
+ icon="PLUGIN").uv_map = ""
for m in uv_maps:
layout.operator(
MUV_CPUVCopyUV.bl_idname,
- text=m, icon="PLUGIN").uv_map = m
+ text=m,
+ icon="PLUGIN").uv_map = m
class MUV_CPUVPasteUV(bpy.types.Operator):
@@ -124,21 +126,19 @@ class MUV_CPUVPasteUV(bpy.types.Operator):
bl_description = "Paste UV coordinate (Operation)"
bl_options = {'REGISTER', 'UNDO'}
- uv_map = bpy.props.StringProperty(options={'HIDDEN'})
-
+ uv_map = StringProperty(options={'HIDDEN'})
strategy = EnumProperty(
name="Strategy",
description="Paste Strategy",
items=[
('N_N', 'N:N', 'Number of faces must be equal to source'),
- ('N_M', 'N:M', 'Number of faces must not be equal to source')],
+ ('N_M', 'N:M', 'Number of faces must not be equal to source')
+ ],
default="N_M")
-
flip_copied_uv = BoolProperty(
name="Flip Copied UV",
description="Flip Copied UV...",
default=False)
-
rotate_copied_uv = IntProperty(
default=0,
name="Rotate Copied UV",
@@ -154,7 +154,7 @@ class MUV_CPUVPasteUV(bpy.types.Operator):
self.report({'INFO'}, "Paste UV coordinate")
else:
self.report(
- {'INFO'}, "Paste UV coordinate (UV map:" + self.uv_map + ")")
+ {'INFO'}, "Paste UV coordinate (UV map:%s)" % (self.uv_map))
obj = context.active_object
bm = bmesh.from_edit_mesh(obj.data)
if muv_common.check_version(2, 73, 0) >= 0:
@@ -163,8 +163,8 @@ class MUV_CPUVPasteUV(bpy.types.Operator):
# get UV layer
if self.uv_map == "":
if not bm.loops.layers.uv:
- self.report({'WARNING'},
- "Object must have more than one UV map")
+ self.report(
+ {'WARNING'}, "Object must have more than one UV map")
return {'CANCELLED'}
uv_layer = bm.loops.layers.uv.verify()
else:
@@ -265,7 +265,7 @@ class MUV_CPUVObjCopyUV(bpy.types.Operator):
bl_description = "Copy UV coordinate"
bl_options = {'REGISTER', 'UNDO'}
- uv_map = bpy.props.StringProperty(options={'HIDDEN'})
+ uv_map = StringProperty(options={'HIDDEN'})
@memorize_view_3d_mode
def execute(self, context):
@@ -275,8 +275,7 @@ class MUV_CPUVObjCopyUV(bpy.types.Operator):
else:
self.report(
{'INFO'},
- "Copy UV coordinate per object (UV map:" + self.uv_map + ")")
-
+ "Copy UV coordinate per object (UV map:%s)" % (self.uv_map))
bpy.ops.object.mode_set(mode='EDIT')
obj = context.active_object
@@ -341,7 +340,7 @@ class MUV_CPUVObjPasteUV(bpy.types.Operator):
bl_description = "Paste UV coordinate"
bl_options = {'REGISTER', 'UNDO'}
- uv_map = bpy.props.StringProperty(options={'HIDDEN'})
+ uv_map = StringProperty(options={'HIDDEN'})
@memorize_view_3d_mode
def execute(self, context):
@@ -351,7 +350,6 @@ class MUV_CPUVObjPasteUV(bpy.types.Operator):
return {'CANCELLED'}
obj_names = []
-
for o in bpy.data.objects:
if not hasattr(o.data, "uv_textures") or not o.select:
continue
@@ -365,19 +363,21 @@ class MUV_CPUVObjPasteUV(bpy.types.Operator):
if muv_common.check_version(2, 73, 0) >= 0:
bm.faces.ensure_lookup_table()
- if self.uv_map == "" or not self.uv_map in bm.loops.layers.uv.keys():
+ if (self.uv_map == "" or
+ not self.uv_map in bm.loops.layers.uv.keys()):
self.report({'INFO'}, "Paste UV coordinate per object")
else:
self.report(
{'INFO'},
- "Paste UV coordinate per object (UV map: %s)" %
- (self.uv_map))
+ "Paste UV coordinate per object (UV map: %s)"
+ % (self.uv_map))
# get UV layer
- if self.uv_map == "" or not self.uv_map in bm.loops.layers.uv.keys():
+ if (self.uv_map == "" or
+ not self.uv_map in bm.loops.layers.uv.keys()):
if not bm.loops.layers.uv:
- self.report({'WARNING'},
- "Object must have more than one UV map")
+ self.report(
+ {'WARNING'}, "Object must have more than one UV map")
return {'CANCELLED'}
uv_layer = bm.loops.layers.uv.verify()
else:
@@ -396,9 +396,9 @@ class MUV_CPUVObjPasteUV(bpy.types.Operator):
if len(props.src_uvs) != len(dest_uvs):
self.report(
{'WARNING'},
- "Number of faces is different from copied" +
- "(src:%d, dest:%d)" %
- (len(props.src_uvs), len(dest_uvs)))
+ "Number of faces is different from copied "
+ + "(src:%d, dest:%d)"
+ % (len(props.src_uvs), len(dest_uvs)))
return {'CANCELLED'}
# paste
@@ -418,7 +418,8 @@ class MUV_CPUVObjPasteUV(bpy.types.Operator):
bmesh.update_edit_mesh(obj.data)
- self.report({'INFO'}, "%s's UV coordinates are pasted" % (obj.name))
+ self.report(
+ {'INFO'}, "%s's UV coordinates are pasted" % (obj.name))
return {'FINISHED'}
diff --git a/uv_magic_uv/muv_cpuv_selseq_ops.py b/uv_magic_uv/muv_cpuv_selseq_ops.py
index 2453578f..b97435c6 100644
--- a/uv_magic_uv/muv_cpuv_selseq_ops.py
+++ b/uv_magic_uv/muv_cpuv_selseq_ops.py
@@ -20,13 +20,13 @@
__autho
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list