2 # Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors
4 # This file is part of Power Sequencer.
6 # Power Sequencer is free software: you can redistribute it and/or modify it under the terms of the
7 # GNU General Public License as published by the Free Software Foundation, either version 3 of the
8 # License, or (at your option) any later version.
10 # Power Sequencer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11 # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License along with Power Sequencer. If
15 # not, see <https://www.gnu.org/licenses/>.
17 from typing
import List
, Tuple
, Type
21 from .addon_preferences
import register_preferences
, unregister_preferences
22 from .addon_properties
import register_properties
, unregister_properties
23 from .handlers
import register_handlers
, unregister_handlers
24 from .operators
import get_operator_classes
25 from .tools
import get_tool_classes
26 from .ui
import register_ui
, unregister_ui
27 from .utils
import addon_auto_imports
28 from .utils
.register_shortcuts
import register_shortcuts
30 # load and reload submodules
31 ##################################
32 modules
= addon_auto_imports
.setup_addon_modules(
33 __path__
, __name__
, ignore_packages
=[".utils", ".audiosync"]
38 "name": "Power Sequencer",
39 "description": "Video editing tools for content creators",
40 "author": "Nathan Lovato",
42 "blender": (2, 81, 0),
43 "location": "Sequencer",
44 "tracker_url": "https://github.com/GDquest/Blender-power-sequencer/issues",
45 "wiki_url": "https://www.gdquest.com/docs/documentation/power-sequencer/",
46 "support": "COMMUNITY",
47 "category": "Sequencer",
51 # We use globals to cache loaded keymaps, operators, and tools
52 addon_keymaps
: List
[Type
] = []
53 classes_operator
: List
[Type
] = []
54 classes_tool
: List
[Type
] = []
59 global classes_operator
62 register_preferences()
68 classes_operator
= get_operator_classes()
69 for cls
in classes_operator
:
70 bpy
.utils
.register_class(cls
)
73 classes_tool
= get_tool_classes()
74 last_tool
= {"builtin.blade"}
75 for index
, cls
in enumerate(classes_tool
):
76 bpy
.utils
.register_tool(cls
, after
=last_tool
, separator
=index
== 0)
77 last_tool
= {cls
.bl_idname
}
80 keymaps
= register_shortcuts(classes_operator
)
81 addon_keymaps
+= keymaps
83 # print("Registered {} with {} modules".format(bl_info["name"], len(modules)))
89 global classes_operator
92 for km
, kmi
in addon_keymaps
:
93 km
.keymap_items
.remove(kmi
)
96 for cls
in classes_operator
:
97 bpy
.utils
.unregister_class(cls
)
99 for cls
in classes_tool
:
100 bpy
.utils
.unregister_tool(cls
)
103 unregister_preferences()
104 unregister_properties()
105 unregister_handlers()
107 # print("Unregistered {}".format(bl_info["name"]))