2.5 Scene 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_extensions")                
48                 col.itemR(rd, "fields", text="Fields")
49                 colsub = col.column()
50                 colsub.active = rd.fields
51                 colsub.itemR(rd, "fields_still", text="Still")
52                 colsub.row().itemR(rd, "field_order", expand=True)
53                 
54                 col = split.column()
55                 col.itemR(rd, "color_mode")
56                 col.itemR(rd, "alpha_mode")
57                 col.itemL(text="Distributed Rendering:")
58                 col.itemR(rd, "placeholders")
59                 col.itemR(rd, "no_overwrite")
60                 
61                 
62                 layout.itemR(rd, "file_format", text="Format")
63                 
64                 split = layout.split()
65                 
66                 col = split.column()
67                 
68                 if rd.file_format in ("AVIJPEG", "JPEG"):
69                         col.itemR(rd, "quality", slider=True)
70                         
71                 elif rd.file_format in ("OPENEXR"):
72                         col.itemR(rd, "exr_codec")
73                         col.itemR(rd, "exr_half")
74                         col = split.column()
75                         col.itemR(rd, "exr_zbuf")
76                         col.itemR(rd, "exr_preview")
77                 
78                 elif rd.file_format in ("JPEG2000"):
79                         row = layout.row()
80                         row.itemR(rd, "jpeg_preset")
81                         split = layout.split()
82                         col = split.column()
83                         col.itemL(text="Depth:")
84                         col.row().itemR(rd, "jpeg_depth", expand=True)
85                         col = split.column()
86                         col.itemR(rd, "jpeg_ycc")
87                         col.itemR(rd, "exr_preview")
88                         
89                 elif rd.file_format in ("CINEON", "DPX"):
90                         col.itemR(rd, "cineon_log", text="Convert to Log")
91                         colsub = col.column()
92                         colsub.active = rd.cineon_log
93                         colsub.itemR(rd, "cineon_black", text="Black")
94                         colsub.itemR(rd, "cineon_white", text="White")
95                         colsub.itemR(rd, "cineon_gamma", text="Gamma")
96                         
97                 elif rd.file_format in ("TIFF"):
98                         col.itemR(rd, "tiff_bit")
99                 
100                 elif rd.file_format in ("FFMPEG"):
101                         #row = layout.row()
102                         #row.itemR(rd, "ffmpeg_format")
103                         #row.itemR(rd, "ffmpeg_codec")
104                         split = layout.split()
105                 
106                         col = split.column()
107                         col.itemR(rd, "ffmpeg_video_bitrate")
108                         col.itemL(text="Rate:")
109                         col.itemR(rd, "ffmpeg_minrate", text="Minimum")
110                         col.itemR(rd, "ffmpeg_maxrate", text="Maximum")
111                         col.itemR(rd, "ffmpeg_buffersize", text="Buffer")
112                         
113                         col = split.column()
114                         col.itemR(rd, "ffmpeg_gopsize")
115                         col.itemR(rd, "ffmpeg_autosplit")
116                         col.itemL(text="Mux:")
117                         col.itemR(rd, "ffmpeg_muxrate", text="Rate")
118                         col.itemR(rd, "ffmpeg_packetsize", text="Packet Size")
119                         
120                         row = layout.row()
121                         row.itemL(text="Audio:")
122                         row = layout.row()
123                         #row.itemR(rd, "ffmpeg_audio_codec")
124                         
125                         split = layout.split()
126         
127                         col = split.column()
128                         col.itemR(rd, "ffmpeg_audio_bitrate")
129                         col = split.column()
130                         col.itemR(rd, "ffmpeg_multiplex_audio")
131
132 class RENDER_PT_antialiasing(RenderButtonsPanel):
133         __label__ = "Anti-Aliasing"
134
135         def draw_header(self, context):
136                 rd = context.scene.render_data
137
138                 layout = self.layout
139                 layout.itemR(rd, "antialiasing", text="")
140
141         def draw(self, context):
142                 scene = context.scene
143                 rd = scene.render_data
144
145                 layout = self.layout
146                 layout.active = rd.antialiasing
147
148                 split = layout.split()
149                 
150                 sub = split.column()
151                 sub.itemL(text="Samples:")
152                 sub.row().itemR(rd, "antialiasing_samples", expand=True)
153                 sub.itemR(rd, "pixel_filter")
154
155                 col = split.column()
156                 col.itemR(rd, "filter_size", text="Size", slider=True)
157                 col.itemR(rd, "save_buffers")
158                 colsub = col.column()
159                 colsub.active = rd.save_buffers
160                 colsub.itemR(rd, "full_sample")
161
162 class RENDER_PT_render(RenderButtonsPanel):
163         __label__ = "Render"
164
165         def draw(self, context):
166                 scene = context.scene
167                 layout = self.layout
168
169                 rd = scene.render_data
170
171                 row = layout.row()
172                 row.itemO("SCREEN_OT_render", text="Render Still", icon=109)
173                 row.item_booleanO("SCREEN_OT_render", "anim", True, text="Render Animation", icon=111)
174                 
175                 row = layout.row()
176                 row.itemR(rd, "do_composite")
177                 row.itemR(rd, "do_sequence")
178                 rowsub = layout.row()
179                 rowsub.active = rd.do_composite
180                 rowsub.itemR(rd, "free_image_textures")
181
182                 split = layout.split()
183                 
184                 col = split.column(align=True)
185                 col.itemL(text="Threads:")
186                 col.row().itemR(rd, "threads_mode", expand=True)
187                 colsub = col.column()
188                 colsub.active = rd.threads_mode == 'THREADS_FIXED'
189                 colsub.itemR(rd, "threads")
190                 
191                 sub = split.column(align=True)
192                 sub.itemL(text="Tiles:")
193                 sub.itemR(rd, "parts_x", text="X")
194                 sub.itemR(rd, "parts_y", text="Y")
195                 
196                 split = layout.split()
197                 sub = split.column()
198                 sub = split.column()
199                 sub.itemR(rd, "panorama")
200                 
201                 #       row.itemR(rd, "backbuf")
202                         
203 class RENDER_PT_dimensions(RenderButtonsPanel):
204         __label__ = "Dimensions"
205
206         def draw(self, context):
207                 scene = context.scene
208                 layout = self.layout
209
210                 rd = scene.render_data
211                 
212                 split = layout.split()
213                 
214                 col = split.column()
215                 sub = col.column(align=True)
216                 sub.itemL(text="Resolution:")
217                 sub.itemR(rd, "resolution_x", text="X")
218                 sub.itemR(rd, "resolution_y", text="Y")
219                 sub.itemR(rd, "resolution_percentage", text="")
220                 
221                 sub.itemL(text="Aspect Ratio:")
222                 sub.itemR(rd, "pixel_aspect_x", text="X")
223                 sub.itemR(rd, "pixel_aspect_y", text="Y")
224                 
225                 col = col.column(align=False)
226                 col.itemR(rd, "border", text="Border")
227                 colsub = col.column()
228                 colsub.active = rd.border
229                 colsub.itemR(rd, "crop_to_border")
230
231                 col = split.column(align=True)
232                 col.itemL(text="Frame Range:")
233                 col.itemR(scene, "start_frame", text="Start")
234                 col.itemR(scene, "end_frame", text="End")
235                 col.itemR(scene, "frame_step", text="Step")
236                 
237                 col.itemL(text="Frame Rate:")
238                 col.itemR(rd, "fps")
239                 col.itemR(rd, "fps_base",text="/")
240
241 class RENDER_PT_stamp(RenderButtonsPanel):
242         __label__ = "Stamp"
243
244         def draw_header(self, context):
245                 rd = context.scene.render_data
246
247                 layout = self.layout
248                 layout.itemR(rd, "stamp", text="")
249
250         def draw(self, context):
251                 scene = context.scene
252                 rd = scene.render_data
253
254                 layout = self.layout
255                 layout.active = rd.stamp
256
257                 split = layout.split()
258                 
259                 col = split.column()
260                 col.itemR(rd, "stamp_time", text="Time")
261                 col.itemR(rd, "stamp_date", text="Date")
262                 col.itemR(rd, "stamp_frame", text="Frame")
263                 col.itemR(rd, "stamp_camera", text="Scene")
264                 col.itemR(rd, "stamp_marker", text="Marker")
265                 col.itemR(rd, "stamp_filename", text="Filename")
266                 col.itemR(rd, "stamp_sequence_strip", text="Seq. Strip")
267                 col.itemR(rd, "stamp_note", text="Note")
268                 colsub = col.column()
269                 colsub.active = rd.stamp_note
270                 colsub.itemR(rd, "stamp_note_text", text="")
271                 
272                 sub = split.column()
273                 sub.itemR(rd, "render_stamp")
274                 colsub = sub.column()
275                 colsub.active = rd.render_stamp
276                 colsub.itemR(rd, "stamp_foreground", slider=True)
277                 colsub.itemR(rd, "stamp_background", slider=True)
278                 colsub.itemR(rd, "stamp_font_size", text="Font Size")
279
280 bpy.types.register(RENDER_PT_render)
281 bpy.types.register(RENDER_PT_dimensions)
282 bpy.types.register(RENDER_PT_antialiasing)
283 bpy.types.register(RENDER_PT_shading)
284 bpy.types.register(RENDER_PT_output)
285 bpy.types.register(RENDER_PT_stamp)