2.5 Timeline:
[blender.git] / release / ui / space_time.py
1
2 import bpy
3
4 class TIME_HT_header(bpy.types.Header):
5         __space_type__ = "TIMELINE"
6
7         def draw(self, context):
8                 layout = self.layout
9                 
10                 st = context.space_data
11                 scene = context.scene
12
13                 layout.template_header()
14
15                 if context.area.show_menus:
16                         row = layout.row()
17                         #row.itemM("TIME_MT_view")
18                         #row.itemM("TIME_MT_frame")
19                         #row.itemM("TIME_MT_playback")
20
21                 layout.itemR(scene, "use_preview_range", text="PR", toggle=True)
22                 
23                 layout.itemS()
24                 
25                 row = layout.row(align=True)
26                 if not scene.use_preview_range:
27                         row.itemR(scene, "start_frame", text="Start")
28                         row.itemR(scene, "end_frame", text="End")
29                 else:
30                         row.itemR(scene, "preview_range_start_frame", text="Start")
31                         row.itemR(scene, "preview_range_end_frame", text="End")
32                 
33                 layout.itemS()
34                 layout.itemR(scene, "current_frame")
35                 
36                 layout.itemS()
37                 
38                 # XXX: Pause Button
39                 row = layout.row(align=True)
40                 row.itemO("screen.frame_jump", text="", icon='ICON_REW')
41                 row.itemO("screen.keyframe_jump", text="", icon='ICON_PREV_KEYFRAME')
42                 row.item_booleanO("screen.animation_play", "reverse", True, text="", icon='ICON_PLAY_REVERSE')
43                 row.itemO("screen.animation_play", text="", icon='ICON_PLAY')
44                 row.item_booleanO("screen.keyframe_jump", "next", True, text="", icon='ICON_NEXT_KEYFRAME')
45                 row.item_booleanO("screen.frame_jump", "end", True, text="", icon='ICON_FF')
46
47 """
48 class TIME_MT_view(bpy.types.Menu):
49         __space_type__ = "TEXT_EDITOR"
50         __label__ = "View"
51
52         def draw(self, context):
53                 layout = self.layout
54                 
55                 st = context.space_data
56                 
57 class TIME_MT_frame(bpy.types.Menu):
58         __space_type__ = "TEXT_EDITOR"
59         __label__ = "Frame"
60
61         def draw(self, context):
62                 layout = self.layout
63                 
64                 st = context.space_data
65
66 class TIME_MT_playback(bpy.types.Menu):
67         __space_type__ = "TEXT_EDITOR"
68         __label__ = "Playback"
69
70         def draw(self, context):
71                 layout = self.layout
72                 
73                 st = context.space_data
74 """
75
76 bpy.types.register(TIME_HT_header)
77 #bpy.types.register(TIME_MT_view)
78 #bpy.types.register(TIME_MT_frame)
79 #bpy.types.register(TIME_MT_playback)