[Bf-extensions-cvs] [a0044523] master: Magic UV: Phase 2 for porting to Blender 2.8

nutti noreply at git.blender.org
Sun Jan 6 02:28:34 CET 2019


Commit: a0044523a66f693c3b8005bc351120c87b5c8c34
Author: nutti
Date:   Sun Jan 6 10:27:27 2019 +0900
Branches: master
https://developer.blender.org/rBAa0044523a66f693c3b8005bc351120c87b5c8c34

Magic UV: Phase 2 for porting to Blender 2.8

All features are available on Blender 2.8

===================================================================

M	uv_magic_uv/__init__.py
D	uv_magic_uv/addon_updater.py
D	uv_magic_uv/addon_updater_ops.py
M	uv_magic_uv/common.py
M	uv_magic_uv/impl/__init__.py
A	uv_magic_uv/impl/align_uv_cursor_impl.py
A	uv_magic_uv/impl/align_uv_impl.py
M	uv_magic_uv/impl/move_uv_impl.py
A	uv_magic_uv/impl/pack_uv_impl.py
A	uv_magic_uv/impl/preserve_uv_aspect_impl.py
A	uv_magic_uv/impl/select_uv_impl.py
A	uv_magic_uv/impl/smooth_uv_impl.py
A	uv_magic_uv/impl/texture_lock_impl.py
A	uv_magic_uv/impl/texture_projection_impl.py
A	uv_magic_uv/impl/texture_wrap_impl.py
A	uv_magic_uv/impl/unwrap_constraint_impl.py
A	uv_magic_uv/impl/uv_bounding_box_impl.py
A	uv_magic_uv/impl/uv_inspection_impl.py
A	uv_magic_uv/impl/uv_sculpt_impl.py
M	uv_magic_uv/impl/uvw_impl.py
A	uv_magic_uv/impl/world_scale_uv_impl.py
M	uv_magic_uv/legacy/op/align_uv.py
M	uv_magic_uv/legacy/op/align_uv_cursor.py
M	uv_magic_uv/legacy/op/pack_uv.py
M	uv_magic_uv/legacy/op/preserve_uv_aspect.py
M	uv_magic_uv/legacy/op/select_uv.py
M	uv_magic_uv/legacy/op/smooth_uv.py
M	uv_magic_uv/legacy/op/texture_lock.py
M	uv_magic_uv/legacy/op/texture_projection.py
M	uv_magic_uv/legacy/op/texture_wrap.py
M	uv_magic_uv/legacy/op/unwrap_constraint.py
M	uv_magic_uv/legacy/op/uv_bounding_box.py
M	uv_magic_uv/legacy/op/uv_inspection.py
M	uv_magic_uv/legacy/op/uv_sculpt.py
M	uv_magic_uv/legacy/op/world_scale_uv.py
M	uv_magic_uv/legacy/preferences.py
A	uv_magic_uv/lib/__init__.py
A	uv_magic_uv/lib/bglx.py
M	uv_magic_uv/op/__init__.py
A	uv_magic_uv/op/align_uv.py
A	uv_magic_uv/op/align_uv_cursor.py
A	uv_magic_uv/op/pack_uv.py
A	uv_magic_uv/op/preserve_uv_aspect.py
A	uv_magic_uv/op/select_uv.py
A	uv_magic_uv/op/smooth_uv.py
A	uv_magic_uv/op/texture_lock.py
A	uv_magic_uv/op/texture_projection.py
A	uv_magic_uv/op/texture_wrap.py
A	uv_magic_uv/op/unwrap_constraint.py
A	uv_magic_uv/op/uv_bounding_box.py
A	uv_magic_uv/op/uv_inspection.py
A	uv_magic_uv/op/uv_sculpt.py
A	uv_magic_uv/op/world_scale_uv.py
M	uv_magic_uv/preferences.py
M	uv_magic_uv/ui/IMAGE_MT_uvs.py
M	uv_magic_uv/ui/VIEW3D_MT_uv_map.py
M	uv_magic_uv/ui/__init__.py
A	uv_magic_uv/ui/uvedit_editor_enhancement.py
A	uv_magic_uv/ui/uvedit_uv_manipulation.py
M	uv_magic_uv/ui/view3d_uv_manipulation.py
M	uv_magic_uv/ui/view3d_uv_mapping.py
M	uv_magic_uv/utils/__init__.py
A	uv_magic_uv/utils/addon_updator.py

===================================================================

