4 class TIME_HT_header(bpy.types.Header):
5 __space_type__ = 'TIMELINE'
7 def draw(self, context):
10 st = context.space_data
12 rd = context.scene.render_data
13 tools = context.tool_settings
14 screen = context.screen
16 row = layout.row(align=True)
19 if context.area.show_menus:
20 sub = row.row(align=True)
21 sub.itemM("TIME_MT_view")
22 sub.itemM("TIME_MT_frame")
23 sub.itemM("TIME_MT_playback")
25 layout.itemR(scene, "use_preview_range", text="PR", toggle=True)
27 row = layout.row(align=True)
28 if not scene.use_preview_range:
29 row.itemR(scene, "start_frame", text="Start")
30 row.itemR(scene, "end_frame", text="End")
32 row.itemR(scene, "preview_range_start_frame", text="Start")
33 row.itemR(scene, "preview_range_end_frame", text="End")
35 layout.itemR(scene, "current_frame", text="")
37 row = layout.row(align=True)
38 row.item_booleanO("screen.frame_jump", "end", False, text="", icon='ICON_REW')
39 row.item_booleanO("screen.keyframe_jump", "next", False, text="", icon='ICON_PREV_KEYFRAME')
40 if not screen.animation_playing:
41 row.item_booleanO("screen.animation_play", "reverse", True, text="", icon='ICON_PLAY_REVERSE')
42 row.itemO("screen.animation_play", text="", icon='ICON_PLAY')
46 sub.itemO("screen.animation_play", text="", icon='ICON_PAUSE')
47 row.item_booleanO("screen.keyframe_jump", "next", True, text="", icon='ICON_NEXT_KEYFRAME')
48 row.item_booleanO("screen.frame_jump", "end", True, text="", icon='ICON_FF')
50 layout.itemR(rd, "sync_audio", text="", toggle=True, icon='ICON_SPEAKER')
54 row = layout.row(align=True)
55 row.itemR(tools, "enable_auto_key", text="", toggle=True, icon='ICON_REC')
57 sub.active = tools.enable_auto_key
58 sub.itemR(tools, "autokey_mode", text="")
59 if screen.animation_playing and tools.enable_auto_key:
61 subsub.itemR(tools, "record_with_nla", toggle=True)
65 row = layout.row(align=True)
66 row.item_pointerR(scene, "active_keying_set", scene, "keying_sets", text="")
67 row.itemO("anim.insert_keyframe", text="", icon='ICON_KEY_HLT')
68 row.itemO("anim.delete_keyframe", text="", icon='ICON_KEY_DEHLT')
70 class TIME_MT_view(bpy.types.Menu):
71 __space_type__ = 'TIMELINE'
74 def draw(self, context):
77 st = context.space_data
79 layout.itemO("anim.time_toggle")
83 layout.itemR(st, "only_selected")
85 class TIME_MT_frame(bpy.types.Menu):
86 __space_type__ = 'TIMELINE'
89 def draw(self, context):
92 layout.itemO("marker.add", text="Add Marker")
93 layout.itemO("marker.duplicate", text="Duplicate Marker")
94 layout.itemO("marker.move", text="Grab/Move Marker")
95 layout.itemO("marker.delete", text="Delete Marker")
96 layout.itemL(text="ToDo: Name Marker")
100 layout.itemO("time.start_frame_set")
101 layout.itemO("time.end_frame_set")
103 class TIME_MT_playback(bpy.types.Menu):
104 __space_type__ = 'TIMELINE'
105 __label__ = "Playback"
107 def draw(self, context):
110 st = context.space_data
112 layout.itemR(st, "play_top_left")
113 layout.itemR(st, "play_all_3d")
114 layout.itemR(st, "play_anim")
115 layout.itemR(st, "play_buttons")
116 layout.itemR(st, "play_image")
117 layout.itemR(st, "play_sequencer")
119 layout.itemR(st, "continue_physics")
121 bpy.types.register(TIME_HT_header)
122 bpy.types.register(TIME_MT_view)
123 bpy.types.register(TIME_MT_frame)
124 bpy.types.register(TIME_MT_playback)