1
# ##### BEGIN GPL LICENSE BLOCK #####
3
# This program is free software; you can redistribute it and/or
4
# modify it under the terms of the GNU General Public License
5
# as published by the Free Software Foundation; either version 2
6
# of the License, or (at your option) any later version.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software Foundation,
15
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
# ##### END GPL LICENSE BLOCK #####
22
from bpy.types import Header, Menu
25
class GRAPH_HT_header(Header):
26
bl_space_type = 'GRAPH_EDITOR'
28
def draw(self, context):
29
from bl_ui.space_dopesheet import dopesheet_filter
33
st = context.space_data
35
row = layout.row(align=True)
38
if context.area.show_menus:
39
row.menu("GRAPH_MT_view")
40
row.menu("GRAPH_MT_select")
41
row.menu("GRAPH_MT_marker")
42
row.menu("GRAPH_MT_channel")
43
row.menu("GRAPH_MT_key")
45
layout.prop(st, "mode", text="")
47
dopesheet_filter(layout, context)
49
layout.prop(st, "auto_snap", text="")
50
layout.prop(st, "pivot_point", text="", icon_only=True)
52
row = layout.row(align=True)
53
row.operator("graph.copy", text="", icon='COPYDOWN')
54
row.operator("graph.paste", text="", icon='PASTEDOWN')
56
row = layout.row(align=True)
57
if st.has_ghost_curves:
58
row.operator("graph.ghost_curves_clear", text="", icon='GHOST_DISABLED')
60
row.operator("graph.ghost_curves_create", text="", icon='GHOST_ENABLED')
63
class GRAPH_MT_view(Menu):
66
def draw(self, context):
69
st = context.space_data
71
layout.operator("graph.properties", icon='MENU_PANEL')
74
layout.prop(st, "use_realtime_update")
75
layout.prop(st, "show_frame_indicator")
76
layout.prop(st, "show_cursor")
77
layout.prop(st, "show_sliders")
78
layout.prop(st, "use_auto_merge_keyframes")
81
layout.prop(st, "use_beauty_drawing")
85
layout.prop(st, "show_handles")
87
layout.prop(st, "use_only_selected_curves_handles")
88
layout.prop(st, "use_only_selected_keyframe_handles")
90
layout.prop(st, "show_seconds")
93
layout.operator("anim.previewrange_set")
94
layout.operator("anim.previewrange_clear")
95
layout.operator("graph.previewrange_set")
98
layout.operator("graph.frame_jump")
99
layout.operator("graph.view_all")
100
layout.operator("graph.view_selected")
103
layout.operator("screen.area_dupli")
104
layout.operator("screen.screen_full_area")
107
class GRAPH_MT_select(Menu):
110
def draw(self, context):
113
# This is a bit misleading as the operator's default text is "Select All" while it actually *toggles* All/None
114
layout.operator("graph.select_all_toggle").invert = False
115
layout.operator("graph.select_all_toggle", text="Invert Selection").invert = True
118
layout.operator("graph.select_border")
119
layout.operator("graph.select_border", text="Border Axis Range").axis_range = True
120
layout.operator("graph.select_border", text="Border (Include Handles)").include_handles = True
123
layout.operator("graph.select_column", text="Columns on Selected Keys").mode = 'KEYS'
124
layout.operator("graph.select_column", text="Column on Current Frame").mode = 'CFRA'
126
layout.operator("graph.select_column", text="Columns on Selected Markers").mode = 'MARKERS_COLUMN'
127
layout.operator("graph.select_column", text="Between Selected Markers").mode = 'MARKERS_BETWEEN'
130
layout.operator("graph.select_leftright", text="Before Current Frame").mode = 'LEFT'
131
layout.operator("graph.select_leftright", text="After Current Frame").mode = 'RIGHT'
134
layout.operator("graph.select_more")
135
layout.operator("graph.select_less")
138
layout.operator("graph.select_linked")
141
class GRAPH_MT_marker(Menu):
144
def draw(self, context):
147
from bl_ui.space_time import marker_menu_generic
148
marker_menu_generic(layout)
150
# TODO: pose markers for action edit mode only?
153
class GRAPH_MT_channel(Menu):
156
def draw(self, context):
159
layout.operator_context = 'INVOKE_REGION_CHANNELS'
161
layout.operator("anim.channels_delete")
164
layout.operator("anim.channels_setting_toggle")
165
layout.operator("anim.channels_setting_enable")
166
layout.operator("anim.channels_setting_disable")
169
layout.operator("anim.channels_editable_toggle")
170
layout.operator("anim.channels_visibility_set")
171
layout.operator_menu_enum("graph.extrapolation_type", "type", text="Extrapolation Mode")
174
layout.operator("anim.channels_expand")
175
layout.operator("anim.channels_collapse")
178
layout.operator_menu_enum("anim.channels_move", "direction", text="Move...")
181
layout.operator("anim.channels_fcurves_enable")
184
class GRAPH_MT_key(Menu):
187
def draw(self, context):
190
layout.menu("GRAPH_MT_key_transform", text="Transform")
192
layout.operator_menu_enum("graph.snap", "type", text="Snap")
193
layout.operator_menu_enum("graph.mirror", "type", text="Mirror")
196
layout.operator("graph.keyframe_insert")
197
layout.operator("graph.fmodifier_add")
198
layout.operator("graph.sound_bake")
201
layout.operator("graph.duplicate_move")
202
layout.operator("graph.delete")
205
layout.operator_menu_enum("graph.handle_type", "type", text="Handle Type")
206
layout.operator_menu_enum("graph.interpolation_type", "type", text="Interpolation Mode")
209
layout.operator("graph.clean")
210
layout.operator("graph.smooth")
211
layout.operator("graph.sample")
212
layout.operator("graph.bake")
215
layout.operator("graph.copy")
216
layout.operator("graph.paste")
219
layout.operator("graph.euler_filter", text="Discontinuity (Euler) Filter")
222
class GRAPH_MT_key_transform(Menu):
223
bl_label = "Transform"
225
def draw(self, context):
228
layout.operator("transform.translate", text="Grab/Move")
229
layout.operator("transform.transform", text="Extend").mode = 'TIME_EXTEND'
230
layout.operator("transform.rotate", text="Rotate")
231
layout.operator("transform.resize", text="Scale")
233
if __name__ == "__main__": # only for live edit.
234
bpy.utils.register_module(__name__)