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 #####
24 class NLA_HT_header(bpy.types.Header):
25 bl_space_type = 'NLA_EDITOR'
27 def draw(self, context):
28 from bl_ui.space_dopesheet import dopesheet_filter
32 st = context.space_data
34 row = layout.row(align=True)
37 if context.area.show_menus:
38 sub = row.row(align=True)
40 sub.menu("NLA_MT_view")
41 sub.menu("NLA_MT_select")
42 sub.menu("NLA_MT_marker")
43 sub.menu("NLA_MT_edit")
44 sub.menu("NLA_MT_add")
46 dopesheet_filter(layout, context)
48 layout.prop(st, "auto_snap", text="")
51 class NLA_MT_view(bpy.types.Menu):
54 def draw(self, context):
57 st = context.space_data
61 layout.operator("nla.properties", icon='MENU_PANEL')
65 layout.prop(st, "use_realtime_update")
66 layout.prop(st, "show_frame_indicator")
68 layout.operator("anim.time_toggle", text="Show Frames" if st.show_seconds else "Show Seconds")
70 layout.prop(st, "show_strip_curves")
73 layout.operator("anim.previewrange_set")
74 layout.operator("anim.previewrange_clear")
77 layout.operator("screen.area_dupli")
78 layout.operator("screen.screen_full_area")
81 class NLA_MT_select(bpy.types.Menu):
84 def draw(self, context):
88 # This is a bit misleading as the operator's default text is "Select All" while it actually *toggles* All/None
89 layout.operator("nla.select_all_toggle")
90 layout.operator("nla.select_all_toggle", text="Invert Selection").invert = True
93 layout.operator("nla.select_border")
94 layout.operator("nla.select_border", text="Border Axis Range").axis_range = True
97 layout.operator("nla.select_leftright", text="Before Current Frame").mode = 'LEFT'
98 layout.operator("nla.select_leftright", text="After Current Frame").mode = 'RIGHT'
101 class NLA_MT_marker(bpy.types.Menu):
104 def draw(self, context):
107 #layout.operator_context = 'EXEC_REGION_WIN'
110 layout.operator("marker.add", "Add Marker")
111 layout.operator("marker.duplicate", text="Duplicate Marker")
112 layout.operator("marker.delete", text="Delete Marker")
116 layout.operator("marker.rename", text="Rename Marker")
117 layout.operator("marker.move", text="Grab/Move Marker")
120 class NLA_MT_edit(bpy.types.Menu):
123 def draw(self, context):
126 scene = context.scene
129 layout.menu("NLA_MT_edit_transform", text="Transform")
131 layout.operator_menu_enum("nla.snap", "type", text="Snap")
134 layout.operator("nla.duplicate")
135 layout.operator("nla.split")
136 layout.operator("nla.delete")
139 layout.operator("nla.mute_toggle")
142 layout.operator("nla.apply_scale")
143 layout.operator("nla.clear_scale")
144 layout.operator("nla.action_sync_length").active = False
147 layout.operator("nla.swap")
148 layout.operator("nla.move_up")
149 layout.operator("nla.move_down")
151 # TODO: this really belongs more in a "channel" (or better, "track") menu
153 layout.operator_menu_enum("anim.channels_move", "direction", text="Track Ordering...")
156 # TODO: names of these tools for 'tweakmode' need changing?
157 if scene.is_nla_tweakmode:
158 layout.operator("nla.tweakmode_exit", text="Stop Tweaking Strip Actions")
160 layout.operator("nla.tweakmode_enter", text="Start Tweaking Strip Actions")
163 class NLA_MT_add(bpy.types.Menu):
166 def draw(self, context):
170 layout.operator("nla.actionclip_add")
171 layout.operator("nla.transition_add")
174 layout.operator("nla.meta_add")
175 layout.operator("nla.meta_remove")
178 layout.operator("nla.tracks_add")
179 layout.operator("nla.tracks_add", text="Add Tracks Above Selected").above_selected = True
182 class NLA_MT_edit_transform(bpy.types.Menu):
183 bl_label = "Transform"
185 def draw(self, context):
189 layout.operator("transform.translate", text="Grab/Move")
190 layout.operator("transform.transform", text="Extend").mode = 'TIME_EXTEND'
191 layout.operator("transform.transform", text="Scale").mode= 'TIME_SCALE'
193 if __name__ == "__main__": # only for live edit.
194 bpy.utils.register_module(__name__)