Skip to content

Commit

Permalink
Version 4.3 released
Browse files Browse the repository at this point in the history
nutti committed Apr 1, 2017
1 parent d763cf8 commit 9657d90
Showing 21 changed files with 1,055 additions and 1,053 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -10,4 +10,4 @@ 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.
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Blender Add-on: Magic UV (Copy/Paste UV)

This is a blender add-on "Magic UV". (also known as Copy/Paste UV for older version)
This is a blender add-on "Magic UV". (a.k.a. Copy/Paste UV for older version)
"Magic UV" consists of many UV manipulation features.

"Magic UV" is in **Contrib** support level.
"Magic UV" is in **Release** support level. (**Contrib** support level in Blender version <2.79)
So, stable version is included on **Blender Test Build**.
Of course, you can also download older version from below links.

@@ -14,6 +14,7 @@ If you want to try newest but unstable version, you can download it from [unstab
|Version|Download URL|
|---|---|
|*unstable*|[Download](https://github.com/nutti/Magic-UV/archive/develop.zip)|
|4.3|[Download](https://github.com/nutti/Magic-UV/releases/tag/v4.3)|
|4.2|[Download](https://github.com/nutti/Magic-UV/releases/tag/v4.2)|
|4.1|[Download](https://github.com/nutti/Magic-UV/releases/tag/v4.1)|
|4.0|[Download](https://github.com/nutti/Magic-UV/releases/tag/v4.0)|
@@ -59,12 +60,13 @@ See [Wiki Pages](https://github.com/nutti/Magic-UV/wiki/Tutorial) .
See the link below for further details.

* [Blender Wiki page](http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/UV/Copy_Paste_UVs)
* [Blender Artist Thread](http://blenderartists.org/forum/showthread.php?391573-Add-on-Magic-UV-v4-0-%28Copy-Paste-UV%29)
* [Blender Artist Thread](https://blenderartists.org/forum/showthread.php?391573-Add-on-Magic-UV-v4-1-(Copy-Paste-UV-Preserve-UVs-UV-Bounding-Box-and-so-on))
* [Google+](https://plus.google.com/100058529622539760372/posts/82eS2tGE6Nc)

## Change Log
|Version|Release Date|Change Log|
|---|---|---|
|4.3|2017.4.1|Update for **Blender 2.79 release**<br>[1] Optimization/Refactoring|
|4.2|2017.3.4|[1] **Add feature**<br> - Preserve UV Aspect<br>[2] Improve feature<br> - Texture Projection<br>(1) Add option: Texture rendering method<br>[3] Improve UI<br>[4] Optimization/Refactoring<br>[5] Fixed bug|
|4.1|2016.11.13|[1] **Add feature**<br> - Copy/Paste UV Coordinates (Among same objects)<br> - Texture Lock<br> - Mirror UV<br> - World Scale UV<br> - Unwrap Constraint<br>[2] Improve feature - Pack UV (with same UV island packing)<br>(1) Add option: Allowable center/size deviation option<br>[3] Fixed bug|
|4.0|2016.5.14|[1] Rename this add-on<br>[2] **Add feature**<br> - Manipulate UV with Bounding Box in UV Editor<br> - Move UV from 3D View<br> - Texture Projection<br> - Pack UV (with same UV island packing)<br>[3] Improve feature - Copy/Paste UV<br>(1) N to M copy/paste UV<br>(2) Copy/Paste UV by selection sequence between specified UV maps<br>[4] Optimization/Refactoring<br>[5] Fixed bugs|
4 changes: 2 additions & 2 deletions dev_tools/debug.py
Original file line number Diff line number Diff line change
@@ -5,10 +5,10 @@
def start_debug():
if DEBUGGING is False:
return

PYDEV_SRC_DIR = 'XXXXXX\\eclipse\\plugins\\org.python.pydev_3.9.2.201502050007\\pysrc'
if PYDEV_SRC_DIR not in sys.path:
sys.path.append(PYDEV_SRC_DIR)
import pydevd
pydevd.settrace()
print("started blender script debugging...")
print("started blender script debugging...")
2 changes: 1 addition & 1 deletion uv_magic_uv/__init__.py
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
__author__ = "Nutti <nutti.metro@gmail.com>"
__status__ = "production"
__version__ = "4.2"
__date__ = "4 Mar 2017"
__date__ = "1 Apr 2017"


bl_info = {
2 changes: 1 addition & 1 deletion uv_magic_uv/muv_common.py
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
__author__ = "Nutti <nutti.metro@gmail.com>"
__status__ = "production"
__version__ = "4.2"
__date__ = "4 Mar 2017"
__date__ = "1 Apr 2017"


import bpy
2 changes: 1 addition & 1 deletion uv_magic_uv/muv_cpuv_ops.py
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
__author__ = "Nutti <nutti.metro@gmail.com>"
__status__ = "production"
__version__ = "4.2"
__date__ = "4 Mar 2017"
__date__ = "1 Apr 2017"


import bpy
2 changes: 1 addition & 1 deletion uv_magic_uv/muv_cpuv_selseq_ops.py
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
__author__ = "Nutti <nutti.metro@gmail.com>"
__status__ = "production"
__version__ = "4.2"
__date__ = "4 Mar 2017"
__date__ = "1 Apr 2017"


import bpy
2 changes: 1 addition & 1 deletion uv_magic_uv/muv_fliprot_ops.py
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
__author__ = "Nutti <nutti.metro@gmail.com>"
__status__ = "production"
__version__ = "4.2"
__date__ = "4 Mar 2017"
__date__ = "1 Apr 2017"


import bpy
2 changes: 1 addition & 1 deletion uv_magic_uv/muv_menu.py
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
__author__ = "Nutti <nutti.metro@gmail.com>"
__status__ = "production"
__version__ = "4.2"
__date__ = "4 Mar 2017"
__date__ = "1 Apr 2017"


import bpy
2 changes: 1 addition & 1 deletion uv_magic_uv/muv_mirroruv_ops.py
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
__author__ = "Keith (Wahooney) Boshoff, Nutti <nutti.metro@gmail.com>"
__status__ = "production"
__version__ = "4.2"
__date__ = "4 Mar 2017"
__date__ = "1 Apr 2017"


import bpy
252 changes: 126 additions & 126 deletions uv_magic_uv/muv_mvuv_ops.py
Original file line number Diff line number Diff line change
@@ -1,126 +1,126 @@
# <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__ = "kgeogeo, mem, Nutti <nutti.metro@gmail.com>"
__status__ = "production"
__version__ = "4.2"
__date__ = "4 Mar 2017"


import bpy
import bmesh
from mathutils import Vector


class MUV_MVUV(bpy.types.Operator):
"""
Operator class: Move UV from View3D
"""

bl_idname = "view3d.muv_mvuv"
bl_label = "Move the UV from View3D"
bl_options = {'REGISTER', 'UNDO'}

def __init__(self):
self.__topology_dict = []
self.__prev_mouse = Vector((0.0, 0.0))
self.__offset_uv = Vector((0.0, 0.0))
self.__prev_offset_uv = Vector((0.0, 0.0))
self.__first_time = True
self.__ini_uvs = []
self.__running = False

def __find_uv(self, context):
bm = bmesh.from_edit_mesh(context.object.data)
topology_dict = []
uvs = []
active_uv = bm.loops.layers.uv.active
for fidx, f in enumerate(bm.faces):
for vidx, v in enumerate(f.verts):
if v.select:
uvs.append(f.loops[vidx][active_uv].uv.copy())
topology_dict.append([fidx, vidx])

return topology_dict, uvs

@classmethod
def poll(cls, context):
return context.edit_object

def modal(self, context, event):
if self.__first_time is True:
self.__prev_mouse = Vector((
event.mouse_region_x, event.mouse_region_y))
self.__first_time = False
return {'RUNNING_MODAL'}

# move UV
div = 10000
self.__offset_uv += Vector((
(event.mouse_region_x - self.__prev_mouse.x) / div,
(event.mouse_region_y - self.__prev_mouse.y) / div))
ouv = self.__offset_uv
pouv = self.__prev_offset_uv
vec = Vector((ouv.x - ouv.y, ouv.x + ouv.y))
dv = vec - pouv
self.__prev_offset_uv = vec
self.__prev_mouse = Vector((
event.mouse_region_x, event.mouse_region_y))

# check if operation is started
if self.__running is True:
if event.type == 'LEFTMOUSE' and event.value == 'RELEASE':
self.__running = False
return {'RUNNING_MODAL'}

# update UV
obj = context.object
bm = bmesh.from_edit_mesh(obj.data)
active_uv = bm.loops.layers.uv.active
for fidx, vidx in self.__topology_dict:
l = bm.faces[fidx].loops[vidx]
l[active_uv].uv = l[active_uv].uv + dv
bmesh.update_edit_mesh(obj.data)

# check mouse preference
if context.user_preferences.inputs.select_mouse == 'RIGHT':
confirm_btn = 'LEFTMOUSE'
cancel_btn = 'RIGHTMOUSE'
else:
confirm_btn = 'RIGHTMOUSE'
cancel_btn = 'LEFTMOUSE'

# cancelled
if event.type == cancel_btn and event.value == 'PRESS':
for (fidx, vidx), uv in zip(self.__topology_dict, self.__ini_uvs):
bm.faces[fidx].loops[vidx][active_uv].uv = uv
return {'FINISHED'}
# confirmed
if event.type == confirm_btn and event.value == 'PRESS':
return {'FINISHED'}

return {'RUNNING_MODAL'}

def execute(self, context):
self.__first_time = True
self.__running = True
context.window_manager.modal_handler_add(self)
self.__topology_dict, self.__ini_uvs = self.__find_uv(context)
return {'RUNNING_MODAL'}
# <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__ = "kgeogeo, mem, Nutti <nutti.metro@gmail.com>"
__status__ = "production"
__version__ = "4.2"
__date__ = "1 Apr 2017"


import bpy
import bmesh
from mathutils import Vector


class MUV_MVUV(bpy.types.Operator):
"""
Operator class: Move UV from View3D
"""

bl_idname = "view3d.muv_mvuv"
bl_label = "Move the UV from View3D"
bl_options = {'REGISTER', 'UNDO'}

def __init__(self):
self.__topology_dict = []
self.__prev_mouse = Vector((0.0, 0.0))
self.__offset_uv = Vector((0.0, 0.0))
self.__prev_offset_uv = Vector((0.0, 0.0))
self.__first_time = True
self.__ini_uvs = []
self.__running = False

def __find_uv(self, context):
bm = bmesh.from_edit_mesh(context.object.data)
topology_dict = []
uvs = []
active_uv = bm.loops.layers.uv.active
for fidx, f in enumerate(bm.faces):
for vidx, v in enumerate(f.verts):
if v.select:
uvs.append(f.loops[vidx][active_uv].uv.copy())
topology_dict.append([fidx, vidx])

return topology_dict, uvs

@classmethod
def poll(cls, context):
return context.edit_object

def modal(self, context, event):
if self.__first_time is True:
self.__prev_mouse = Vector((
event.mouse_region_x, event.mouse_region_y))
self.__first_time = False
return {'RUNNING_MODAL'}

# move UV
div = 10000
self.__offset_uv += Vector((
(event.mouse_region_x - self.__prev_mouse.x) / div,
(event.mouse_region_y - self.__prev_mouse.y) / div))
ouv = self.__offset_uv
pouv = self.__prev_offset_uv
vec = Vector((ouv.x - ouv.y, ouv.x + ouv.y))
dv = vec - pouv
self.__prev_offset_uv = vec
self.__prev_mouse = Vector((
event.mouse_region_x, event.mouse_region_y))

# check if operation is started
if self.__running is True:
if event.type == 'LEFTMOUSE' and event.value == 'RELEASE':
self.__running = False
return {'RUNNING_MODAL'}

# update UV
obj = context.object
bm = bmesh.from_edit_mesh(obj.data)
active_uv = bm.loops.layers.uv.active
for fidx, vidx in self.__topology_dict:
l = bm.faces[fidx].loops[vidx]
l[active_uv].uv = l[active_uv].uv + dv
bmesh.update_edit_mesh(obj.data)

# check mouse preference
if context.user_preferences.inputs.select_mouse == 'RIGHT':
confirm_btn = 'LEFTMOUSE'
cancel_btn = 'RIGHTMOUSE'
else:
confirm_btn = 'RIGHTMOUSE'
cancel_btn = 'LEFTMOUSE'

# cancelled
if event.type == cancel_btn and event.value == 'PRESS':
for (fidx, vidx), uv in zip(self.__topology_dict, self.__ini_uvs):
bm.faces[fidx].loops[vidx][active_uv].uv = uv
return {'FINISHED'}
# confirmed
if event.type == confirm_btn and event.value == 'PRESS':
return {'FINISHED'}

return {'RUNNING_MODAL'}

def execute(self, context):
self.__first_time = True
self.__running = True
context.window_manager.modal_handler_add(self)
self.__topology_dict, self.__ini_uvs = self.__find_uv(context)
return {'RUNNING_MODAL'}
2 changes: 1 addition & 1 deletion uv_magic_uv/muv_packuv_ops.py
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
__author__ = "Nutti <nutti.metro@gmail.com>"
__status__ = "production"
__version__ = "4.2"
__date__ = "4 Mar 2017"
__date__ = "1 Apr 2017"


from math import fabs
2 changes: 1 addition & 1 deletion uv_magic_uv/muv_preferences.py
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
__author__ = "Nutti <nutti.metro@gmail.com>"
__status__ = "production"
__version__ = "4.2"
__date__ = "4 Mar 2017"
__date__ = "1 Apr 2017"


from bpy.props import BoolProperty, FloatProperty, FloatVectorProperty
2 changes: 1 addition & 1 deletion uv_magic_uv/muv_preserve_uv_aspect.py
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
__author__ = "Nutti <nutti.metro@gmail.com>"
__status__ = "production"
__version__ = "4.2"
__date__ = "4 Mar 2017"
__date__ = "1 Apr 2017"


import bpy
Loading

0 comments on commit 9657d90

Please sign in to comment.