2016-03-08 16:22:20 +01:00
|
|
|
# ##### 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 #####
|
|
|
|
|
|
|
|
# <pep8 compliant>
|
|
|
|
|
|
|
|
bl_info = {
|
|
|
|
"name": "Blender Cloud Texture Browser",
|
|
|
|
"author": "Sybren A. Stüvel and Francesco Siddi",
|
2016-03-14 17:23:56 +01:00
|
|
|
"version": (0, 2, 0),
|
2016-03-08 16:22:20 +01:00
|
|
|
"blender": (2, 77, 0),
|
|
|
|
"location": "TO BE DETERMINED",
|
|
|
|
"description": "Allows downloading of textures from the Blender Cloud. Requires "
|
|
|
|
"the Blender ID addon.",
|
|
|
|
"wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
|
|
|
|
"Scripts/System/BlenderCloud",
|
|
|
|
"category": "System",
|
|
|
|
"support": "TESTING"
|
|
|
|
}
|
|
|
|
|
2016-03-18 16:53:52 +01:00
|
|
|
import logging
|
|
|
|
|
|
|
|
logging.basicConfig(level=logging.INFO,
|
|
|
|
format='%(asctime)-15s %(levelname)8s %(name)s %(message)s')
|
|
|
|
logging.getLogger('cachecontrol').setLevel(logging.DEBUG)
|
|
|
|
logging.getLogger(__name__).setLevel(logging.DEBUG)
|
|
|
|
|
2016-03-09 14:09:22 +01:00
|
|
|
# Support reloading
|
|
|
|
if 'pillar' in locals():
|
|
|
|
import importlib
|
2016-03-09 17:34:37 +01:00
|
|
|
|
2016-03-18 16:53:52 +01:00
|
|
|
wheels = importlib.reload(wheels)
|
|
|
|
wheels.load_wheels()
|
|
|
|
|
2016-03-09 14:09:22 +01:00
|
|
|
pillar = importlib.reload(pillar)
|
2016-03-22 15:20:22 +01:00
|
|
|
cache = importlib.reload(cache)
|
2016-03-09 14:09:22 +01:00
|
|
|
else:
|
2016-03-18 16:53:52 +01:00
|
|
|
from . import wheels
|
|
|
|
wheels.load_wheels()
|
2016-03-09 14:09:22 +01:00
|
|
|
|
2016-03-22 15:20:22 +01:00
|
|
|
from . import pillar, cache
|
2016-03-08 17:56:13 +01:00
|
|
|
|
2016-03-08 16:22:20 +01:00
|
|
|
|
|
|
|
def register():
|
2016-03-18 16:53:52 +01:00
|
|
|
"""Late-loads and registers the Blender-dependent submodules."""
|
2016-03-08 16:22:20 +01:00
|
|
|
|
2016-03-18 16:53:52 +01:00
|
|
|
import sys
|
2016-03-09 17:34:37 +01:00
|
|
|
|
2016-03-18 16:53:52 +01:00
|
|
|
# Support reloading
|
|
|
|
if '%s.blender' % __name__ in sys.modules:
|
|
|
|
import importlib
|
2016-03-09 17:34:37 +01:00
|
|
|
|
2016-03-18 16:53:52 +01:00
|
|
|
def reload_mod(name):
|
|
|
|
modname = '%s.%s' % (__name__, name)
|
|
|
|
module = importlib.reload(sys.modules[modname])
|
|
|
|
sys.modules[modname] = module
|
|
|
|
return module
|
2016-03-09 17:34:37 +01:00
|
|
|
|
2016-03-18 16:53:52 +01:00
|
|
|
blender = reload_mod('blender')
|
|
|
|
gui = reload_mod('gui')
|
|
|
|
async_loop = reload_mod('async_loop')
|
|
|
|
else:
|
|
|
|
from . import blender, gui, async_loop
|
2016-03-15 15:44:19 +01:00
|
|
|
|
2016-03-15 14:05:54 +01:00
|
|
|
async_loop.setup_asyncio_executor()
|
2016-03-23 13:45:28 +01:00
|
|
|
async_loop.register()
|
2016-03-18 16:53:52 +01:00
|
|
|
|
|
|
|
blender.register()
|
2016-03-14 17:23:56 +01:00
|
|
|
gui.register()
|
2016-03-09 17:34:37 +01:00
|
|
|
|
2016-03-08 16:22:20 +01:00
|
|
|
|
|
|
|
def unregister():
|
2016-03-23 13:45:28 +01:00
|
|
|
from . import blender, gui, async_loop
|
2016-03-09 17:34:37 +01:00
|
|
|
|
2016-03-18 16:53:52 +01:00
|
|
|
gui.unregister()
|
|
|
|
blender.unregister()
|
2016-03-23 13:45:28 +01:00
|
|
|
async_loop.unregister()
|
2016-03-08 16:22:20 +01:00
|
|
|
|