4 class RenderButtonsPanel(bpy.types.Panel):
5 __space_type__ = "BUTTONS_WINDOW"
6 __region_type__ = "WINDOW"
9 def poll(self, context):
10 rd = context.scene.render_data
11 return (not rd.use_game_engine)
13 class SCENE_PT_render(RenderButtonsPanel):
16 def draw(self, context):
18 rd = context.scene.render_data
21 row.itemO("screen.render", text="Image", icon='ICON_IMAGE_COL')
22 row.item_booleanO("screen.render", "animation", True, text="Animation", icon='ICON_SEQUENCE')
24 layout.itemR(rd, "display_mode", text="Display")
26 class SCENE_PT_layers(RenderButtonsPanel):
28 __default_closed__ = True
30 def draw(self, context):
33 rd = scene.render_data
36 row.template_list(rd, "layers", rd, "active_layer_index", rows=2)
38 col = row.column(align=True)
39 col.itemO("scene.render_layer_add", icon="ICON_ZOOMIN", text="")
40 col.itemO("scene.render_layer_remove", icon="ICON_ZOOMOUT", text="")
42 rl = rd.layers[rd.active_layer_index]
44 split = layout.split()
46 col.itemR(scene, "visible_layers", text="Scene")
48 col.itemR(rl, "visible_layers", text="Layer")
50 layout.itemR(rl, "light_override", text="Light")
51 layout.itemR(rl, "material_override", text="Material")
54 layout.itemL(text="Include:")
55 split = layout.split()
58 col.itemR(rl, "zmask")
60 row.itemR(rl, "zmask_negate", text="Negate")
62 col.itemR(rl, "all_z")
65 col.itemR(rl, "solid")
67 col.itemR(rl, "ztransp")
72 col.itemR(rl, "strand")
75 split = layout.split()
76 split.itemL(text="Zmask Layers:")
77 split.column().itemR(rl, "zmask_layers", text="")
81 split = layout.split()
83 col.itemL(text="Passes:")
84 col.itemR(rl, "pass_combined")
85 col.itemR(rl, "pass_z")
86 col.itemR(rl, "pass_vector")
87 col.itemR(rl, "pass_normal")
88 col.itemR(rl, "pass_uv")
89 col.itemR(rl, "pass_mist")
90 col.itemR(rl, "pass_object_index")
94 col.itemR(rl, "pass_color")
95 col.itemR(rl, "pass_diffuse")
97 row.itemR(rl, "pass_specular")
98 row.itemR(rl, "pass_specular_exclude", text="", icon="ICON_X")
100 row.itemR(rl, "pass_shadow")
101 row.itemR(rl, "pass_shadow_exclude", text="", icon="ICON_X")
103 row.itemR(rl, "pass_ao")
104 row.itemR(rl, "pass_ao_exclude", text="", icon="ICON_X")
106 row.itemR(rl, "pass_reflection")
107 row.itemR(rl, "pass_reflection_exclude", text="", icon="ICON_X")
109 row.itemR(rl, "pass_refraction")
110 row.itemR(rl, "pass_refraction_exclude", text="", icon="ICON_X")
112 class SCENE_PT_shading(RenderButtonsPanel):
113 __label__ = "Shading"
115 def draw(self, context):
117 rd = context.scene.render_data
119 split = layout.split()
122 col.itemR(rd, "render_textures", text="Textures")
123 col.itemR(rd, "render_shadows", text="Shadows")
124 col.itemR(rd, "render_sss", text="Subsurface Scattering")
125 col.itemR(rd, "render_envmaps", text="Environment Map")
128 col.itemR(rd, "render_raytracing", text="Ray Tracing")
129 col.itemR(rd, "color_management")
130 col.itemR(rd, "alpha_mode", text="Alpha")
132 class SCENE_PT_performance(RenderButtonsPanel):
133 __label__ = "Performance"
134 __default_closed__ = True
136 def draw(self, context):
138 rd = context.scene.render_data
140 split = layout.split()
142 col = split.column(align=True)
143 col.itemL(text="Threads:")
144 col.row().itemR(rd, "threads_mode", expand=True)
145 colsub = col.column()
146 colsub.enabled = rd.threads_mode == 'THREADS_FIXED'
147 colsub.itemR(rd, "threads")
151 sub = col.column(align=True)
152 sub.itemL(text="Tiles:")
153 sub.itemR(rd, "parts_x", text="X")
154 sub.itemR(rd, "parts_y", text="Y")
156 split = layout.split()
159 col.itemL(text="Memory:")
161 row.itemR(rd, "save_buffers")
162 row.enabled = not rd.full_sample
166 col.itemR(rd, "free_image_textures")
167 col.active = rd.use_compositing
170 row.active = rd.render_raytracing
171 row.itemR(rd, "octree_resolution", text="Ray Tracing Octree")
174 class SCENE_PT_post_processing(RenderButtonsPanel):
175 __label__ = "Post Processing"
176 __default_closed__ = True
178 def draw(self, context):
180 rd = context.scene.render_data
182 split = layout.split()
185 col.itemR(rd, "use_compositing")
186 col.itemR(rd, "use_sequencer")
190 row.itemR(rd, "fields", text="Fields")
192 rowsub.active = rd.fields
193 rowsub.itemR(rd, "fields_still", text="Still")
195 rowsub.active = rd.fields
196 rowsub.itemR(rd, "field_order", expand=True)
198 split = layout.split()
200 split.itemR(rd, "dither_intensity", text="Dither", slider=True)
202 class SCENE_PT_output(RenderButtonsPanel):
205 def draw(self, context):
207 rd = context.scene.render_data
209 layout.itemR(rd, "output_path", text="")
211 split = layout.split()
213 col.itemR(rd, "file_format", text="")
214 col.row().itemR(rd, "color_mode", text="Color", expand=True)
217 col.itemR(rd, "file_extensions")
218 col.itemR(rd, "placeholders")
219 col.itemR(rd, "no_overwrite")
221 if rd.file_format in ('AVIJPEG', 'JPEG'):
222 split = layout.split()
223 split.itemR(rd, "quality", slider=True)
225 elif rd.file_format == 'OPENEXR':
226 split = layout.split()
228 col.itemR(rd, "exr_codec")
230 subsplit = split.split()
231 col = subsplit.column()
232 col.itemR(rd, "exr_half")
233 col.itemR(rd, "exr_zbuf")
234 col = subsplit.column()
235 col.itemR(rd, "exr_preview")
237 elif rd.file_format == 'JPEG2000':
238 split = layout.split()
240 col.itemL(text="Depth:")
241 col.row().itemR(rd, "jpeg_depth", expand=True)
244 col.itemR(rd, "jpeg_preset", text="")
245 col.itemR(rd, "jpeg_ycc")
246 col.itemR(rd, "exr_preview")
248 elif rd.file_format in ('CINEON', 'DPX'):
249 split = layout.split()
251 col.itemR(rd, "cineon_log", text="Convert to Log")
253 col = split.column(align=True)
254 col.active = rd.cineon_log
255 col.itemR(rd, "cineon_black", text="Black")
256 col.itemR(rd, "cineon_white", text="White")
257 col.itemR(rd, "cineon_gamma", text="Gamma")
259 elif rd.file_format == 'TIFF':
260 split = layout.split()
261 split.itemR(rd, "tiff_bit")
263 class SCENE_PT_encoding(RenderButtonsPanel):
264 __label__ = "Encoding"
265 __default_closed__ = True
267 def poll(self, context):
268 rd = context.scene.render_data
269 return rd.file_format in ('FFMPEG', 'XVID', 'H264', 'THEORA')
271 def draw(self, context):
273 rd = context.scene.render_data
275 split = layout.split()
276 split.itemR(rd, "ffmpeg_format")
277 if rd.ffmpeg_format in ('AVI', 'QUICKTIME', 'MKV', 'OGG'):
278 split.itemR(rd, "ffmpeg_codec")
282 split = layout.split()
285 col.itemR(rd, "ffmpeg_video_bitrate")
286 col.itemL(text="Rate:")
287 col.itemR(rd, "ffmpeg_minrate", text="Minimum")
288 col.itemR(rd, "ffmpeg_maxrate", text="Maximum")
289 col.itemR(rd, "ffmpeg_buffersize", text="Buffer")
292 col.itemR(rd, "ffmpeg_gopsize")
293 col.itemR(rd, "ffmpeg_autosplit")
294 col.itemL(text="Mux:")
295 col.itemR(rd, "ffmpeg_muxrate", text="Rate")
296 col.itemR(rd, "ffmpeg_packetsize", text="Packet Size")
299 row.itemL(text="Audio:")
301 row.itemR(rd, "ffmpeg_audio_codec")
303 split = layout.split()
306 col.itemR(rd, "ffmpeg_audio_bitrate")
308 col.itemR(rd, "ffmpeg_multiplex_audio")
310 class SCENE_PT_antialiasing(RenderButtonsPanel):
311 __label__ = "Anti-Aliasing"
313 def draw_header(self, context):
315 rd = context.scene.render_data
317 layout.itemR(rd, "antialiasing", text="")
319 def draw(self, context):
321 rd = context.scene.render_data
323 layout.active = rd.antialiasing
325 split = layout.split()
328 col.row().itemR(rd, "antialiasing_samples", expand=True)
329 col.itemR(rd, "full_sample")
332 col.itemR(rd, "pixel_filter", text="")
333 col.itemR(rd, "filter_size", text="Size", slider=True)
335 class SCENE_PT_dimensions(RenderButtonsPanel):
336 __label__ = "Dimensions"
338 def draw(self, context):
341 scene = context.scene
342 rd = scene.render_data
344 split = layout.split()
347 sub = col.column(align=True)
348 sub.itemL(text="Resolution:")
349 sub.itemR(rd, "resolution_x", text="X")
350 sub.itemR(rd, "resolution_y", text="Y")
351 sub.itemR(rd, "resolution_percentage", text="")
353 sub.itemL(text="Aspect Ratio:")
354 sub.itemR(rd, "pixel_aspect_x", text="X")
355 sub.itemR(rd, "pixel_aspect_y", text="Y")
358 row.itemR(rd, "border", text="Border")
360 rowsub.active = rd.border
361 rowsub.itemR(rd, "crop_to_border", text="Crop")
363 col = split.column(align=True)
364 col.itemL(text="Frame Range:")
365 col.itemR(scene, "start_frame", text="Start")
366 col.itemR(scene, "end_frame", text="End")
367 col.itemR(scene, "frame_step", text="Step")
369 col.itemL(text="Frame Rate:")
371 col.itemR(rd, "fps_base",text="/")
373 class SCENE_PT_stamp(RenderButtonsPanel):
375 __default_closed__ = True
377 def draw_header(self, context):
378 rd = context.scene.render_data
381 layout.itemR(rd, "render_stamp", text="")
383 def draw(self, context):
385 rd = context.scene.render_data
387 layout.active = rd.render_stamp
389 split = layout.split()
392 col.itemR(rd, "stamp_time", text="Time")
393 col.itemR(rd, "stamp_date", text="Date")
394 col.itemR(rd, "stamp_frame", text="Frame")
395 col.itemR(rd, "stamp_scene", text="Scene")
396 col.itemR(rd, "stamp_camera", text="Camera")
397 col.itemR(rd, "stamp_filename", text="Filename")
398 col.itemR(rd, "stamp_marker", text="Marker")
399 col.itemR(rd, "stamp_sequence_strip", text="Seq. Strip")
402 sub.active = rd.render_stamp
403 sub.itemR(rd, "stamp_foreground", slider=True)
404 sub.itemR(rd, "stamp_background", slider=True)
405 sub.itemR(rd, "stamp_font_size", text="Font Size")
407 row = layout.split(percentage=0.2)
408 row.itemR(rd, "stamp_note", text="Note")
410 rowsub.active = rd.stamp_note
411 rowsub.itemR(rd, "stamp_note_text", text="")
413 bpy.types.register(SCENE_PT_render)
414 bpy.types.register(SCENE_PT_layers)
415 bpy.types.register(SCENE_PT_dimensions)
416 bpy.types.register(SCENE_PT_antialiasing)
417 bpy.types.register(SCENE_PT_shading)
418 bpy.types.register(SCENE_PT_output)
419 bpy.types.register(SCENE_PT_encoding)
420 bpy.types.register(SCENE_PT_performance)
421 bpy.types.register(SCENE_PT_post_processing)
422 bpy.types.register(SCENE_PT_stamp)