-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
__init__.py
169 lines (142 loc) · 6.77 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
'''
Copyright (C) 2018 Samy Tichadou (tonton)
Created by Samy Tichadou (tonton)
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/>.
'''
bl_info = {
"name": "FCurve Helper",
"author": "Samy Tichadou (tonton)",
"version": (1, 0),
"blender": (2, 82, 0),
"location": "Graph Editor",
"description": "Utilities to help with FCurves handling",
"wiki_url": "https://github.com/samytichadou/fcurve_helper",
"tracker_url": "https://github.com/samytichadou/fcurve_helper/issues/new",
"category": "Animation"}
import bpy
# IMPORT SPECIFICS
##################################
from .startup_handler import fcurvehelper_startup
from .properties import *
from .operator_add_modifier import *
from .operator_copy_active_modifier import *
from .operator_copy_modifier_inspector import *
from .operator_paste_modifier_inspector import *
from .operator_remove_modifier import *
from .operator_remove_modifier_from_inspector import *
from .gui import *
from .preferences import *
# register
##################################
classes = (FCurveHelperAddModifier,
FCurveHelperCommonProperties,
FCurveHelperGeneratorProperties,
FCurveHelperFNGeneratorProperties,
FCurveHelperEnvelopeProperties,
FCurveHelperCyclesProperties,
FCurveHelperNoiseProperties,
FCurveHelperLimitsProperties,
FCurveHelperSteppedProperties,
FCurveHelperAddonPrefs,
FCurveHelperCopyActiveModifier,
FCurveHelperCopyModifierInspector,
FCurveHelperPasteModifierInspector,
FCurveHelperRemoveModifier,
FCurveHelperPanel,
FCurveHelperInspectorSubPanel,
FCurveHelperRemoveModifierInspector,
)
def register():
### OPERATORS ###
from bpy.utils import register_class
for cls in classes :
register_class(cls)
### PROPS ###
bpy.types.WindowManager.fcurvehelper_commonproperties = \
bpy.props.CollectionProperty(type = FCurveHelperCommonProperties)
bpy.types.WindowManager.fcurvehelper_generatorproperties = \
bpy.props.CollectionProperty(type = FCurveHelperGeneratorProperties)
bpy.types.WindowManager.fcurvehelper_fngeneratorproperties = \
bpy.props.CollectionProperty(type = FCurveHelperFNGeneratorProperties)
bpy.types.WindowManager.fcurvehelper_envelopeproperties = \
bpy.props.CollectionProperty(type = FCurveHelperEnvelopeProperties)
bpy.types.WindowManager.fcurvehelper_cyclesproperties = \
bpy.props.CollectionProperty(type = FCurveHelperCyclesProperties)
bpy.types.WindowManager.fcurvehelper_noiseproperties = \
bpy.props.CollectionProperty(type = FCurveHelperNoiseProperties)
bpy.types.WindowManager.fcurvehelper_limitsproperties = \
bpy.props.CollectionProperty(type = FCurveHelperLimitsProperties)
bpy.types.WindowManager.fcurvehelper_steppedproperties = \
bpy.props.CollectionProperty(type = FCurveHelperSteppedProperties)
bpy.types.WindowManager.fcurvehelper_debug = bpy.props.BoolProperty(name = "Debug Toggle", default=False)
modifiers_items = [
('GENERATOR', 'Generator', ""),
('FNGENERATOR', 'Built-In Function', ""),
('ENVELOPE', 'Envelope', ""),
('CYCLES', 'Cycles', ""),
('NOISE', 'Noise', ""),
('LIMITS', 'Limits', ""),
('STEPPED', 'Stepped Interpolation', ""),
]
bpy.types.WindowManager.fcurvehelper_modifiers_list = bpy.props.EnumProperty(items=modifiers_items,
name="Modifiers",
)
fcurve_type_items = [
('AUTO', 'Automatic', ""),
('BONE', 'Bone', ""),
('OBJECT', 'Object', ""),
]
bpy.types.WindowManager.fcurvehelper_fcurve_type = bpy.props.EnumProperty(items=fcurve_type_items,
name="Type",
)
add_mode_items = [
('ADD_MODIFY', 'Add or Modify Existing', ""),
('MODIFY', 'Modify Existing Only', ""),
('ADD', 'Add', ""),
]
bpy.types.WindowManager.fcurvehelper_add_mode = bpy.props.EnumProperty(items=add_mode_items,
name="Mode",
)
bpy.types.WindowManager.fcurvehelper_paste_mode = bpy.props.EnumProperty(items=add_mode_items,
name="Paste Mode",
default = 'ADD',
)
bpy.types.WindowManager.fcurvehelper_show_all_bones = bpy.props.BoolProperty(name = "Show all Bones")
bpy.types.WindowManager.fcurvehelper_show_only_modifiers = bpy.props.BoolProperty(name = "Show only FCurves with Modifier")
bpy.types.WindowManager.fcurvehelper_is_copied = bpy.props.BoolProperty()
### HANDLER ###
bpy.app.handlers.load_post.append(fcurvehelper_startup)
def unregister():
### OPERATORS ###
from bpy.utils import unregister_class
for cls in reversed(classes) :
unregister_class(cls)
### PROPS ###
del bpy.types.WindowManager.fcurvehelper_commonproperties
del bpy.types.WindowManager.fcurvehelper_generatorproperties
del bpy.types.WindowManager.fcurvehelper_fngeneratorproperties
del bpy.types.WindowManager.fcurvehelper_envelopeproperties
del bpy.types.WindowManager.fcurvehelper_cyclesproperties
del bpy.types.WindowManager.fcurvehelper_noiseproperties
del bpy.types.WindowManager.fcurvehelper_limitsproperties
del bpy.types.WindowManager.fcurvehelper_steppedproperties
del bpy.types.WindowManager.fcurvehelper_modifiers_list
del bpy.types.WindowManager.fcurvehelper_fcurve_type
del bpy.types.WindowManager.fcurvehelper_add_mode
del bpy.types.WindowManager.fcurvehelper_paste_mode
del bpy.types.WindowManager.fcurvehelper_show_all_bones
del bpy.types.WindowManager.fcurvehelper_show_only_modifiers
del bpy.types.WindowManager.fcurvehelper_is_copied
del bpy.types.WindowManager.fcurvehelper_debug
### HANDLER
bpy.app.handlers.load_post.remove(fcurvehelper_startup)