Removing MESH_OT_vertices_transform_to_sphere.
[blender-staging.git] / release / scripts / ui / buttons_scene.py
1
2 import bpy
3
4 class SceneButtonsPanel(bpy.types.Panel):
5         __space_type__ = 'PROPERTIES'
6         __region_type__ = 'WINDOW'
7         __context__ = "scene"
8         
9         def poll(self, context):
10                 return context.scene
11
12 class SCENE_PT_scene(SceneButtonsPanel):
13         __label__ = "Scene"
14         COMPAT_ENGINES = set(['BLENDER_RENDER'])
15
16         def draw(self, context):
17                 layout = self.layout
18                 
19                 scene = context.scene
20
21                 layout.itemR(scene, "camera")
22                 layout.itemR(scene, "set", text="Background")
23
24 class SCENE_PT_unit(SceneButtonsPanel):
25         __label__ = "Units"
26         COMPAT_ENGINES = set(['BLENDER_RENDER'])
27
28         def draw(self, context):
29                 layout = self.layout
30                 
31                 unit = context.scene.unit_settings
32                 
33                 col = layout.column()
34                 col.row().itemR(unit, "system", expand=True)
35                 
36                 row = layout.row()
37                 row.active = (unit.system != 'NONE')
38                 row.itemR(unit, "scale_length", text="Scale")
39                 row.itemR(unit, "use_separate")
40                 
41 class SCENE_PT_keying_sets(SceneButtonsPanel):
42         __label__ = "Keying Sets"
43         
44         def draw(self, context):
45                 layout = self.layout
46                 
47                 scene = context.scene
48                 
49                 row = layout.row()
50                 
51                 col = row.column()
52                 col.template_list(scene, "keying_sets", scene, "active_keying_set_index", rows=2)
53                 
54                 col = row.column(align=True)
55                 col.itemO("anim.keying_set_add", icon='ICON_ZOOMIN', text="")
56                 col.itemO("anim.keying_set_remove", icon='ICON_ZOOMOUT', text="")
57                 
58                 ks = scene.active_keying_set
59                 if ks:
60                         row = layout.row()
61                         
62                         col = row.column()
63                         col.itemR(ks, "name")
64                         col.itemR(ks, "absolute")
65                         
66                         col = row.column()
67                         col.itemL(text="Keyframing Settings:")
68                         col.itemR(ks, "insertkey_needed", text="Needed")
69                         col.itemR(ks, "insertkey_visual", text="Visual")
70                         
71 class SCENE_PT_keying_set_paths(SceneButtonsPanel):
72         __label__ = "Active Keying Set"
73         
74         def poll(self, context):
75                 return (context.scene != None) and (context.scene.active_keying_set != None)
76         
77         def draw(self, context):
78                 layout = self.layout
79                 
80                 scene = context.scene
81                 ks = scene.active_keying_set
82                 
83                 row = layout.row()
84                 row.itemL(text="Paths:")
85                 
86                 row = layout.row()
87                 
88                 col = row.column()
89                 col.template_list(ks, "paths", ks, "active_path_index", rows=2)
90                 
91                 col = row.column(align=True)
92                 col.itemO("anim.keying_set_path_add", icon='ICON_ZOOMIN', text="")
93                 col.itemO("anim.keying_set_path_remove", icon='ICON_ZOOMOUT', text="")
94                 
95                 ksp = ks.active_path
96                 if ksp:
97                         col = layout.column()
98                         col.itemL(text="Target:")
99                         col.template_any_ID(ksp, "id", "id_type")
100                         col.template_path_builder(ksp, "rna_path", ksp.id)
101                         
102                         
103                         row = layout.row()
104                         
105                         col = row.column()
106                         col.itemL(text="Array Target:")
107                         col.itemR(ksp, "entire_array")
108                         if ksp.entire_array == False:
109                                 col.itemR(ksp, "array_index")
110                                 
111                         col = row.column()
112                         col.itemL(text="F-Curve Grouping:")
113                         col.itemR(ksp, "grouping")
114                         if ksp.grouping == 'NAMED':
115                                 col.itemR(ksp, "group")
116
117 class SCENE_PT_physics(SceneButtonsPanel):
118         __label__ = "Gravity"
119         COMPAT_ENGINES = set(['BLENDER_RENDER'])
120
121         def draw_header(self, context):
122                 self.layout.itemR(context.scene, "use_gravity", text="")
123
124         def draw(self, context):
125                 layout = self.layout
126                 
127                 scene = context.scene
128
129                 layout.active = scene.use_gravity
130
131                 layout.itemR(scene, "gravity", text="")
132
133 bpy.types.register(SCENE_PT_scene)              
134 bpy.types.register(SCENE_PT_unit)
135 bpy.types.register(SCENE_PT_keying_sets)
136 bpy.types.register(SCENE_PT_keying_set_paths)
137 bpy.types.register(SCENE_PT_physics)