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

buttons_scene.py « ui « scripts « release - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 54f47791d593e20a2adf74db19f19b7e87c813fe (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137

import bpy

class SceneButtonsPanel(bpy.types.Panel):
	__space_type__ = 'PROPERTIES'
	__region_type__ = 'WINDOW'
	__context__ = "scene"
	
	def poll(self, context):
		return context.scene

class SCENE_PT_scene(SceneButtonsPanel):
	__label__ = "Scene"
	COMPAT_ENGINES = set(['BLENDER_RENDER'])

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

		layout.itemR(scene, "camera")
		layout.itemR(scene, "set", text="Background")

class SCENE_PT_unit(SceneButtonsPanel):
	__label__ = "Units"
	COMPAT_ENGINES = set(['BLENDER_RENDER'])

	def draw(self, context):
		layout = self.layout
		
		unit = context.scene.unit_settings
		
		col = layout.column()
		col.row().itemR(unit, "system", expand=True)
		
		row = layout.row()
		row.active = (unit.system != 'NONE')
		row.itemR(unit, "scale_length", text="Scale")
		row.itemR(unit, "use_separate")
		
class SCENE_PT_keying_sets(SceneButtonsPanel):
	__label__ = "Keying Sets"
	
	def draw(self, context):
		layout = self.layout
		
		scene = context.scene
		
		row = layout.row()
		
		col = row.column()
		col.template_list(scene, "keying_sets", scene, "active_keying_set_index", rows=2)
		
		col = row.column(align=True)
		col.itemO("anim.keying_set_add", icon='ICON_ZOOMIN', text="")
		col.itemO("anim.keying_set_remove", icon='ICON_ZOOMOUT', text="")
		
		ks = scene.active_keying_set
		if ks:
			row = layout.row()
			
			col = row.column()
			col.itemR(ks, "name")
			col.itemR(ks, "absolute")
			
			col = row.column()
			col.itemL(text="Keyframing Settings:")
			col.itemR(ks, "insertkey_needed", text="Needed")
			col.itemR(ks, "insertkey_visual", text="Visual")
			
class SCENE_PT_keying_set_paths(SceneButtonsPanel):
	__label__ = "Active Keying Set"
	
	def poll(self, context):
		return (context.scene != None) and (context.scene.active_keying_set != None)
	
	def draw(self, context):
		layout = self.layout
		
		scene = context.scene
		ks = scene.active_keying_set
		
		row = layout.row()
		row.itemL(text="Paths:")
		
		row = layout.row()
		
		col = row.column()
		col.template_list(ks, "paths", ks, "active_path_index", rows=2)
		
		col = row.column(align=True)
		col.itemO("anim.keying_set_path_add", icon='ICON_ZOOMIN', text="")
		col.itemO("anim.keying_set_path_remove", icon='ICON_ZOOMOUT', text="")
		
		ksp = ks.active_path
		if ksp:
			col = layout.column()
			col.itemL(text="Target:")
			col.template_any_ID(ksp, "id", "id_type")
			col.template_path_builder(ksp, "rna_path", ksp.id)
			
			
			row = layout.row()
			
			col = row.column()
			col.itemL(text="Array Target:")
			col.itemR(ksp, "entire_array")
			if ksp.entire_array == False:
				col.itemR(ksp, "array_index")
				
			col = row.column()
			col.itemL(text="F-Curve Grouping:")
			col.itemR(ksp, "grouping")
			if ksp.grouping == 'NAMED':
				col.itemR(ksp, "group")

class SCENE_PT_physics(SceneButtonsPanel):
	__label__ = "Gravity"
	COMPAT_ENGINES = set(['BLENDER_RENDER'])

	def draw_header(self, context):
		self.layout.itemR(context.scene, "use_gravity", text="")

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

		layout.active = scene.use_gravity

		layout.itemR(scene, "gravity", text="")

bpy.types.register(SCENE_PT_scene)		
bpy.types.register(SCENE_PT_unit)
bpy.types.register(SCENE_PT_keying_sets)
bpy.types.register(SCENE_PT_keying_set_paths)
bpy.types.register(SCENE_PT_physics)