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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 # ##### END GPL LICENSE BLOCK #####
23 class TIME_HT_header(bpy.types.Header):
24 bl_space_type = 'TIMELINE'
26 def draw(self, context):
30 tools = context.tool_settings
31 screen = context.screen
33 row = layout.row(align=True)
36 if context.area.show_menus:
37 sub = row.row(align=True)
38 sub.menu("TIME_MT_view")
39 sub.menu("TIME_MT_frame")
40 sub.menu("TIME_MT_playback")
42 layout.prop(scene, "use_preview_range", text="PR")
44 row = layout.row(align=True)
45 if not scene.use_preview_range:
46 row.prop(scene, "start_frame", text="Start")
47 row.prop(scene, "end_frame", text="End")
49 row.prop(scene, "preview_range_start_frame", text="Start")
50 row.prop(scene, "preview_range_end_frame", text="End")
52 layout.prop(scene, "current_frame", text="")
56 row = layout.row(align=True)
57 row.operator("screen.frame_jump", text="", icon='REW').end = False
58 row.operator("screen.keyframe_jump", text="", icon='PREV_KEYFRAME').next = False
59 if not screen.animation_playing:
60 row.operator("screen.animation_play", text="", icon='PLAY_REVERSE').reverse = True
61 row.operator("screen.animation_play", text="", icon='PLAY')
65 sub.operator("screen.animation_play", text="", icon='PAUSE')
66 row.operator("screen.keyframe_jump", text="", icon='NEXT_KEYFRAME').next = True
67 row.operator("screen.frame_jump", text="", icon='FF').end = True
69 row = layout.row(align=True)
70 row.prop(tools, "enable_auto_key", text="", toggle=True, icon='REC')
71 if screen.animation_playing and tools.enable_auto_key:
73 subsub.prop(tools, "record_with_nla", toggle=True)
75 layout.prop(scene, "sync_audio", text="Realtime", toggle=True, icon='SPEAKER')
79 row = layout.row(align=True)
80 row.prop_object(scene, "active_keying_set", scene, "keying_sets", text="")
81 row.operator("anim.keyframe_insert", text="", icon='KEY_HLT')
82 row.operator("anim.keyframe_delete", text="", icon='KEY_DEHLT')
85 class TIME_MT_view(bpy.types.Menu):
88 def draw(self, context):
91 st = context.space_data
93 layout.operator("anim.time_toggle")
94 layout.operator("time.view_all")
98 layout.prop(st, "show_cframe_indicator")
99 layout.prop(st, "only_selected")
103 layout.operator("marker.camera_bind")
105 class TIME_MT_frame(bpy.types.Menu):
108 def draw(self, context):
110 # tools = context.tool_settings
112 layout.operator("marker.add", text="Add Marker")
113 layout.operator("marker.duplicate", text="Duplicate Marker")
114 layout.operator("marker.move", text="Grab/Move Marker")
115 layout.operator("marker.delete", text="Delete Marker")
116 layout.label(text="ToDo: Name Marker")
120 layout.operator("time.start_frame_set")
121 layout.operator("time.end_frame_set")
126 #sub.active = tools.enable_auto_key
127 sub.menu("TIME_MT_autokey")
130 class TIME_MT_playback(bpy.types.Menu):
131 bl_label = "Playback"
133 def draw(self, context):
136 st = context.space_data
137 scene = context.scene
139 layout.prop(st, "play_top_left")
140 layout.prop(st, "play_all_3d")
141 layout.prop(st, "play_anim")
142 layout.prop(st, "play_buttons")
143 layout.prop(st, "play_image")
144 layout.prop(st, "play_sequencer")
145 layout.prop(st, "play_nodes")
149 layout.prop(scene, "sync_audio", text="Realtime Playback", icon='SPEAKER')
150 layout.prop(scene, "mute_audio")
151 layout.prop(scene, "scrub_audio")
154 class TIME_MT_autokey(bpy.types.Menu):
155 bl_label = "Auto-Keyframing Mode"
157 def draw(self, context):
159 tools = context.tool_settings
161 layout.active = tools.enable_auto_key
163 layout.prop_enum(tools, "autokey_mode", 'ADD_REPLACE_KEYS')
164 layout.prop_enum(tools, "autokey_mode", 'REPLACE_KEYS')
166 bpy.types.register(TIME_HT_header)
167 bpy.types.register(TIME_MT_view)
168 bpy.types.register(TIME_MT_frame)
169 bpy.types.register(TIME_MT_autokey)
170 bpy.types.register(TIME_MT_playback)