Welcome to mirror list, hosted at ThFree Co, Russian Federation.

space_outliner.py « ui « release - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f039eb3f7c3d5f6a579142a3cdc2a70d3be7b386 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

import bpy

class OUTLINER_HT_header(bpy.types.Header):
	__space_type__ = "OUTLINER"
	__idname__ = "OUTLINER_HT_header"

	def draw(self, context):
		so = context.space_data
		sce = context.scene
		layout = self.layout

		layout.template_header(context)

		if context.area.show_menus:
			row = layout.row(align=True)
			row.itemM(context, "OUTLINER_MT_view")
			
		row = layout.row()
		row.itemR(so, "display_mode", text="")
		
		if so.display_mode == 'DATABLOCKS':
			row = layout.row(align=True)
			row.itemO("ANIM_OT_keyingset_add_new", text="", icon=31)
			# row.itemR(sce, "active_keyingset", text="KS: ")
			# ks = sce.keyingsets[sce.active_keyingset - 1]
			# row.itemR(ks, "name", text="")
			## row.itemR(sce, "keyingsets")
			
			row = layout.row()
			row.itemO("OUTLINER_OT_keyingset_add_selected", text="", icon=31)
			row.itemO("OUTLINER_OT_keyingset_remove_selected", text="", icon=32)
			
			row.itemO("ANIM_OT_insert_keyframe", text="", icon=514)
			row.itemO("ANIM_OT_delete_keyframe", text="", icon=513)
		

class OUTLINER_MT_view(bpy.types.Menu):
	__space_type__ = "OUTLINER"
	__label__ = "View"

	def draw(self, context):
		layout = self.layout
		so = context.space_data

		col = layout.column()
		col.itemR(so, "show_restriction_columns")
		#layout.itemO("TEXT_OT_new")

bpy.types.register(OUTLINER_HT_header)
bpy.types.register(OUTLINER_MT_view)