[Bf-extensions-cvs] [b520b1ba] master: Magic UV: Update for 2.79 release
Nutti
noreply at git.blender.org
Sat Apr 1 15:10:40 CEST 2017
Commit: b520b1baeb13632b0bb51be7ec87834590547d3a
Author: Nutti
Date: Sat Apr 1 22:05:04 2017 +0900
Branches: master
https://developer.blender.org/rBACb520b1baeb13632b0bb51be7ec87834590547d3a
Magic UV: Update for 2.79 release
===================================================================
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
M 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 67d1f68f..7d18c159 100644
--- a/uv_magic_uv/__init__.py
+++ b/uv_magic_uv/__init__.py
@@ -20,14 +20,14 @@
__author__ = "Nutti <nutti.metro at gmail.com>"
__status__ = "production"
-__version__ = "4.2"
-__date__ = "4 Mar 2017"
+__version__ = "4.3"
+__date__ = "1 Apr 2017"
bl_info = {
"name": "Magic UV",
- "author": "Nutti, Mifth, kgeogeo, mem, Keith (Wahooney) Boshoff, McBuff, MaxRobinot",
- "version": (4, 2),
+ "author": "Nutti, Mifth, Jace Priester, kgeogeo, mem, Keith (Wahooney) Boshoff, McBuff, MaxRobinot",
+ "version": (4, 3),
"blender": (2, 77, 0),
"location": "See Add-ons Preferences",
"description": "UV Manipulator Tools. See Add-ons Preferences for details",
diff --git a/uv_magic_uv/muv_common.py b/uv_magic_uv/muv_common.py
index 8b495df9..66f2a54b 100644
--- a/uv_magic_uv/muv_common.py
+++ b/uv_magic_uv/muv_common.py
@@ -20,8 +20,8 @@
__author__ = "Nutti <nutti.metro at gmail.com>"
__status__ = "production"
-__version__ = "4.2"
-__date__ = "4 Mar 2017"
+__version__ = "4.3"
+__date__ = "1 Apr 2017"
import bpy
@@ -37,7 +37,7 @@ def debug_print(*s):
print(s)
-def check_version(major, minor, unused):
+def check_version(major, minor, _):
"""
Check blender version
"""
@@ -67,9 +67,15 @@ def get_space(area_type, region_type, space_type):
Get current area/region/space
"""
+ area = None
+ region = None
+ space = None
+
for area in bpy.context.screen.areas:
if area.type == area_type:
break
+ else:
+ return (None, None, None)
for region in area.regions:
if region.type == region_type:
break
diff --git a/uv_magic_uv/muv_cpuv_ops.py b/uv_magic_uv/muv_cpuv_ops.py
index e3d71b40..3c5e968a 100644
--- a/uv_magic_uv/muv_cpuv_ops.py
+++ b/uv_magic_uv/muv_cpuv_ops.py
@@ -18,10 +18,10 @@
#
# ##### END GPL LICENSE BLOCK #####
-__author__ = "Nutti <nutti.metro at gmail.com>"
+__author__ = "Nutti <nutti.metro at gmail.com>, Jace Priester"
__status__ = "production"
-__version__ = "4.2"
-__date__ = "4 Mar 2017"
+__version__ = "4.3"
+__date__ = "1 Apr 2017"
import bpy
@@ -108,12 +108,14 @@ class MUV_CPUVCopyUVMenu(bpy.types.Menu):
layout.operator(
MUV_CPUVCopyUV.bl_idname,
text="[Default]",
- icon="PLUGIN").uv_map = ""
+ icon="PLUGIN"
+ ).uv_map = ""
for m in uv_maps:
layout.operator(
MUV_CPUVCopyUV.bl_idname,
text=m,
- icon="PLUGIN").uv_map = m
+ icon="PLUGIN"
+ ).uv_map = m
class MUV_CPUVPasteUV(bpy.types.Operator):
@@ -134,16 +136,19 @@ class MUV_CPUVPasteUV(bpy.types.Operator):
('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')
],
- default="N_M")
+ default="N_M"
+ )
flip_copied_uv = BoolProperty(
name="Flip Copied UV",
description="Flip Copied UV...",
- default=False)
+ default=False
+ )
rotate_copied_uv = IntProperty(
default=0,
name="Rotate Copied UV",
min=0,
- max=30)
+ max=30
+ )
def execute(self, context):
props = context.scene.muv_props.cpuv
@@ -215,7 +220,7 @@ class MUV_CPUVPasteUV(bpy.types.Operator):
suvs_fr.reverse()
spuvs_fr.reverse()
# rotate UVs
- for n in range(self.rotate_copied_uv):
+ for _ in range(self.rotate_copied_uv):
uv = suvs_fr.pop()
pin_uv = spuvs_fr.pop()
suvs_fr.insert(0, uv)
@@ -316,10 +321,9 @@ class MUV_CPUVObjCopyUVMenu(bpy.types.Menu):
bl_label = "Copy UV"
bl_description = "Copy UV coordinate per object"
- def draw(self, context):
+ def draw(self, _):
layout = self.layout
# create sub menu
- obj = context.active_object
uv_maps = bpy.context.active_object.data.uv_textures.keys()
layout.operator(
MUV_CPUVObjCopyUV.bl_idname,
@@ -349,7 +353,6 @@ class MUV_CPUVObjPasteUV(bpy.types.Operator):
self.report({'WARNING'}, "Need copy UV at first")
return {'CANCELLED'}
- obj_names = []
for o in bpy.data.objects:
if not hasattr(o.data, "uv_textures") or not o.select:
continue
@@ -364,7 +367,7 @@ class MUV_CPUVObjPasteUV(bpy.types.Operator):
bm.faces.ensure_lookup_table()
if (self.uv_map == "" or
- not self.uv_map in bm.loops.layers.uv.keys()):
+ self.uv_map not in bm.loops.layers.uv.keys()):
self.report({'INFO'}, "Paste UV coordinate per object")
else:
self.report(
@@ -374,7 +377,7 @@ class MUV_CPUVObjPasteUV(bpy.types.Operator):
# get UV layer
if (self.uv_map == "" or
- not self.uv_map in bm.loops.layers.uv.keys()):
+ self.uv_map not in bm.loops.layers.uv.keys()):
if not bm.loops.layers.uv:
self.report(
{'WARNING'}, "Object must have more than one UV map")
@@ -398,7 +401,8 @@ class MUV_CPUVObjPasteUV(bpy.types.Operator):
{'WARNING'},
"Number of faces is different from copied "
+ "(src:%d, dest:%d)"
- % (len(props.src_uvs), len(dest_uvs)))
+ % (len(props.src_uvs), len(dest_uvs))
+ )
return {'CANCELLED'}
# paste
@@ -412,7 +416,8 @@ class MUV_CPUVObjPasteUV(bpy.types.Operator):
suvs_fr = [uv for uv in suv]
spuvs_fr = [pin_uv for pin_uv in spuv]
# paste UVs
- for l, suv, spuv in zip(bm.faces[idx].loops, suvs_fr, spuvs_fr):
+ for l, suv, spuv in zip(
+ bm.faces[idx].loops, suvs_fr, spuvs_fr):
l[uv_layer].uv = suv
l[uv_layer].pin_uv = spuv
@@ -433,7 +438,7 @@ class MUV_CPUVObjPasteUVMenu(bpy.types.Menu):
bl_label = "Paste UV"
bl_description = "Paste UV coordinate per object"
- def draw(self, context):
+ def draw(self, _):
layout = self.layout
# create sub menu
uv_maps = []
diff --git a/uv_magic_uv/muv_cpuv_selseq_ops.py b/uv_magic_uv/muv_cpuv_selseq_ops.py
index b97435c6..f6701b83 100644
--- a/uv_magic_uv/muv_cpuv_selseq_ops.py
+++ b/uv_magic_uv/muv_cpuv_selseq_ops.py
@@ -20,8 +20,8 @@
__author__ = "Nutti <nutti.metro at gmail.com>"
__status__ = "production"
-__version__ = "4.2"
-__date__ = "4 Mar 2017"
+__version__ = "4.3"
+__date__ = "1 Apr 2017"
import bpy
@@ -208,7 +208,7 @@ class MUV_CPUVSelSeqPasteUV(bpy.types.Operator):
suvs_fr.reverse()
spuvs_fr.reverse()
# rotate UVs
- for n in range(self.rotate_copied_uv):
+ for _ in range(self.rotate_copied_uv):
uv = suvs_fr.pop()
pin_uv = spuvs_fr.pop()
suvs_fr.insert(0, uv)
diff --git a/uv_magic_uv/muv_fliprot_ops.py b/uv_magic_uv/muv_fliprot_ops.py
index 2718f5c1..597ee2a6 100644
--- a/uv_magic_uv/muv_fliprot_ops.py
+++ b/uv_magic_uv/muv_fliprot_ops.py
@@ -20,8 +20,8 @@
__author__ = "Nutti <nutti.metro at gmail.com>"
__status__ = "production"
-__version__ = "4.2"
-__date__ = "4 Mar 2017"
+__version__ = "4.3"
+__date__ = "1 Apr 2017"
import bpy
@@ -43,12 +43,14 @@ class MUV_FlipRot(bpy.types.Operator):
flip = BoolProperty(
name="Flip UV",
description="Flip UV...",
- default=False)
+ default=False
+ )
rotate = IntProperty(
default=0,
name="Rotate UV",
min=0,
- max=30)
+ max=30
+ )
def execute(self, context):
self.report({'INFO'}, "Flip/Rotate UV")
@@ -88,7 +90,7 @@ class MUV_FlipRot(bpy.types.Operator):
duvs_fr.reverse()
dpuvs_fr.reverse()
# rotate UVs
- for n in range(self.rotate):
+ for _ in range(self.rotate):
uv = duvs_fr.pop()
pin_uv = dpuvs_fr.pop()
duvs_fr.insert(0, uv)
diff --git a/uv_magic_uv/muv_menu.py b/uv_magic_uv/muv_menu.py
index 51374fb5..17e77cfb 100644
--- a/uv_magic_uv/muv_menu.py
+++ b/uv_magic_uv/muv_menu.py
@@ -20,8 +20,8 @@
__author__ = "Nutti <nutti.metro at gmail.com>"
__status__ = "production"
-__version__ = "4.2"
-__date__ = "4 Mar 2017"
+__version__ = "4.3"
+__date__ = "1 Apr 2017"
import bpy
@@ -41,7 +41,7 @@ class MUV_CPUVMenu(bpy.types.Menu):
bl_label = "Copy/Paste UV"
bl_description = "Copy and Paste UV coordinate"
- def draw(self, context):
+ def draw(self, _):
self.layout.menu(
muv_cpuv_ops.MUV_CPUVCopyUVMenu.bl_idname, icon="PLUGIN")
self.layout.menu(
@@ -63,7 +63,7 @@ class MUV_CPUVObjMenu(bpy.types.Menu):
bl_label = "Copy/Paste UV"
bl_description = "Copy and Paste UV coordinate per object"
- def draw(self, context):
+ def draw(self, _):
self.layout.menu(
muv_cpuv_ops.MUV_CPUVObjCopyUVMenu.bl_idname, icon="PLUGIN")
self.layout.menu(
@@ -79,7 +79,7 @@ class MUV_TransUVMenu(bpy.types.Menu):
bl_label = "Transfer UV"
bl_description = "Transfer UV coordinate"
- def draw(self, context):
+ def draw(self, _):
self.layout.operator(
muv_transuv_ops.MUV_TransUVCopy.bl_idname, icon="PLUGIN")
self.layout.operator(
@@ -95,7 +95,7 @@ class MUV_TexLockMenu(bpy.types.Menu):
bl_label = "Texture Lock"
bl_description = "Lock texture when vertices of mesh (Preserve UV)"
- def draw(self, context):
+ def draw(self, _):
self.layout.operator(
muv_texlock_ops.MUV_TexLockStart.bl_idname, icon="PLUGIN")
self.layout.operator(
@@ -115,7 +115,7 @@ class MUV_WSUVMenu(bpy.types.Menu):
bl_label = "World
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list