4 class TIME_HT_header(bpy.types.Header):
5 __space_type__ = 'TIMELINE'
7 def draw(self, context):
10 st = context.space_data
12 tools = context.tool_settings
13 screen = context.screen
15 row = layout.row(align=True)
18 if context.area.show_menus:
19 sub = row.row(align=True)
20 sub.itemM("TIME_MT_view")
21 sub.itemM("TIME_MT_frame")
22 sub.itemM("TIME_MT_playback")
24 layout.itemR(scene, "use_preview_range", text="PR")
26 row = layout.row(align=True)
27 if not scene.use_preview_range:
28 row.itemR(scene, "start_frame", text="Start")
29 row.itemR(scene, "end_frame", text="End")
31 row.itemR(scene, "preview_range_start_frame", text="Start")
32 row.itemR(scene, "preview_range_end_frame", text="End")
34 layout.itemR(scene, "current_frame", text="")
38 row = layout.row(align=True)
39 row.item_booleanO("screen.frame_jump", "end", False, text="", icon='ICON_REW')
40 row.item_booleanO("screen.keyframe_jump", "next", False, text="", icon='ICON_PREV_KEYFRAME')
41 if not screen.animation_playing:
42 row.item_booleanO("screen.animation_play", "reverse", True, text="", icon='ICON_PLAY_REVERSE')
43 row.itemO("screen.animation_play", text="", icon='ICON_PLAY')
47 sub.itemO("screen.animation_play", text="", icon='ICON_PAUSE')
48 row.item_booleanO("screen.keyframe_jump", "next", True, text="", icon='ICON_NEXT_KEYFRAME')
49 row.item_booleanO("screen.frame_jump", "end", True, text="", icon='ICON_FF')
51 row = layout.row(align=True)
52 row.itemR(tools, "enable_auto_key", text="", toggle=True, icon='ICON_REC')
53 if screen.animation_playing and tools.enable_auto_key:
55 subsub.itemR(tools, "record_with_nla", toggle=True)
57 layout.itemR(scene, "sync_audio", text="", toggle=True, icon='ICON_SPEAKER')
61 row = layout.row(align=True)
62 row.item_pointerR(scene, "active_keying_set", scene, "keying_sets", text="")
63 row.itemO("anim.insert_keyframe", text="", icon='ICON_KEY_HLT')
64 row.itemO("anim.delete_keyframe", text="", icon='ICON_KEY_DEHLT')
66 class TIME_MT_view(bpy.types.Menu):
69 def draw(self, context):
72 st = context.space_data
74 layout.itemO("anim.time_toggle")
78 layout.itemR(st, "only_selected")
80 class TIME_MT_frame(bpy.types.Menu):
83 def draw(self, context):
85 tools = context.tool_settings
87 layout.itemO("marker.add", text="Add Marker")
88 layout.itemO("marker.duplicate", text="Duplicate Marker")
89 layout.itemO("marker.move", text="Grab/Move Marker")
90 layout.itemO("marker.delete", text="Delete Marker")
91 layout.itemL(text="ToDo: Name Marker")
95 layout.itemO("time.start_frame_set")
96 layout.itemO("time.end_frame_set")
101 #sub.active = tools.enable_auto_key
102 sub.itemM("TIME_MT_autokey")
104 class TIME_MT_playback(bpy.types.Menu):
105 __label__ = "Playback"
107 def draw(self, context):
110 st = context.space_data
111 scene = context.scene
113 layout.itemR(st, "play_top_left")
114 layout.itemR(st, "play_all_3d")
115 layout.itemR(st, "play_anim")
116 layout.itemR(st, "play_buttons")
117 layout.itemR(st, "play_image")
118 layout.itemR(st, "play_sequencer")
119 layout.itemR(st, "play_nodes")
123 layout.itemR(st, "continue_physics")
127 layout.itemR(scene, "sync_audio", icon='ICON_SPEAKER')
128 layout.itemR(scene, "mute_audio")
129 layout.itemR(scene, "scrub_audio")
131 class TIME_MT_autokey(bpy.types.Menu):
132 __label__ = "Auto-Keyframing Mode"
134 def draw(self, context):
136 tools = context.tool_settings
138 layout.active = tools.enable_auto_key
140 layout.item_enumR(tools, "autokey_mode", 'ADD_REPLACE_KEYS')
141 layout.item_enumR(tools, "autokey_mode", 'REPLACE_KEYS')
143 bpy.types.register(TIME_HT_header)
144 bpy.types.register(TIME_MT_view)
145 bpy.types.register(TIME_MT_frame)
146 bpy.types.register(TIME_MT_autokey)
147 bpy.types.register(TIME_MT_playback)