1 # This software is distributable under the terms of the GNU
2 # General Public License (GPL) v2, the text of which can be found at
3 # http://www.gnu.org/copyleft/gpl.html. Installing, importing or otherwise
4 # using this module constitutes acceptance of the terms of this License.
10 class RenderButtonsPanel(bpy.types.Panel):
11 bl_space_type = 'PROPERTIES'
12 bl_region_type = 'WINDOW'
14 # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
16 def poll(self, context):
17 rd = context.scene.render_data
18 return (context.scene and rd.use_game_engine == False) and (rd.engine in self.COMPAT_ENGINES)
21 class RENDER_PT_render(RenderButtonsPanel):
23 COMPAT_ENGINES = set(['BLENDER_RENDER'])
25 def draw(self, context):
28 rd = context.scene.render_data
31 row.itemO("screen.render", text="Image", icon='ICON_RENDER_STILL')
32 row.item_booleanO("screen.render", "animation", True, text="Animation", icon='ICON_RENDER_ANIMATION')
34 layout.itemR(rd, "display_mode", text="Display")
37 class RENDER_PT_layers(RenderButtonsPanel):
39 bl_default_closed = True
40 COMPAT_ENGINES = set(['BLENDER_RENDER'])
42 def draw(self, context):
46 rd = scene.render_data
49 row.template_list(rd, "layers", rd, "active_layer_index", rows=2)
51 col = row.column(align=True)
52 col.itemO("scene.render_layer_add", icon='ICON_ZOOMIN', text="")
53 col.itemO("scene.render_layer_remove", icon='ICON_ZOOMOUT', text="")
55 rl = rd.layers[rd.active_layer_index]
58 layout.itemR(rl, "name")
60 split = layout.split()
63 col.itemR(scene, "visible_layers", text="Scene")
65 col.itemR(rl, "visible_layers", text="Layer")
67 layout.itemR(rl, "light_override", text="Light")
68 layout.itemR(rl, "material_override", text="Material")
71 layout.itemL(text="Include:")
73 split = layout.split()
76 col.itemR(rl, "zmask")
78 row.itemR(rl, "zmask_negate", text="Negate")
80 col.itemR(rl, "all_z")
83 col.itemR(rl, "solid")
85 col.itemR(rl, "ztransp")
90 col.itemR(rl, "strand")
93 split = layout.split()
94 split.itemL(text="Zmask Layers:")
95 split.column().itemR(rl, "zmask_layers", text="")
99 split = layout.split()
102 col.itemL(text="Passes:")
103 col.itemR(rl, "pass_combined")
104 col.itemR(rl, "pass_z")
105 col.itemR(rl, "pass_vector")
106 col.itemR(rl, "pass_normal")
107 col.itemR(rl, "pass_uv")
108 col.itemR(rl, "pass_mist")
109 col.itemR(rl, "pass_object_index")
113 col.itemR(rl, "pass_color")
114 col.itemR(rl, "pass_diffuse")
116 row.itemR(rl, "pass_specular")
117 row.itemR(rl, "pass_specular_exclude", text="", icon='ICON_X')
119 row.itemR(rl, "pass_shadow")
120 row.itemR(rl, "pass_shadow_exclude", text="", icon='ICON_X')
122 row.itemR(rl, "pass_ao")
123 row.itemR(rl, "pass_ao_exclude", text="", icon='ICON_X')
125 row.itemR(rl, "pass_reflection")
126 row.itemR(rl, "pass_reflection_exclude", text="", icon='ICON_X')
128 row.itemR(rl, "pass_refraction")
129 row.itemR(rl, "pass_refraction_exclude", text="", icon='ICON_X')
132 class RENDER_PT_shading(RenderButtonsPanel):
134 COMPAT_ENGINES = set(['BLENDER_RENDER'])
136 def draw(self, context):
139 rd = context.scene.render_data
141 split = layout.split()
144 col.itemR(rd, "render_textures", text="Textures")
145 col.itemR(rd, "render_shadows", text="Shadows")
146 col.itemR(rd, "render_sss", text="Subsurface Scattering")
147 col.itemR(rd, "render_envmaps", text="Environment Map")
150 col.itemR(rd, "render_raytracing", text="Ray Tracing")
151 col.itemR(rd, "color_management")
152 col.itemR(rd, "alpha_mode", text="Alpha")
155 class RENDER_PT_performance(RenderButtonsPanel):
156 bl_label = "Performance"
157 bl_default_closed = True
158 COMPAT_ENGINES = set(['BLENDER_RENDER'])
160 def draw(self, context):
163 rd = context.scene.render_data
165 split = layout.split()
167 col = split.column(align=True)
168 col.itemL(text="Threads:")
169 col.row().itemR(rd, "threads_mode", expand=True)
171 sub.enabled = rd.threads_mode == 'THREADS_FIXED'
172 sub.itemR(rd, "threads")
173 col.itemL(text="Tiles:")
174 col.itemR(rd, "parts_x", text="X")
175 col.itemR(rd, "parts_y", text="Y")
178 col.itemL(text="Memory:")
180 sub.itemR(rd, "save_buffers")
181 sub.enabled = not rd.full_sample
183 sub.active = rd.use_compositing
184 sub.itemR(rd, "free_image_textures")
186 sub.active = rd.render_raytracing
187 sub.itemL(text="Acceleration structure:")
188 sub.itemR(rd, "raytrace_structure", text="")
189 if rd.raytrace_structure == "OCTREE":
190 sub.itemR(rd, "octree_resolution", text="Resolution")
192 sub.itemR(rd, "use_instances", text="Instances")
193 sub.itemR(rd, "use_local_coords", text="Local Coordinates")
196 class RENDER_PT_post_processing(RenderButtonsPanel):
197 bl_label = "Post Processing"
198 bl_default_closed = True
199 COMPAT_ENGINES = set(['BLENDER_RENDER'])
201 def draw(self, context):
204 rd = context.scene.render_data
206 split = layout.split()
209 col.itemR(rd, "use_compositing")
210 col.itemR(rd, "use_sequencer")
213 col.itemR(rd, "dither_intensity", text="Dither", slider=True)
217 split = layout.split()
220 col.itemR(rd, "fields", text="Fields")
222 sub.active = rd.fields
223 sub.row().itemR(rd, "field_order", expand=True)
224 sub.itemR(rd, "fields_still", text="Still")
227 col.itemR(rd, "edge")
230 sub.itemR(rd, "edge_threshold", text="Threshold", slider=True)
231 sub.itemR(rd, "edge_color", text="")
234 class RENDER_PT_output(RenderButtonsPanel):
236 COMPAT_ENGINES = set(['BLENDER_RENDER'])
238 def draw(self, context):
241 rd = context.scene.render_data
243 layout.itemR(rd, "output_path", text="")
245 split = layout.split()
247 col.itemR(rd, "file_format", text="")
248 col.row().itemR(rd, "color_mode", text="Color", expand=True)
251 col.itemR(rd, "file_extensions")
252 col.itemR(rd, "use_overwrite")
253 col.itemR(rd, "use_placeholder")
255 if rd.file_format in ('AVIJPEG', 'JPEG'):
256 split = layout.split()
257 split.itemR(rd, "quality", slider=True)
259 elif rd.file_format == 'OPENEXR':
260 split = layout.split()
263 col.itemL(text="Codec:")
264 col.itemR(rd, "exr_codec", text="")
266 subsplit = split.split()
267 col = subsplit.column()
268 col.itemR(rd, "exr_half")
269 col.itemR(rd, "exr_zbuf")
270 col = subsplit.column()
271 col.itemR(rd, "exr_preview")
273 elif rd.file_format == 'JPEG2000':
274 split = layout.split()
276 col.itemL(text="Depth:")
277 col.row().itemR(rd, "jpeg2k_depth", expand=True)
280 col.itemR(rd, "jpeg2k_preset", text="")
281 col.itemR(rd, "jpeg2k_ycc")
283 elif rd.file_format in ('CINEON', 'DPX'):
284 split = layout.split()
286 col.itemR(rd, "cineon_log", text="Convert to Log")
288 col = split.column(align=True)
289 col.active = rd.cineon_log
290 col.itemR(rd, "cineon_black", text="Black")
291 col.itemR(rd, "cineon_white", text="White")
292 col.itemR(rd, "cineon_gamma", text="Gamma")
294 elif rd.file_format == 'TIFF':
295 split = layout.split()
296 split.itemR(rd, "tiff_bit")
299 class RENDER_PT_encoding(RenderButtonsPanel):
300 bl_label = "Encoding"
301 bl_default_closed = True
302 COMPAT_ENGINES = set(['BLENDER_RENDER'])
304 def poll(self, context):
305 rd = context.scene.render_data
306 return rd.file_format in ('FFMPEG', 'XVID', 'H264', 'THEORA')
308 def draw(self, context):
311 rd = context.scene.render_data
313 split = layout.split()
315 split.itemR(rd, "ffmpeg_format")
316 if rd.ffmpeg_format in ('AVI', 'QUICKTIME', 'MKV', 'OGG'):
317 split.itemR(rd, "ffmpeg_codec")
321 split = layout.split()
324 col.itemR(rd, "ffmpeg_video_bitrate")
325 col.itemL(text="Rate:")
326 col.itemR(rd, "ffmpeg_minrate", text="Minimum")
327 col.itemR(rd, "ffmpeg_maxrate", text="Maximum")
328 col.itemR(rd, "ffmpeg_buffersize", text="Buffer")
331 col.itemR(rd, "ffmpeg_gopsize")
332 col.itemR(rd, "ffmpeg_autosplit")
333 col.itemL(text="Mux:")
334 col.itemR(rd, "ffmpeg_muxrate", text="Rate")
335 col.itemR(rd, "ffmpeg_packetsize", text="Packet Size")
338 row.itemL(text="Audio:")
340 row.itemR(rd, "ffmpeg_audio_codec")
342 split = layout.split()
345 col.itemR(rd, "ffmpeg_audio_bitrate")
346 col.itemR(rd, "ffmpeg_audio_mixrate")
348 col.itemR(rd, "ffmpeg_multiplex_audio")
349 col.itemR(rd, "ffmpeg_audio_volume")
352 class RENDER_PT_antialiasing(RenderButtonsPanel):
353 bl_label = "Anti-Aliasing"
354 COMPAT_ENGINES = set(['BLENDER_RENDER'])
356 def draw_header(self, context):
357 rd = context.scene.render_data
359 self.layout.itemR(rd, "antialiasing", text="")
361 def draw(self, context):
364 rd = context.scene.render_data
366 layout.active = rd.antialiasing
368 split = layout.split()
371 col.row().itemR(rd, "antialiasing_samples", expand=True)
372 col.itemR(rd, "full_sample")
375 col.itemR(rd, "pixel_filter", text="")
376 col.itemR(rd, "filter_size", text="Size", slider=True)
379 class RENDER_PT_dimensions(RenderButtonsPanel):
380 bl_label = "Dimensions"
381 COMPAT_ENGINES = set(['BLENDER_RENDER'])
383 def draw(self, context):
386 scene = context.scene
387 rd = scene.render_data
389 split = layout.split()
392 sub = col.column(align=True)
393 sub.itemL(text="Resolution:")
394 sub.itemR(rd, "resolution_x", text="X")
395 sub.itemR(rd, "resolution_y", text="Y")
396 sub.itemR(rd, "resolution_percentage", text="")
398 sub.itemL(text="Aspect Ratio:")
399 sub.itemR(rd, "pixel_aspect_x", text="X")
400 sub.itemR(rd, "pixel_aspect_y", text="Y")
403 row.itemR(rd, "use_border", text="Border")
405 rowsub.active = rd.use_border
406 rowsub.itemR(rd, "crop_to_border", text="Crop")
408 col = split.column(align=True)
409 col.itemL(text="Frame Range:")
410 col.itemR(scene, "start_frame", text="Start")
411 col.itemR(scene, "end_frame", text="End")
412 col.itemR(scene, "frame_step", text="Step")
414 col.itemL(text="Frame Rate:")
416 col.itemR(rd, "fps_base", text="/")
419 class RENDER_PT_stamp(RenderButtonsPanel):
421 bl_default_closed = True
422 COMPAT_ENGINES = set(['BLENDER_RENDER'])
424 def draw_header(self, context):
425 rd = context.scene.render_data
427 self.layout.itemR(rd, "render_stamp", text="")
429 def draw(self, context):
432 rd = context.scene.render_data
434 layout.active = rd.render_stamp
436 split = layout.split()
439 col.itemR(rd, "stamp_time", text="Time")
440 col.itemR(rd, "stamp_date", text="Date")
441 col.itemR(rd, "stamp_render_time", text="RenderTime")
442 col.itemR(rd, "stamp_frame", text="Frame")
443 col.itemR(rd, "stamp_scene", text="Scene")
444 col.itemR(rd, "stamp_camera", text="Camera")
445 col.itemR(rd, "stamp_filename", text="Filename")
446 col.itemR(rd, "stamp_marker", text="Marker")
447 col.itemR(rd, "stamp_sequence_strip", text="Seq. Strip")
450 col.active = rd.render_stamp
451 col.itemR(rd, "stamp_foreground", slider=True)
452 col.itemR(rd, "stamp_background", slider=True)
453 col.itemR(rd, "stamp_font_size", text="Font Size")
455 row = layout.split(percentage=0.2)
456 row.itemR(rd, "stamp_note", text="Note")
458 sub.active = rd.stamp_note
459 sub.itemR(rd, "stamp_note_text", text="")
461 bpy.types.register(RENDER_PT_render)
462 bpy.types.register(RENDER_PT_layers)
463 bpy.types.register(RENDER_PT_dimensions)
464 bpy.types.register(RENDER_PT_antialiasing)
465 bpy.types.register(RENDER_PT_shading)
466 bpy.types.register(RENDER_PT_output)
467 bpy.types.register(RENDER_PT_encoding)
468 bpy.types.register(RENDER_PT_performance)
469 bpy.types.register(RENDER_PT_post_processing)
470 bpy.types.register(RENDER_PT_stamp)