forked from Symstract/modifier_list
-
Notifications
You must be signed in to change notification settings - Fork 0
/
__init__.py
97 lines (72 loc) · 2.94 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Copyright (C) 2019 Antti Tikka
# ***** 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 3 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, see <https://www.gnu.org/licenses/>.
#
# ***** END GPL LICENSE BLOCK *****
bl_info = {
"name": "Modifier List",
"author": "Antti Tikka, Draise",
"version": (1, 7, 6),
"blender": (2, 92, 0),
"location": "Properties Editor & View3D > Sidebar & View3D > Alt + Spacebar",
"description": "Alternative UI layout for modifiers with handy features "
"+ a Sidebar tab and a popup.",
"warning": "",
"doc_url": "https://github.com/Symstract/modifier_list",
"category": "3D View"
}
import bpy
from . import addon_registration
# register_bl_classes arguments
modules_to_ignore = (
"preferences",
"properties",
)
classes_to_ignore = (
"DATA_PT_modifiers",
)
panel_order = (
"VIEW3D_PT_ml_modifiers",
"VIEW3D_PT_ml_vertex_groups",
)
# call_register arguments
module_order = (
"preferences",
)
addon_keymaps = []
def register():
addon_registration.import_modules("modules")
addon_registration.register_bl_classes(modules_to_ignore=modules_to_ignore,
classes_to_ignore=classes_to_ignore,
panel_order=panel_order,
addon_name_for_counter=bl_info["name"])
addon_registration.call_register(module_order=module_order)
# === Keymap ===
wm = bpy.context.window_manager
if wm.keyconfigs.addon:
km = wm.keyconfigs.addon.keymaps.new(name='3D View', space_type='VIEW_3D')
kmi = km.keymap_items.new("view3d.modifier_popup", 'SPACE', 'PRESS', alt=True)
addon_keymaps.append((km, kmi))
km = wm.keyconfigs.addon.keymaps.new(name='Property Editor', space_type='PROPERTIES')
kmi = km.keymap_items.new("object.ml_modifier_add_from_search", 'A', 'PRESS', ctrl=True,
shift=True)
addon_keymaps.append((km, kmi))
kmi = km.keymap_items.new("object.ml_modifier_add_from_menu", 'A', 'PRESS', shift=True)
addon_keymaps.append((km, kmi))
def unregister():
# === Keymap ===
for km, kmi in addon_keymaps:
km.keymap_items.remove(kmi)
addon_keymaps.clear()
addon_registration.call_unregister(module_order=reversed(module_order))
addon_registration.unregister_bl_classes(addon_name_for_counter=bl_info["name"])