-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path__init__.py
75 lines (65 loc) · 2.33 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# ##### Substance Bridge #####
# A simple bridge between painter and blender.
#
# Thx Jerem.
# -----------------------------------------------------------------------------
# Import all Package addon
# -----------------------------------------------------------------------------
import sys
import importlib
modulesNames = [
# Models
'models.paths',
'models.project',
# Views
# 'views.baking',
'views.dataview',
'views.moresopt',
'views.settings',
'views.substanceproject',
'views.texturesetlist',
# Controllers
'controllers.debug',
'controllers.substancecheck',
'controllers.substancecontroller',
'controllers.substancepainter',
'controllers.substancesetup',
]
modulesFullNames = []
for currentModule in modulesNames:
modulesFullNames.append('{}.{}'.format(__name__, currentModule))
for currentModule in modulesFullNames:
if currentModule in sys.modules:
importlib.reload(sys.modules[currentModule])
else:
globals()[currentModule] = importlib.import_module(currentModule)
# -----------------------------------------------------------------------------
# MetaData Add-On Blender
# -----------------------------------------------------------------------------
bl_info = {
"name": "Substance Bridge",
"author": "stilobique",
"version": (0, 5, 6),
"blender": (2, 79),
"location": "Tool Shelf > Substance Panel",
"description": "A simple way to export into substance painter.",
"warning": "",
"wiki_url": "https://github.com/stilobique/SubstanceBridge/wiki",
"category": "3D View",
"tracker_url": "https://github.com/stilobique/SubstanceBridge/issues",
}
# -----------------------------------------------------------------------------
def register():
# Add all class present in this addon
for module in modulesFullNames:
if module in sys.modules:
if hasattr(sys.modules[module], 'register'):
sys.modules[module].register()
# -----------------------------------------------------------------------------
# Delete register
# -----------------------------------------------------------------------------
def unregister():
for module in modulesFullNames:
if module in sys.modules:
if hasattr(sys.modules[module], 'unregister'):
sys.modules[module].unregister()