2.5 Buttons:
[blender.git] / release / ui / buttons_scene.py
1
2 import bpy
3
4 class RenderButtonsPanel(bpy.types.Panel):
5         __space_type__ = "BUTTONS_WINDOW"
6         __region_type__ = "WINDOW"
7         __context__ = "scene"
8
9 class RENDER_PT_shading(RenderButtonsPanel):
10         __label__ = "Shading"
11
12         def draw(self, context):
13                 scene = context.scene
14                 layout = self.layout
15
16                 rd = scene.render_data
17                 
18                 split = layout.split()
19                 
20                 sub = split.column()
21                 sub.itemR(rd, "render_shadows", text="Shadows")
22                 sub.itemR(rd, "render_sss", text="Subsurface Scattering")
23                 sub.itemR(rd, "render_envmaps", text="Environment Map")
24                 #       sub.itemR(rd, "render_radiosity", text="Radio")
25                 
26                 col = split.column()
27                 col.itemR(rd, "render_raytracing", text="Ray Tracing")
28                 colsub = col.column()
29                 colsub.active = rd.render_raytracing
30                 colsub.itemR(rd, "octree_resolution", text="Octree")
31                 col.itemR(rd, "dither_intensity", text="Dither", slider=True)
32                 
33 class RENDER_PT_output(RenderButtonsPanel):
34         __label__ = "Output"
35
36         def draw(self, context):
37                 scene = context.scene
38                 layout = self.layout
39
40                 rd = scene.render_data
41                 
42                 layout.itemR(rd, "output_path")
43                 
44                 split = layout.split()
45                 
46                 col = split.column()
47                 col.itemR(rd, "file_format", text="Format")
48                 if rd.file_format in ("AVIJPEG", "JPEG"):
49                         col.itemR(rd, "quality", slider=True)
50                 
51                 sub = split.column()
52                 sub.itemR(rd, "color_mode")
53                 sub.itemR(rd, "alpha_mode")
54                 
55                 split = layout.split()
56                 
57                 sub = split.column()
58                 sub.itemR(rd, "file_extensions")
59                 sub.itemL(text="Distributed Rendering:")
60                 sub.itemR(rd, "placeholders")
61                 sub.itemR(rd, "no_overwrite")
62                 
63                 col = split.column()
64                 col.itemR(rd, "fields", text="Fields")
65                 colsub = col.column()
66                 colsub.active = rd.fields
67                 colsub.itemR(rd, "fields_still", text="Still")
68                 colsub.row().itemR(rd, "field_order", expand=True)
69
70 class RENDER_PT_antialiasing(RenderButtonsPanel):
71         __label__ = "Anti-Aliasing"
72
73         def draw_header(self, context):
74                 rd = context.scene.render_data
75
76                 layout = self.layout
77                 layout.itemR(rd, "antialiasing", text="")
78
79         def draw(self, context):
80                 scene = context.scene
81                 rd = scene.render_data
82
83                 layout = self.layout
84                 layout.active = rd.antialiasing
85
86                 split = layout.split()
87                 
88                 sub = split.column()
89                 sub.itemL(text="Samples:")
90                 sub.row().itemR(rd, "antialiasing_samples", expand=True)
91                 sub.itemR(rd, "pixel_filter")
92
93                 col = split.column()
94                 col.itemR(rd, "filter_size", text="Size", slider=True)
95                 col.itemR(rd, "save_buffers")
96                 colsub = col.column()
97                 colsub.active = rd.save_buffers
98                 colsub.itemR(rd, "full_sample")
99
100 class RENDER_PT_render(RenderButtonsPanel):
101         __label__ = "Render"
102
103         def draw(self, context):
104                 scene = context.scene
105                 layout = self.layout
106
107                 rd = scene.render_data
108
109                 row = layout.row()
110                 row.itemO("SCREEN_OT_render", text="Render Still", icon=109)
111                 row.item_booleanO("SCREEN_OT_render", "anim", True, text="Render Animation", icon=111)
112                 
113                 row = layout.row()
114                 row.itemR(rd, "do_composite")
115                 row.itemR(rd, "do_sequence")
116                 rowsub = layout.row()
117                 rowsub.active = rd.do_composite
118                 rowsub.itemR(rd, "free_image_textures")
119
120                 split = layout.split()
121                 
122                 col = split.column(align=True)
123                 col.itemL(text="Threads:")
124                 col.row().itemR(rd, "threads_mode", expand=True)
125                 colsub = col.column()
126                 colsub.active = rd.threads_mode == 'THREADS_FIXED'
127                 colsub.itemR(rd, "threads")
128                 
129                 sub = split.column(align=True)
130                 sub.itemL(text="Tiles:")
131                 sub.itemR(rd, "parts_x", text="X")
132                 sub.itemR(rd, "parts_y", text="Y")
133                 
134                 split = layout.split()
135                 sub = split.column()
136                 sub = split.column()
137                 sub.itemR(rd, "panorama")
138                 
139                 #       row.itemR(rd, "backbuf")
140                         
141 class RENDER_PT_dimensions(RenderButtonsPanel):
142         __label__ = "Dimensions"
143
144         def draw(self, context):
145                 scene = context.scene
146                 layout = self.layout
147
148                 rd = scene.render_data
149                 
150                 split = layout.split()
151                 
152                 col = split.column()
153                 sub = col.column(align=True)
154                 sub.itemL(text="Resolution:")
155                 sub.itemR(rd, "resolution_x", text="X")
156                 sub.itemR(rd, "resolution_y", text="Y")
157                 sub.itemR(rd, "resolution_percentage", text="")
158                 
159                 sub.itemL(text="Aspect Ratio:")
160                 sub.itemR(rd, "pixel_aspect_x", text="X")
161                 sub.itemR(rd, "pixel_aspect_y", text="Y")
162                 
163                 col = col.column(align=False)
164                 col.itemR(rd, "border", text="Border")
165                 colsub = col.column()
166                 colsub.active = rd.border
167                 colsub.itemR(rd, "crop_to_border")
168
169                 col = split.column(align=True)
170                 col.itemL(text="Frame Range:")
171                 col.itemR(scene, "start_frame", text="Start")
172                 col.itemR(scene, "end_frame", text="End")
173                 col.itemR(scene, "frame_step", text="Step")
174                 
175                 col.itemL(text="Frame Rate:")
176                 col.itemR(rd, "fps")
177                 col.itemR(rd, "fps_base",text="/")
178
179 class RENDER_PT_stamp(RenderButtonsPanel):
180         __label__ = "Stamp"
181
182         def draw_header(self, context):
183                 rd = context.scene.render_data
184
185                 layout = self.layout
186                 layout.itemR(rd, "stamp", text="")
187
188         def draw(self, context):
189                 scene = context.scene
190                 rd = scene.render_data
191
192                 layout = self.layout
193                 layout.active = rd.stamp
194
195                 split = layout.split()
196                 
197                 col = split.column()
198                 col.itemR(rd, "stamp_time", text="Time")
199                 col.itemR(rd, "stamp_date", text="Date")
200                 col.itemR(rd, "stamp_frame", text="Frame")
201                 col.itemR(rd, "stamp_camera", text="Scene")
202                 col.itemR(rd, "stamp_marker", text="Marker")
203                 col.itemR(rd, "stamp_filename", text="Filename")
204                 col.itemR(rd, "stamp_sequence_strip", text="Seq. Strip")
205                 col.itemR(rd, "stamp_note", text="Note")
206                 colsub = col.column()
207                 colsub.active = rd.stamp_note
208                 colsub.itemR(rd, "stamp_note_text", text="")
209                 
210                 sub = split.column()
211                 sub.itemR(rd, "render_stamp")
212                 colsub = sub.column()
213                 colsub.active = rd.render_stamp
214                 colsub.itemR(rd, "stamp_foreground")
215                 colsub.itemR(rd, "stamp_background")
216                 colsub.itemR(rd, "stamp_font_size", text="Font Size")
217
218 bpy.types.register(RENDER_PT_render)
219 bpy.types.register(RENDER_PT_dimensions)
220 bpy.types.register(RENDER_PT_antialiasing)
221 bpy.types.register(RENDER_PT_shading)
222 bpy.types.register(RENDER_PT_output)
223 bpy.types.register(RENDER_PT_stamp)