Undo revision 23130 which was a merge with 2.5, a messy one because I did something...
[blender.git] / release / ui / space_outliner.py
1
2 import bpy
3
4 class OUTLINER_HT_header(bpy.types.Header):
5         __space_type__ = "OUTLINER"
6
7         def draw(self, context):
8                 so = context.space_data
9                 sce = context.scene
10                 layout = self.layout
11
12                 row = layout.row(align=True)
13                 row.template_header()
14
15                 if context.area.show_menus:
16                         sub = row.row(align=True)
17                         sub.itemM("OUTLINER_MT_view")
18                         
19                 row = layout.row()
20                 row.itemR(so, "display_mode", text="")
21                 
22                 if so.display_mode == 'DATABLOCKS':
23                         row = layout.row(align=True)
24                         row.itemO("anim.keyingset_add_new", text="", icon=31)
25                         # row.itemR(sce, "active_keyingset", text="KS: ")
26                         # ks = sce.keyingsets[sce.active_keyingset - 1]
27                         # row.itemR(ks, "name", text="")
28                         ## row.itemR(sce, "keyingsets")
29                         
30                         row = layout.row()
31                         row.itemO("outliner.keyingset_add_selected", text="", icon=31)
32                         row.itemO("outliner.keyingset_remove_selected", text="", icon=32)
33                         
34                         row.itemO("anim.insert_keyframe", text="", icon=514)
35                         row.itemO("anim.delete_keyframe", text="", icon=513)
36                 
37
38 class OUTLINER_MT_view(bpy.types.Menu):
39         __space_type__ = "OUTLINER"
40         __label__ = "View"
41
42         def draw(self, context):
43                 layout = self.layout
44                 so = context.space_data
45
46                 col = layout.column()
47                 col.itemR(so, "show_restriction_columns")
48                 #layout.itemO("text.new")
49
50 bpy.types.register(OUTLINER_HT_header)
51 bpy.types.register(OUTLINER_MT_view)
52