-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
76 lines (58 loc) · 2.45 KB
/
Copy path__init__.py
File metadata and controls
76 lines (58 loc) · 2.45 KB
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
76
from typing import Callable
import bpy, os
### Constants
ADDON_FOLDER = os.path.dirname(os.path.abspath(__file__))
PG_NAME = "UnexpectedSlicer"
TYPES_NAME = "blendertoprusaslicer"
PACKAGE: str = __package__ or "unexpectedslicer"
### Blender Addon Initialization
bl_info: dict[str, str | tuple[int, int, int]] = {
"name" : "UnexpectedSlicer",
"author" : "Nicolas Predella",
"description" : "PrusaSlicer integration into Blender",
"blender" : (4, 2, 0),
"version" : (1, 0, 0),
"location" : "",
"warning" : "",
}
### Initialization
from .preferences import physical_printers
from .preferences import config_selection
from .preferences import preferences
from .props import bpy_property_groups
from .ui.operators import list_ops
from .ui.operators import slicer
from .ui.operators import usb
from .ui.panels import object_panel
from .ui.panels import slicer_panel
from .ui.panels import overrides_panel
from .ui.panels import pauses_panel
from .ui.panels import gcode_preview_panel
from .ui.panels import stdout_panel
from .ui.panels import physical_printers_panel
from .services import physical_printers
### Load collected modules
from . import registry
modules = registry.get()
timers: list[Callable[str, int | None]] = registry.get_timers()
def register():
registry.blender_register_classes()
registry.blender_register_timers()
registry.blender_register_icons()
bpy.types.WorkSpace.blendertoprusaslicer = bpy.props.PointerProperty(type=bpy_property_groups.SlicerWorkspacePropertyGroup, name="blendertoprusaslicer", options={'SKIP_SAVE'}) #type: ignore
bpy.types.Collection.blendertoprusaslicer = bpy.props.PointerProperty(type=bpy_property_groups.SlicerPropertyGroup, name="blendertoprusaslicer") #type: ignore
bpy.types.Object.blendertoprusaslicer = bpy.props.PointerProperty(type=bpy_property_groups.SlicerObjectPropertyGroup, name="blendertoprusaslicer") #type: ignore
from .services import bundler
from .preferences.physical_printers import update_querier
update_querier()
def unregister():
from .ui.panels.gcode_preview_panel import drawer
drawer.stop()
registry.blender_unregister_classes()
registry.blender_unregister_timers()
registry.blender_unregister_icons()
del bpy.types.WorkSpace.blendertoprusaslicer #type: ignore
del bpy.types.Collection.blendertoprusaslicer #type: ignore
del bpy.types.Object.blendertoprusaslicer #type: ignore
if __name__ == "__main__":
register()