diff --git a/uv_magic_uv/__init__.py b/uv_magic_uv/__init__.py
index 63591526..61fcc804 100644
--- a/uv_magic_uv/__init__.py
+++ b/uv_magic_uv/__init__.py
@@ -27,8 +27,9 @@ __date__ = "17 Nov 2018"
 bl_info = {
     "name": "Magic UV",
     "author": "Nutti, Mifth, Jace Priester, kgeogeo, mem, imdjs"
-              "Keith (Wahooney) Boshoff, McBuff, MaxRobinot, Alexander Milovsky",
-    "version": (5, 3, 0),
+              "Keith (Wahooney) Boshoff, McBuff, MaxRobinot, "
+              "Alexander Milovsky",
+    "version": (6, 0, 0),
     "blender": (2, 80, 0),
     "location": "See Add-ons Preferences",
     "description": "UV Toolset. See Add-ons Preferences for details",
@@ -60,56 +61,69 @@ if "bpy" in locals():
     importlib.reload(utils)
     utils.bl_class_registry.BlClassRegistry.cleanup()
     if check_version(2, 80, 0) >= 0:
+        importlib.reload(lib)
         importlib.reload(op)
         importlib.reload(ui)
         importlib.reload(properites)
         importlib.reload(preferences)
-        importlib.reload(addon_updater_ops)
-        importlib.reload(addon_updater)
     else:
         importlib.reload(legacy)
+    importlib.reload(impl)
 else:
     import bpy
     from . import common
     from . import utils
     if check_version(2, 80, 0) >= 0:
+        from . import lib
         from . import op
         from . import ui
         from . import properites
         from . import preferences
-        from . import addon_updater_ops
-        from . import addon_updater
     else:
         from . import legacy
+    from . import impl
 
+import os
 
 import bpy
 
 
+def register_updater(bl_info):
+    config = utils.addon_updator.AddonUpdatorConfig()
+    config.owner = "nutti"
+    config.repository = "Magic-UV"
+    config.current_addon_path = os.path.dirname(os.path.realpath(__file__))
+    config.branches = ["master", "develop"]
+    config.addon_directory = config.current_addon_path[:config.current_addon_path.rfind("/")]
+    #config.min_release_version = bl_info["version"]
+    config.min_release_version = (5, 1)
+    config.target_addon_path = "uv_magic_uv"
+    updater = utils.addon_updator.AddonUpdatorManager.get_instance()
+    updater.init(bl_info, config)
+
+
 def register():
+    register_updater(bl_info)
+
     if common.check_version(2, 80, 0) >= 0:
         utils.bl_class_registry.BlClassRegistry.register()
         properites.init_props(bpy.types.Scene)
-        if preferences.Preferences.enable_builtin_menu:
+        if bpy.context.user_preferences.addons['uv_magic_uv'].preferences.enable_builtin_menu:
             preferences.add_builtin_menu()
     else:
         utils.bl_class_registry.BlClassRegistry.register()
         legacy.properites.init_props(bpy.types.Scene)
         if legacy.preferences.Preferences.enable_builtin_menu:
             legacy.preferences.add_builtin_menu()
-        if not common.is_console_mode():
-            addon_updater_ops.register(bl_info)
 
 
 def unregister():
     if common.check_version(2, 80, 0) >= 0:
-        if preferences.Preferences.enable_builtin_menu:
+        if bpy.context.user_preferences.addons['uv_magic_uv'].preferences.enable_builtin_menu:
             preferences.remove_builtin_menu()
         properites.clear_props(bpy.types.Scene)
         utils.bl_class_registry.BlClassRegistry.unregister()
     else:
-        if not common.is_console_mode():
-            addon_updater_ops.unregister()
         if legacy.preferences.Preferences.enable_builtin_menu:
             legacy.preferences.remove_builtin_menu()
         legacy.properites.clear_props(bpy.types.Scene)
diff --git a/uv_magic_uv/addon_updater.py b/uv_magic_uv/addon_updater.py
deleted file mode 100644
index 70b6a287..00000000
--- a/uv_magic_uv/addon_updater.py
+++ /dev/null
@@ -1,1501 +0,0 @@
-# ##### 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 #####
-
-
-"""
-See documentation for usage
-https://github.com/CGCookie/blender-addon-updater
-
-"""
-
-import ssl
-import urllib.request
-import urllib
-import os
-import json
-import zipfile
-import shutil
-import asyncio
-import threading
-import time
-import fnmatch
-from datetime import datetime, timedelta
-
-# blender imports, used in limited cases
-import bpy
-import addon_utils
-
-# -----------------------------------------------------------------------------
-# Define error messages/notices & hard coded globals
-# -----------------------------------------------------------------------------
-
-# currently not used
-DEFAULT_TIMEOUT = 10
-DEFAULT_PER_PAGE = 30
-
-
-# -----------------------------------------------------------------------------
-# The main class
-# -----------------------------------------------------------------------------
-
-class Singleton_updater(object):
-	"""
-	This is the singleton class to reference a copy from,
-	it is the shared module level class
-	"""
-	def __init__(self):
-
-		self._engine = GithubEngine()
-		self._user = None
-		self._repo = None
-		self._website = None
-		self._current_version = None
-		self._subfolder_path = None
-		self._tags = []
-		self._tag_latest = None
-		self._tag_names = []
-		self._latest_release = None
-		self._use_releases = False
-		self._include_branches = False
-		self._include_branch_list = ['master']
-		self._include_branch_autocheck = False
-		self._manual_only = False
-		self._version_min_update = None
-		self._version_max_update = None
-
-		# by default, backup current addon if new is being loaded
-		self._backup_current = True
-		self._backup_ignore_patterns = None
-
-		# set patterns for what files to overwrite on update
-		self._overwrite_patterns = ["*.py","*.pyc"]
-		self._remove_pre_update_patterns = []
-
-		# by default, don't auto enable/disable the addon on update
-		# as it is slightly less stable/won't always fully reload module
-		self._auto_reload_post_update = False
-
-		# settings relating to frequency and whether to enable auto background check
-		self._check_interval_enable = False
-		self._check_interval_months = 0
-		self._check_interval_days = 7
-		self._check_interval_hours = 0
-		self._check_interval_minutes = 0
-
-		# runtime variables, initial conditions
-		self._verbose = False
-		self._fake_install = False
-		self._async_checking = False  # only true when async daemon started
-		self._update_ready = None
-		self._update_link = None
-		self._update_version = None
-		self._source_zip = None
-		self._check_thread = None
-		self.skip_tag = None
-		self.select_link = None
-
-		# get from module data
-		self._addon = __package__.lower()
-		self._addon_package = __package__  # must not change
-		self._updater_path = os.path.join(os.path.dirname(__file__),
-										self._addon+"_updater")
-		self._addon_root = os.path.dirname(__file__)
-		self._json = {}
-		self._error = None
-		self._error_msg = None
-		self._prefiltered_tag_count = 0
-
-		# UI code only, ie not used within this module but still useful
-		# properties to have
-
-		# to verify a valid import, in place of placeholder import
-		self.showpopups = True # used in UI to show or not show update popups
-		self.invalidupdater = False
-
-
-	# -------------------------------------------------------------------------
-	# Getters and setters
-	# -------------------------------------------------------------------------
-
-	@property
-	def engine(self):
-		return self._engine.name
-	@engine.setter
-	def engine(self, value):
-		if value.lower()=="github":
-			self._engine = GithubEngine()
-		elif value.lower()=="gitlab":
-			self._engine = GitlabEngine()
-		elif value.lower()=="bitbucket":
-			self._engine = BitbucketEngine()
-		else:
-			raise ValueError("Invalid engine selection")
-
-	@property
-	def private_token(self):
-		return self._engine.token
-	@private_token.setter
-	def private_token(self, value):
-		if value==None:
-			self._engine.token = None
-		else:
-			self._engine.token = str(value)
-
-	@property
-	def addon(self):
-		return self._addon
-	@addon.setter
-	def addon(self, value):
-		self._addon = str(value)
-
-	@property
-	def verbose(self):
-		return self._verbose
-	@verbose.setter
-	def verbose(self, value):
-		try:
-			self._verbose = bool(value)
-			if self._verbose == True:
-				print(self._addon+" updater verbose is enabled")
-		except:
-			raise ValueError("Verbose must be a boolean value")
-
-	@property
-	def include_branches(self):
-		return self._include_branches
-	@include_branches.setter
-	def include_branches(self, value):
-		try:
-			self._include_branches = bool(value)
-		except:
-			raise ValueError("include_branches must be a boolean value")
-
-	@property
-	def use_releases(self):
-		return self._use_releases
-	@use_releases.setter
-	def use_releases(self, value):
-		try:
-			self._use_releases = bool(value)
-		except:
-			raise ValueError("use_releases must be a boolean value")
-
-	@property
-	def include_branch_list(self):
-		return self._include_branch_list
-	@include_branch_list.setter
-	def include_branch_list(self, value):
-		try:
-			if value == None:
-				self._include_branch_list = ['master']
-			elif type(value) != type(['master']) or value==[]:
-				raise ValueError("include_branch_list should be a list of valid branches")
-			else:
-				self._include_branch_list = value
-		except:
-			raise ValueError("include_branch_list should be a list of valid branches")
-
-	@property
-	def overwrite_patterns(self):
-		return self._overwrite_patterns
-	@overwrite_patterns.setter
-	def overwrite_patterns(self, value):
-		if value == None:
-			self._overw

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list