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")
104 col.itemR(rl, "freestyle")
107 split = layout.split()
108 split.itemL(text="Zmask Layers:")
109 split.column().itemR(rl, "zmask_layers", text="")
113 split = layout.split()
116 col.itemL(text="Passes:")
117 col.itemR(rl, "pass_combined")
118 col.itemR(rl, "pass_z")
119 col.itemR(rl, "pass_vector")
120 col.itemR(rl, "pass_normal")
121 col.itemR(rl, "pass_uv")
122 col.itemR(rl, "pass_mist")
123 col.itemR(rl, "pass_object_index")
127 col.itemR(rl, "pass_color")
128 col.itemR(rl, "pass_diffuse")
130 row.itemR(rl, "pass_specular")
131 row.itemR(rl, "pass_specular_exclude", text="", icon='ICON_X')
133 row.itemR(rl, "pass_shadow")
134 row.itemR(rl, "pass_shadow_exclude", text="", icon='ICON_X')
136 row.itemR(rl, "pass_ao")
137 row.itemR(rl, "pass_ao_exclude", text="", icon='ICON_X')
139 row.itemR(rl, "pass_reflection")
140 row.itemR(rl, "pass_reflection_exclude", text="", icon='ICON_X')
142 row.itemR(rl, "pass_refraction")
143 row.itemR(rl, "pass_refraction_exclude", text="", icon='ICON_X')
148 split = layout.split()
151 col.itemL(text="Freestyle:")
152 freestyle = rl.freestyle_settings
153 col.itemR(freestyle, "sphere_radius", text="Sphere Radius")
154 col.itemR(freestyle, "ridges_and_valleys", text="Ridges and Valleys")
155 col.itemR(freestyle, "suggestive_contours", text="Suggestive Contours")
156 col.itemR(freestyle, "dkr_epsilon", text="Dkr Epsilon")
158 col.itemO("scene.freestyle_module_add", text="Add Style Module")
160 for i, module in enumerate(freestyle.modules):
162 box.set_context_pointer("freestyle_module", module)
163 row = box.row(align=True)
164 row.itemR(module, "is_displayed", text="")
165 row.itemR(module, "module_path", text="")
166 row.itemO("scene.freestyle_module_remove", icon='ICON_X', text="")
167 props = row.itemO("scene.freestyle_module_move_up", icon='VICON_MOVE_UP', text="", properties=True)
168 props.active = (i > 0)
169 props = row.itemO("scene.freestyle_module_move_down", icon='VICON_MOVE_DOWN', text="", properties=True)
170 props.active = (i < len(freestyle.modules) - 1)
173 class RENDER_PT_shading(RenderButtonsPanel):
175 COMPAT_ENGINES = set(['BLENDER_RENDER'])
177 def draw(self, context):
180 rd = context.scene.render_data
182 split = layout.split()
185 col.itemR(rd, "render_textures", text="Textures")
186 col.itemR(rd, "render_shadows", text="Shadows")
187 col.itemR(rd, "render_sss", text="Subsurface Scattering")
188 col.itemR(rd, "render_envmaps", text="Environment Map")
191 col.itemR(rd, "render_raytracing", text="Ray Tracing")
192 col.itemR(rd, "color_management")
193 col.itemR(rd, "alpha_mode", text="Alpha")
196 class RENDER_PT_performance(RenderButtonsPanel):
197 bl_label = "Performance"
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()
208 col = split.column(align=True)
209 col.itemL(text="Threads:")
210 col.row().itemR(rd, "threads_mode", expand=True)
212 sub.enabled = rd.threads_mode == 'THREADS_FIXED'
213 sub.itemR(rd, "threads")
214 col.itemL(text="Tiles:")
215 col.itemR(rd, "parts_x", text="X")
216 col.itemR(rd, "parts_y", text="Y")
219 col.itemL(text="Memory:")
221 sub.itemR(rd, "save_buffers")
222 sub.enabled = not rd.full_sample
224 sub.active = rd.use_compositing
225 sub.itemR(rd, "free_image_textures")
227 sub.active = rd.render_raytracing
228 sub.itemL(text="Acceleration structure:")
229 sub.itemR(rd, "raytrace_structure", text="")
230 if rd.raytrace_structure == 'OCTREE':
231 sub.itemR(rd, "octree_resolution", text="Resolution")
233 sub.itemR(rd, "use_instances", text="Instances")
234 sub.itemR(rd, "use_local_coords", text="Local Coordinates")
237 class RENDER_PT_post_processing(RenderButtonsPanel):
238 bl_label = "Post Processing"
239 bl_default_closed = True
240 COMPAT_ENGINES = set(['BLENDER_RENDER'])
242 def draw(self, context):
245 rd = context.scene.render_data
247 split = layout.split()
250 col.itemR(rd, "use_compositing")
251 col.itemR(rd, "use_sequencer")
254 col.itemR(rd, "dither_intensity", text="Dither", slider=True)
258 split = layout.split()
261 col.itemR(rd, "fields", text="Fields")
263 sub.active = rd.fields
264 sub.row().itemR(rd, "field_order", expand=True)
265 sub.itemR(rd, "fields_still", text="Still")
268 col.itemR(rd, "edge")
271 sub.itemR(rd, "edge_threshold", text="Threshold", slider=True)
272 sub.itemR(rd, "edge_color", text="")
276 split = layout.split()
278 col.itemR(rd, "freestyle", text="Freestyle")
281 class RENDER_PT_output(RenderButtonsPanel):
283 COMPAT_ENGINES = set(['BLENDER_RENDER'])
285 def draw(self, context):
288 rd = context.scene.render_data
290 layout.itemR(rd, "output_path", text="")
292 split = layout.split()
294 col.itemR(rd, "file_format", text="")
295 col.row().itemR(rd, "color_mode", text="Color", expand=True)
298 col.itemR(rd, "file_extensions")
299 col.itemR(rd, "use_overwrite")
300 col.itemR(rd, "use_placeholder")
302 if rd.file_format in ('AVIJPEG', 'JPEG'):
303 split = layout.split()
304 split.itemR(rd, "quality", slider=True)
306 elif rd.file_format == 'OPENEXR':
307 split = layout.split()
310 col.itemL(text="Codec:")
311 col.itemR(rd, "exr_codec", text="")
313 subsplit = split.split()
314 col = subsplit.column()
315 col.itemR(rd, "exr_half")
316 col.itemR(rd, "exr_zbuf")
317 col = subsplit.column()
318 col.itemR(rd, "exr_preview")
320 elif rd.file_format == 'JPEG2000':
321 split = layout.split()
323 col.itemL(text="Depth:")
324 col.row().itemR(rd, "jpeg2k_depth", expand=True)
327 col.itemR(rd, "jpeg2k_preset", text="")
328 col.itemR(rd, "jpeg2k_ycc")
330 elif rd.file_format in ('CINEON', 'DPX'):
331 split = layout.split()
333 col.itemR(rd, "cineon_log", text="Convert to Log")
335 col = split.column(align=True)
336 col.active = rd.cineon_log
337 col.itemR(rd, "cineon_black", text="Black")
338 col.itemR(rd, "cineon_white", text="White")
339 col.itemR(rd, "cineon_gamma", text="Gamma")
341 elif rd.file_format == 'TIFF':
342 split = layout.split()
343 split.itemR(rd, "tiff_bit")
346 class RENDER_PT_encoding(RenderButtonsPanel):
347 bl_label = "Encoding"
348 bl_default_closed = True
349 COMPAT_ENGINES = set(['BLENDER_RENDER'])
351 def poll(self, context):
352 rd = context.scene.render_data
353 return rd.file_format in ('FFMPEG', 'XVID', 'H264', 'THEORA')
355 def draw(self, context):
358 rd = context.scene.render_data
360 split = layout.split()
362 split.itemR(rd, "ffmpeg_format")
363 if rd.ffmpeg_format in ('AVI', 'QUICKTIME', 'MKV', 'OGG'):
364 split.itemR(rd, "ffmpeg_codec")
368 split = layout.split()
371 col.itemR(rd, "ffmpeg_video_bitrate")
372 col.itemL(text="Rate:")
373 col.itemR(rd, "ffmpeg_minrate", text="Minimum")
374 col.itemR(rd, "ffmpeg_maxrate", text="Maximum")
375 col.itemR(rd, "ffmpeg_buffersize", text="Buffer")
378 col.itemR(rd, "ffmpeg_gopsize")
379 col.itemR(rd, "ffmpeg_autosplit")
380 col.itemL(text="Mux:")
381 col.itemR(rd, "ffmpeg_muxrate", text="Rate")
382 col.itemR(rd, "ffmpeg_packetsize", text="Packet Size")
385 row.itemL(text="Audio:")
387 row.itemR(rd, "ffmpeg_audio_codec")
389 split = layout.split()
392 col.itemR(rd, "ffmpeg_audio_bitrate")
393 col.itemR(rd, "ffmpeg_audio_mixrate")
395 col.itemR(rd, "ffmpeg_multiplex_audio")
396 col.itemR(rd, "ffmpeg_audio_volume")
399 class RENDER_PT_antialiasing(RenderButtonsPanel):
400 bl_label = "Anti-Aliasing"
401 COMPAT_ENGINES = set(['BLENDER_RENDER'])
403 def draw_header(self, context):
404 rd = context.scene.render_data
406 self.layout.itemR(rd, "antialiasing", text="")
408 def draw(self, context):
411 rd = context.scene.render_data
413 layout.active = rd.antialiasing
415 split = layout.split()
418 col.row().itemR(rd, "antialiasing_samples", expand=True)
419 col.itemR(rd, "full_sample")
422 col.itemR(rd, "pixel_filter", text="")
423 col.itemR(rd, "filter_size", text="Size", slider=True)
426 class RENDER_PT_dimensions(RenderButtonsPanel):
427 bl_label = "Dimensions"
428 COMPAT_ENGINES = set(['BLENDER_RENDER'])
430 def draw(self, context):
433 scene = context.scene
434 rd = scene.render_data
436 split = layout.split()
439 sub = col.column(align=True)
440 sub.itemL(text="Resolution:")
441 sub.itemR(rd, "resolution_x", text="X")
442 sub.itemR(rd, "resolution_y", text="Y")
443 sub.itemR(rd, "resolution_percentage", text="")
445 sub.itemL(text="Aspect Ratio:")
446 sub.itemR(rd, "pixel_aspect_x", text="X")
447 sub.itemR(rd, "pixel_aspect_y", text="Y")
450 row.itemR(rd, "use_border", text="Border")
452 rowsub.active = rd.use_border
453 rowsub.itemR(rd, "crop_to_border", text="Crop")
455 col = split.column(align=True)
456 col.itemL(text="Frame Range:")
457 col.itemR(scene, "start_frame", text="Start")
458 col.itemR(scene, "end_frame", text="End")
459 col.itemR(scene, "frame_step", text="Step")
461 col.itemL(text="Frame Rate:")
463 col.itemR(rd, "fps_base", text="/")
466 class RENDER_PT_stamp(RenderButtonsPanel):
468 bl_default_closed = True
469 COMPAT_ENGINES = set(['BLENDER_RENDER'])
471 def draw_header(self, context):
472 rd = context.scene.render_data
474 self.layout.itemR(rd, "render_stamp", text="")
476 def draw(self, context):
479 rd = context.scene.render_data
481 layout.active = rd.render_stamp
483 split = layout.split()
486 col.itemR(rd, "stamp_time", text="Time")
487 col.itemR(rd, "stamp_date", text="Date")
488 col.itemR(rd, "stamp_render_time", text="RenderTime")
489 col.itemR(rd, "stamp_frame", text="Frame")
490 col.itemR(rd, "stamp_scene", text="Scene")
491 col.itemR(rd, "stamp_camera", text="Camera")
492 col.itemR(rd, "stamp_filename", text="Filename")
493 col.itemR(rd, "stamp_marker", text="Marker")
494 col.itemR(rd, "stamp_sequence_strip", text="Seq. Strip")
497 col.active = rd.render_stamp
498 col.itemR(rd, "stamp_foreground", slider=True)
499 col.itemR(rd, "stamp_background", slider=True)
500 col.itemR(rd, "stamp_font_size", text="Font Size")
502 row = layout.split(percentage=0.2)
503 row.itemR(rd, "stamp_note", text="Note")
505 sub.active = rd.stamp_note
506 sub.itemR(rd, "stamp_note_text", text="")
508 bpy.types.register(RENDER_PT_render)
509 bpy.types.register(RENDER_PT_layers)
510 bpy.types.register(RENDER_PT_dimensions)
511 bpy.types.register(RENDER_PT_antialiasing)
512 bpy.types.register(RENDER_PT_shading)
513 bpy.types.register(RENDER_PT_output)
514 bpy.types.register(RENDER_PT_encoding)
515 bpy.types.register(RENDER_PT_performance)
516 bpy.types.register(RENDER_PT_post_processing)
517 bpy.types.register(RENDER_PT_stamp)