| 
									
										
										
										
											2009-11-01 15:21:20 +00:00
										 |  |  | # ##### BEGIN GPL LICENSE BLOCK ##### | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | #  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 2 | 
					
						
							|  |  |  | #  of the License, or (at your option) any later version. | 
					
						
							| 
									
										
										
										
											2009-11-03 07:23:02 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2009-11-01 15:21:20 +00:00
										 |  |  | #  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. | 
					
						
							| 
									
										
										
										
											2009-11-03 07:23:02 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2009-11-01 15:21:20 +00:00
										 |  |  | #  You should have received a copy of the GNU General Public License | 
					
						
							|  |  |  | #  along with this program; if not, write to the Free Software Foundation, | 
					
						
							|  |  |  | #  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # ##### END GPL LICENSE BLOCK ##### | 
					
						
							| 
									
										
										
										
											2009-10-31 20:16:59 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | # <pep8 compliant> | 
					
						
							| 
									
										
										
										
											2009-08-13 16:59:52 +00:00
										 |  |  | import bpy | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-08-13 16:59:52 +00:00
										 |  |  | class TIME_HT_header(bpy.types.Header): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_space_type = 'TIMELINE' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         scene = context.scene | 
					
						
							|  |  |  |         tools = context.tool_settings | 
					
						
							|  |  |  |         screen = context.screen | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         row = layout.row(align=True) | 
					
						
							|  |  |  |         row.template_header() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         if context.area.show_menus: | 
					
						
							|  |  |  |             sub = row.row(align=True) | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             sub.menu("TIME_MT_view") | 
					
						
							|  |  |  |             sub.menu("TIME_MT_frame") | 
					
						
							|  |  |  |             sub.menu("TIME_MT_playback") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         layout.prop(scene, "use_preview_range", text="PR") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         row = layout.row(align=True) | 
					
						
							|  |  |  |         if not scene.use_preview_range: | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             row.prop(scene, "start_frame", text="Start") | 
					
						
							|  |  |  |             row.prop(scene, "end_frame", text="End") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         else: | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             row.prop(scene, "preview_range_start_frame", text="Start") | 
					
						
							|  |  |  |             row.prop(scene, "preview_range_end_frame", text="End") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         layout.prop(scene, "current_frame", text="") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         layout.separator() | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         row = layout.row(align=True) | 
					
						
							| 
									
										
										
										
											2009-12-10 10:23:53 +00:00
										 |  |  |         row.operator("screen.frame_jump", text="", icon='REW').end = False | 
					
						
							|  |  |  |         row.operator("screen.keyframe_jump", text="", icon='PREV_KEYFRAME').next = False | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         if not screen.animation_playing: | 
					
						
							| 
									
										
										
										
											2009-12-10 10:23:53 +00:00
										 |  |  |             row.operator("screen.animation_play", text="", icon='PLAY_REVERSE').reverse = True | 
					
						
							|  |  |  |             row.operator("screen.animation_play", text="", icon='PLAY') | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         else: | 
					
						
							|  |  |  |             sub = row.row() | 
					
						
							|  |  |  |             sub.scale_x = 2.0 | 
					
						
							| 
									
										
										
										
											2009-12-10 10:23:53 +00:00
										 |  |  |             sub.operator("screen.animation_play", text="", icon='PAUSE') | 
					
						
							|  |  |  |         row.operator("screen.keyframe_jump", text="", icon='NEXT_KEYFRAME').next = True | 
					
						
							|  |  |  |         row.operator("screen.frame_jump", text="", icon='FF').end = True | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         row = layout.row(align=True) | 
					
						
							| 
									
										
										
										
											2009-12-10 10:23:53 +00:00
										 |  |  |         row.prop(tools, "enable_auto_key", text="", toggle=True, icon='REC') | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         if screen.animation_playing and tools.enable_auto_key: | 
					
						
							|  |  |  |             subsub = row.row() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             subsub.prop(tools, "record_with_nla", toggle=True) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-10 10:23:53 +00:00
										 |  |  |         layout.prop(scene, "sync_audio", text="Realtime", toggle=True, icon='SPEAKER') | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         layout.separator() | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         row = layout.row(align=True) | 
					
						
							| 
									
										
										
										
											2009-11-23 11:43:38 +00:00
										 |  |  |         row.prop_object(scene, "active_keying_set", scene, "keying_sets", text="") | 
					
						
							| 
									
										
										
										
											2009-12-10 10:23:53 +00:00
										 |  |  |         row.operator("anim.keyframe_insert", text="", icon='KEY_HLT') | 
					
						
							|  |  |  |         row.operator("anim.keyframe_delete", text="", icon='KEY_DEHLT') | 
					
						
							| 
									
										
										
										
											2009-08-13 22:10:50 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-08-13 16:59:52 +00:00
										 |  |  | class TIME_MT_view(bpy.types.Menu): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_label = "View" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         st = context.space_data | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         layout.operator("anim.time_toggle") | 
					
						
							| 
									
										
										
										
											2009-12-03 09:56:31 +00:00
										 |  |  |         layout.operator("time.view_all") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         layout.separator() | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-11 11:18:55 +00:00
										 |  |  |         layout.prop(st, "show_cframe_indicator") | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         layout.prop(st, "only_selected") | 
					
						
							| 
									
										
										
										
											2009-08-13 22:10:50 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-16 19:49:33 +00:00
										 |  |  |         layout.separator() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         layout.operator("marker.camera_bind") | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-26 09:36:50 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-08-13 16:59:52 +00:00
										 |  |  | class TIME_MT_frame(bpy.types.Menu): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_label = "Frame" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  |         # tools = context.tool_settings | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         layout.operator("marker.add", text="Add Marker") | 
					
						
							|  |  |  |         layout.operator("marker.duplicate", text="Duplicate Marker") | 
					
						
							|  |  |  |         layout.operator("marker.move", text="Grab/Move Marker") | 
					
						
							|  |  |  |         layout.operator("marker.delete", text="Delete Marker") | 
					
						
							| 
									
										
										
										
											2010-01-21 19:43:27 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         # it was ok for riscos... ok TODO, operator | 
					
						
							|  |  |  |         for marker in context.scene.timeline_markers: | 
					
						
							|  |  |  |             if marker.selected: | 
					
						
							|  |  |  |                 layout.separator() | 
					
						
							|  |  |  |                 layout.prop(marker, "name", text="", icon='MARKER_HLT') | 
					
						
							|  |  |  |                 break | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         layout.separator() | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         layout.operator("time.start_frame_set") | 
					
						
							|  |  |  |         layout.operator("time.end_frame_set") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         layout.separator() | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         sub = layout.row() | 
					
						
							|  |  |  |         #sub.active = tools.enable_auto_key | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         sub.menu("TIME_MT_autokey") | 
					
						
							| 
									
										
										
										
											2009-08-13 22:10:50 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-08-13 16:59:52 +00:00
										 |  |  | class TIME_MT_playback(bpy.types.Menu): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_label = "Playback" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         st = context.space_data | 
					
						
							|  |  |  |         scene = context.scene | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         layout.prop(st, "play_top_left") | 
					
						
							|  |  |  |         layout.prop(st, "play_all_3d") | 
					
						
							|  |  |  |         layout.prop(st, "play_anim") | 
					
						
							|  |  |  |         layout.prop(st, "play_buttons") | 
					
						
							|  |  |  |         layout.prop(st, "play_image") | 
					
						
							|  |  |  |         layout.prop(st, "play_sequencer") | 
					
						
							|  |  |  |         layout.prop(st, "play_nodes") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         layout.separator() | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-10 10:23:53 +00:00
										 |  |  |         layout.prop(scene, "sync_audio", text="Realtime Playback", icon='SPEAKER') | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         layout.prop(scene, "mute_audio") | 
					
						
							|  |  |  |         layout.prop(scene, "scrub_audio") | 
					
						
							| 
									
										
										
										
											2009-08-25 12:31:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-08-25 12:31:35 +00:00
										 |  |  | class TIME_MT_autokey(bpy.types.Menu): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_label = "Auto-Keyframing Mode" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         tools = context.tool_settings | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         layout.active = tools.enable_auto_key | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-23 11:43:38 +00:00
										 |  |  |         layout.prop_enum(tools, "autokey_mode", 'ADD_REPLACE_KEYS') | 
					
						
							|  |  |  |         layout.prop_enum(tools, "autokey_mode", 'REPLACE_KEYS') | 
					
						
							| 
									
										
										
										
											2009-08-13 16:59:52 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | bpy.types.register(TIME_HT_header) | 
					
						
							| 
									
										
										
										
											2009-08-16 16:15:13 +00:00
										 |  |  | bpy.types.register(TIME_MT_view) | 
					
						
							| 
									
										
										
										
											2009-08-13 22:10:50 +00:00
										 |  |  | bpy.types.register(TIME_MT_frame) | 
					
						
							| 
									
										
										
										
											2009-08-25 12:31:35 +00:00
										 |  |  | bpy.types.register(TIME_MT_autokey) | 
					
						
							| 
									
										
										
										
											2009-08-13 22:10:50 +00:00
										 |  |  | bpy.types.register(TIME_MT_playback) |