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")
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="")
39 row = layout.row(align=True)
40 row.item_booleanO("screen.frame_jump", "end", False, text="", icon='ICON_REW')
41 row.item_booleanO("screen.keyframe_jump", "next", False, text="", icon='ICON_PREV_KEYFRAME')
42 if not screen.animation_playing:
43 row.item_booleanO("screen.animation_play", "reverse", True, text="", icon='ICON_PLAY_REVERSE')
44 row.itemO("screen.animation_play", text="", icon='ICON_PLAY')
48 sub.itemO("screen.animation_play", text="", icon='ICON_PAUSE')
49 row.item_booleanO("screen.keyframe_jump", "next", True, text="", icon='ICON_NEXT_KEYFRAME')
50 row.item_booleanO("screen.frame_jump", "end", True, text="", icon='ICON_FF')
52 row = layout.row(align=True)
53 row.itemR(tools, "enable_auto_key", text="", toggle=True, icon='ICON_REC')
54 if screen.animation_playing and tools.enable_auto_key:
56 subsub.itemR(tools, "record_with_nla", toggle=True)
58 layout.itemR(rd, "sync_audio", text="", toggle=True, icon='ICON_SPEAKER')
62 row = layout.row(align=True)
63 row.item_pointerR(scene, "active_keying_set", scene, "keying_sets", text="")
64 row.itemO("anim.insert_keyframe", text="", icon='ICON_KEY_HLT')
65 row.itemO("anim.delete_keyframe", text="", icon='ICON_KEY_DEHLT')
67 class TIME_MT_view(bpy.types.Menu):
68 __space_type__ = 'TIMELINE'
71 def draw(self, context):
74 st = context.space_data
76 layout.itemO("anim.time_toggle")
80 layout.itemR(st, "only_selected")
82 class TIME_MT_frame(bpy.types.Menu):
83 __space_type__ = 'TIMELINE'
86 def draw(self, context):
88 tools = context.tool_settings
90 layout.itemO("marker.add", text="Add Marker")
91 layout.itemO("marker.duplicate", text="Duplicate Marker")
92 layout.itemO("marker.move", text="Grab/Move Marker")
93 layout.itemO("marker.delete", text="Delete Marker")
94 layout.itemL(text="ToDo: Name Marker")
98 layout.itemO("time.start_frame_set")
99 layout.itemO("time.end_frame_set")
104 sub.active = tools.enable_auto_key
105 sub.itemM("TIME_MT_autokey")
107 class TIME_MT_playback(bpy.types.Menu):
108 __space_type__ = 'TIMELINE'
109 __label__ = "Playback"
111 def draw(self, context):
114 st = context.space_data
115 rd = context.scene.render_data
117 layout.itemR(st, "play_top_left")
118 layout.itemR(st, "play_all_3d")
119 layout.itemR(st, "play_anim")
120 layout.itemR(st, "play_buttons")
121 layout.itemR(st, "play_image")
122 layout.itemR(st, "play_sequencer")
126 layout.itemR(st, "continue_physics")
130 layout.itemR(rd, "sync_audio", icon='ICON_SPEAKER')
134 class TIME_MT_autokey(bpy.types.Menu):
135 __space_type__ = 'TIMELINE'
136 __label__ = "Auto-Keyframing Mode"
138 def draw(self, context):
140 tools = context.tool_settings
142 layout.active = tools.enable_auto_key
144 layout.item_enumR(tools, "autokey_mode", "ADD_REPLACE_KEYS")
145 layout.item_enumR(tools, "autokey_mode", "REPLACE_KEYS")
147 bpy.types.register(TIME_HT_header)
148 bpy.types.register(TIME_MT_view)
149 bpy.types.register(TIME_MT_frame)
150 bpy.types.register(TIME_MT_autokey)
151 bpy.types.register(TIME_MT_playback)