forked from aresdevo/animaide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
executable file
·132 lines (92 loc) · 3.95 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# licence
'''
Copyright (C) 2018 Ares Deveaux
Created by Ares Deveaux
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 <http://www.gnu.org/licenses/>.
'''
# Addon Info
bl_info = {
"name": "AnimAide",
"description": "Helpful tools to manipulate keys on f-curves",
"author": "Ares Deveaux",
"version": (1, 0, 33),
"blender": (2, 92, 0),
"location": "Graph Editor - Dope Sheet - Timeline - 3D View - sidebar and menu bar",
"warning": "This addon is still in development.",
"category": "Animation",
"wiki_url": "https://github.com/aresdevo/animaide",
"tracker_url": "https://github.com/aresdevo/animaide/issues"
}
import bpy
import atexit
from . import ui, curve_tools, anim_offset, key_manager, prefe, utils
from bpy.props import BoolProperty, EnumProperty, PointerProperty, CollectionProperty, StringProperty
from bpy.types import AddonPreferences, PropertyGroup, Operator
prefe.addon_name = __package__
class AnimAideScene(PropertyGroup):
clone: PointerProperty(type=curve_tools.props.AnimAideClone)
tool: PointerProperty(type=curve_tools.props.AnimAideTool)
anim_offset: PointerProperty(type=anim_offset.props.AnimAideOffset)
key_tweak: PointerProperty(type=key_manager.props.KeyTweak)
classes = \
anim_offset.classes + \
curve_tools.classes + \
key_manager.classes + \
ui.menu_classes + \
prefe.classes + \
(AnimAideScene,)
def register():
for cls in classes:
bpy.utils.register_class(cls)
bpy.types.Scene.animaide = PointerProperty(type=AnimAideScene)
preferences = bpy.context.preferences
pref = preferences.addons[prefe.addon_name].preferences
# bpy.types.TIME_MT_editor_menus.append(curve_tools.ui.draw_bookmarks)
bpy.types.DOPESHEET_MT_editor_menus.append(ui.draw_menu)
bpy.types.GRAPH_MT_editor_menus.append(ui.draw_menu)
bpy.types.VIEW3D_MT_editor_menus.append(ui.draw_menu)
# bpy.types.TIME_MT_editor_menus.append(ui.draw_menu)
if pref.key_manager_ui == 'PANEL':
prefe.add_key_manager_panel()
if pref.anim_offset_ui == 'PANEL':
prefe.add_anim_offset_panel()
if pref.key_manager_ui == 'HEADERS':
prefe.add_key_manager_header()
if pref.anim_offset_ui == 'HEADERS':
prefe.add_anim_offset_header()
# if pref.info_panel:
# for cls in ui.info_classes:
# bpy.utils.register_class(cls)
# atexit.register(utils.remove_message)
def unregister():
utils.remove_message()
preferences = bpy.context.preferences
pref = preferences.addons[prefe.addon_name].preferences
# bpy.types.TIME_MT_editor_menus.remove(curve_tools.ui.draw_bookmarks)
bpy.types.DOPESHEET_MT_editor_menus.remove(ui.draw_menu)
bpy.types.GRAPH_MT_editor_menus.remove(ui.draw_menu)
bpy.types.VIEW3D_MT_editor_menus.remove(ui.draw_menu)
# bpy.types.TIME_MT_editor_menus.remove(ui.draw_menu)
if pref.key_manager_ui == 'PANEL':
prefe.remove_key_manager_panel()
if pref.anim_offset_ui == 'PANEL':
prefe.remove_anim_offset_panel()
if pref.key_manager_ui == 'HEADERS':
prefe.remove_key_manager_header()
if pref.anim_offset_ui == 'HEADERS':
prefe.remove_anim_offset_header()
# if pref.info_panel:
# for cls in reversed(ui.info_classes):
# bpy.utils.unregister_class(cls)
for cls in reversed(classes):
bpy.utils.unregister_class(cls)
del bpy.types.Scene.animaide