1 # ##### BEGIN GPL LICENSE BLOCK #####
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 # ##### END GPL LICENSE BLOCK #####
23 class RenderButtonsPanel(bpy.types.Panel):
24 bl_space_type = 'PROPERTIES'
25 bl_region_type = 'WINDOW'
27 # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
29 def poll(self, context):
30 rd = context.scene.render_data
31 return (context.scene and rd.use_game_engine == False) and (rd.engine in self.COMPAT_ENGINES)
34 class RENDER_PT_render(RenderButtonsPanel):
36 COMPAT_ENGINES = set(['BLENDER_RENDER'])
38 def draw(self, context):
41 rd = context.scene.render_data
44 row.itemO("screen.render", text="Image", icon='ICON_RENDER_STILL')
45 row.item_booleanO("screen.render", "animation", True, text="Animation", icon='ICON_RENDER_ANIMATION')
47 layout.itemR(rd, "display_mode", text="Display")
50 class RENDER_PT_layers(RenderButtonsPanel):
52 bl_default_closed = True
53 COMPAT_ENGINES = set(['BLENDER_RENDER'])
55 def draw(self, context):
59 rd = scene.render_data
62 row.template_list(rd, "layers", rd, "active_layer_index", rows=2)
64 col = row.column(align=True)
65 col.itemO("scene.render_layer_add", icon='ICON_ZOOMIN', text="")
66 col.itemO("scene.render_layer_remove", icon='ICON_ZOOMOUT', text="")
68 rl = rd.layers[rd.active_layer_index]
71 layout.itemR(rl, "name")
73 split = layout.split()
76 col.itemR(scene, "visible_layers", text="Scene")
78 col.itemR(rl, "visible_layers", text="Layer")
80 layout.itemR(rl, "light_override", text="Light")
81 layout.itemR(rl, "material_override", text="Material")
84 layout.itemL(text="Include:")
86 split = layout.split()
89 col.itemR(rl, "zmask")
91 row.itemR(rl, "zmask_negate", text="Negate")
93 col.itemR(rl, "all_z")
96 col.itemR(rl, "solid")
98 col.itemR(rl, "ztransp")
102 col.itemR(rl, "edge")
103 col.itemR(rl, "strand")
106 split = layout.split()
107 split.itemL(text="Zmask Layers:")
108 split.column().itemR(rl, "zmask_layers", text="")
112 split = layout.split()
115 col.itemL(text="Passes:")
116 col.itemR(rl, "pass_combined")
117 col.itemR(rl, "pass_z")
118 col.itemR(rl, "pass_vector")
119 col.itemR(rl, "pass_normal")
120 col.itemR(rl, "pass_uv")
121 col.itemR(rl, "pass_mist")
122 col.itemR(rl, "pass_object_index")
126 col.itemR(rl, "pass_color")
127 col.itemR(rl, "pass_diffuse")
129 row.itemR(rl, "pass_specular")
130 row.itemR(rl, "pass_specular_exclude", text="", icon='ICON_X')
132 row.itemR(rl, "pass_shadow")
133 row.itemR(rl, "pass_shadow_exclude", text="", icon='ICON_X')
135 row.itemR(rl, "pass_ao")
136 row.itemR(rl, "pass_ao_exclude", text="", icon='ICON_X')
138 row.itemR(rl, "pass_reflection")
139 row.itemR(rl, "pass_reflection_exclude", text="", icon='ICON_X')
141 row.itemR(rl, "pass_refraction")
142 row.itemR(rl, "pass_refraction_exclude", text="", icon='ICON_X')
145 class RENDER_PT_shading(RenderButtonsPanel):
147 COMPAT_ENGINES = set(['BLENDER_RENDER'])
149 def draw(self, context):
152 rd = context.scene.render_data
154 split = layout.split()
157 col.itemR(rd, "render_textures", text="Textures")
158 col.itemR(rd, "render_shadows", text="Shadows")
159 col.itemR(rd, "render_sss", text="Subsurface Scattering")
160 col.itemR(rd, "render_envmaps", text="Environment Map")
163 col.itemR(rd, "render_raytracing", text="Ray Tracing")
164 col.itemR(rd, "color_management")
165 col.itemR(rd, "alpha_mode", text="Alpha")
168 class RENDER_PT_performance(RenderButtonsPanel):
169 bl_label = "Performance"
170 bl_default_closed = True
171 COMPAT_ENGINES = set(['BLENDER_RENDER'])
173 def draw(self, context):
176 rd = context.scene.render_data
178 split = layout.split()
180 col = split.column(align=True)
181 col.itemL(text="Threads:")
182 col.row().itemR(rd, "threads_mode", expand=True)
184 sub.enabled = rd.threads_mode == 'THREADS_FIXED'
185 sub.itemR(rd, "threads")
186 col.itemL(text="Tiles:")
187 col.itemR(rd, "parts_x", text="X")
188 col.itemR(rd, "parts_y", text="Y")
191 col.itemL(text="Memory:")
193 sub.itemR(rd, "save_buffers")
194 sub.enabled = not rd.full_sample
196 sub.active = rd.use_compositing
197 sub.itemR(rd, "free_image_textures")
199 sub.active = rd.render_raytracing
200 sub.itemL(text="Acceleration structure:")
201 sub.itemR(rd, "raytrace_structure", text="")
202 if rd.raytrace_structure == "OCTREE":
203 sub.itemR(rd, "octree_resolution", text="Resolution")
205 sub.itemR(rd, "use_instances", text="Instances")
206 sub.itemR(rd, "use_local_coords", text="Local Coordinates")
209 class RENDER_PT_post_processing(RenderButtonsPanel):
210 bl_label = "Post Processing"
211 bl_default_closed = True
212 COMPAT_ENGINES = set(['BLENDER_RENDER'])
214 def draw(self, context):
217 rd = context.scene.render_data
219 split = layout.split()
222 col.itemR(rd, "use_compositing")
223 col.itemR(rd, "use_sequencer")
226 col.itemR(rd, "dither_intensity", text="Dither", slider=True)
230 split = layout.split()
233 col.itemR(rd, "fields", text="Fields")
235 sub.active = rd.fields
236 sub.row().itemR(rd, "field_order", expand=True)
237 sub.itemR(rd, "fields_still", text="Still")
240 col.itemR(rd, "edge")
243 sub.itemR(rd, "edge_threshold", text="Threshold", slider=True)
244 sub.itemR(rd, "edge_color", text="")
247 class RENDER_PT_output(RenderButtonsPanel):
249 COMPAT_ENGINES = set(['BLENDER_RENDER'])
251 def draw(self, context):
254 rd = context.scene.render_data
256 layout.itemR(rd, "output_path", text="")
258 split = layout.split()
260 col.itemR(rd, "file_format", text="")
261 col.row().itemR(rd, "color_mode", text="Color", expand=True)
264 col.itemR(rd, "file_extensions")
265 col.itemR(rd, "use_overwrite")
266 col.itemR(rd, "use_placeholder")
268 if rd.file_format in ('AVIJPEG', 'JPEG'):
269 split = layout.split()
270 split.itemR(rd, "quality", slider=True)
272 elif rd.file_format == 'OPENEXR':
273 split = layout.split()
276 col.itemL(text="Codec:")
277 col.itemR(rd, "exr_codec", text="")
279 subsplit = split.split()
280 col = subsplit.column()
281 col.itemR(rd, "exr_half")
282 col.itemR(rd, "exr_zbuf")
283 col = subsplit.column()
284 col.itemR(rd, "exr_preview")
286 elif rd.file_format == 'JPEG2000':
287 split = layout.split()
289 col.itemL(text="Depth:")
290 col.row().itemR(rd, "jpeg2k_depth", expand=True)
293 col.itemR(rd, "jpeg2k_preset", text="")
294 col.itemR(rd, "jpeg2k_ycc")
296 elif rd.file_format in ('CINEON', 'DPX'):
297 split = layout.split()
299 col.itemR(rd, "cineon_log", text="Convert to Log")
301 col = split.column(align=True)
302 col.active = rd.cineon_log
303 col.itemR(rd, "cineon_black", text="Black")
304 col.itemR(rd, "cineon_white", text="White")
305 col.itemR(rd, "cineon_gamma", text="Gamma")
307 elif rd.file_format == 'TIFF':
308 split = layout.split()
309 split.itemR(rd, "tiff_bit")
312 class RENDER_PT_encoding(RenderButtonsPanel):
313 bl_label = "Encoding"
314 bl_default_closed = True
315 COMPAT_ENGINES = set(['BLENDER_RENDER'])
317 def poll(self, context):
318 rd = context.scene.render_data
319 return rd.file_format in ('FFMPEG', 'XVID', 'H264', 'THEORA')
321 def draw(self, context):
324 rd = context.scene.render_data
326 split = layout.split()
328 split.itemR(rd, "ffmpeg_format")
329 if rd.ffmpeg_format in ('AVI', 'QUICKTIME', 'MKV', 'OGG'):
330 split.itemR(rd, "ffmpeg_codec")
334 split = layout.split()
337 col.itemR(rd, "ffmpeg_video_bitrate")
338 col.itemL(text="Rate:")
339 col.itemR(rd, "ffmpeg_minrate", text="Minimum")
340 col.itemR(rd, "ffmpeg_maxrate", text="Maximum")
341 col.itemR(rd, "ffmpeg_buffersize", text="Buffer")
344 col.itemR(rd, "ffmpeg_gopsize")
345 col.itemR(rd, "ffmpeg_autosplit")
346 col.itemL(text="Mux:")
347 col.itemR(rd, "ffmpeg_muxrate", text="Rate")
348 col.itemR(rd, "ffmpeg_packetsize", text="Packet Size")
351 row.itemL(text="Audio:")
353 row.itemR(rd, "ffmpeg_audio_codec")
355 split = layout.split()
358 col.itemR(rd, "ffmpeg_audio_bitrate")
359 col.itemR(rd, "ffmpeg_audio_mixrate")
361 col.itemR(rd, "ffmpeg_multiplex_audio")
362 col.itemR(rd, "ffmpeg_audio_volume")
365 class RENDER_PT_antialiasing(RenderButtonsPanel):
366 bl_label = "Anti-Aliasing"
367 COMPAT_ENGINES = set(['BLENDER_RENDER'])
369 def draw_header(self, context):
370 rd = context.scene.render_data
372 self.layout.itemR(rd, "antialiasing", text="")
374 def draw(self, context):
377 rd = context.scene.render_data
379 layout.active = rd.antialiasing
381 split = layout.split()
384 col.row().itemR(rd, "antialiasing_samples", expand=True)
385 col.itemR(rd, "full_sample")
388 col.itemR(rd, "pixel_filter", text="")
389 col.itemR(rd, "filter_size", text="Size", slider=True)
392 class RENDER_PT_dimensions(RenderButtonsPanel):
393 bl_label = "Dimensions"
394 COMPAT_ENGINES = set(['BLENDER_RENDER'])
396 def draw(self, context):
399 scene = context.scene
400 rd = scene.render_data
402 split = layout.split()
405 sub = col.column(align=True)
406 sub.itemL(text="Resolution:")
407 sub.itemR(rd, "resolution_x", text="X")
408 sub.itemR(rd, "resolution_y", text="Y")
409 sub.itemR(rd, "resolution_percentage", text="")
411 sub.itemL(text="Aspect Ratio:")
412 sub.itemR(rd, "pixel_aspect_x", text="X")
413 sub.itemR(rd, "pixel_aspect_y", text="Y")
416 row.itemR(rd, "use_border", text="Border")
418 rowsub.active = rd.use_border
419 rowsub.itemR(rd, "crop_to_border", text="Crop")
421 col = split.column(align=True)
422 col.itemL(text="Frame Range:")
423 col.itemR(scene, "start_frame", text="Start")
424 col.itemR(scene, "end_frame", text="End")
425 col.itemR(scene, "frame_step", text="Step")
427 col.itemL(text="Frame Rate:")
429 col.itemR(rd, "fps_base", text="/")
432 class RENDER_PT_stamp(RenderButtonsPanel):
434 bl_default_closed = True
435 COMPAT_ENGINES = set(['BLENDER_RENDER'])
437 def draw_header(self, context):
438 rd = context.scene.render_data
440 self.layout.itemR(rd, "render_stamp", text="")
442 def draw(self, context):
445 rd = context.scene.render_data
447 layout.active = rd.render_stamp
449 split = layout.split()
452 col.itemR(rd, "stamp_time", text="Time")
453 col.itemR(rd, "stamp_date", text="Date")
454 col.itemR(rd, "stamp_render_time", text="RenderTime")
455 col.itemR(rd, "stamp_frame", text="Frame")
456 col.itemR(rd, "stamp_scene", text="Scene")
457 col.itemR(rd, "stamp_camera", text="Camera")
458 col.itemR(rd, "stamp_filename", text="Filename")
459 col.itemR(rd, "stamp_marker", text="Marker")
460 col.itemR(rd, "stamp_sequence_strip", text="Seq. Strip")
463 col.active = rd.render_stamp
464 col.itemR(rd, "stamp_foreground", slider=True)
465 col.itemR(rd, "stamp_background", slider=True)
466 col.itemR(rd, "stamp_font_size", text="Font Size")
468 row = layout.split(percentage=0.2)
469 row.itemR(rd, "stamp_note", text="Note")
471 sub.active = rd.stamp_note
472 sub.itemR(rd, "stamp_note_text", text="")
474 bpy.types.register(RENDER_PT_render)
475 bpy.types.register(RENDER_PT_layers)
476 bpy.types.register(RENDER_PT_dimensions)
477 bpy.types.register(RENDER_PT_antialiasing)
478 bpy.types.register(RENDER_PT_shading)
479 bpy.types.register(RENDER_PT_output)
480 bpy.types.register(RENDER_PT_encoding)
481 bpy.types.register(RENDER_PT_performance)
482 bpy.types.register(RENDER_PT_post_processing)
483 bpy.types.register(RENDER_PT_stamp)