forked from hlorus/CAD_Sketcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
64 lines (49 loc) · 1.65 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
bl_info = {
"name": "CAD Sketcher",
"author": "hlorus",
"version": (0, 24, 0),
"blender": (2, 80, 0),
"location": "View3D > Toolbar",
"description": "Parametric, constraint-based geometry sketcher",
"warning": "Experimental",
"category": "3D View",
"doc_url": "https://hlorus.github.io/CAD_Sketcher",
"tracker_url": "https://github.com/hlorus/CAD_Sketcher/discussions/categories/announcements",
}
import logging
from . import icon_manager, global_data
from .registration import register_base, unregister_base, register_full, unregister_full
from .utilities.install import check_module
from .utilities.register import cleanse_modules
from .utilities.presets import ensure_addon_presets
from .utilities.logging import setup_logger, update_logger
# Globals
logger = logging.getLogger(__name__)
def register():
# Setup root logger
setup_logger(logger)
# Register base
ensure_addon_presets()
register_base()
update_logger(logger)
icon_manager.load()
logger.info(
"Enabled CAD Sketcher base, version: {}".format(bl_info["version"])
)
# Check Module and register all modules
try:
check_module("py_slvs")
register_full()
global_data.registered = True
logger.info("Solvespace available, fully registered modules")
except ModuleNotFoundError as e:
global_data.registered = False
logger.warning(
"Solvespace module isn't available, only base modules registered\n"
+ str(e)
)
def unregister():
if global_data.registered:
unregister_full()
unregister_base()
cleanse_modules(__package__)