1dd59aecc5a24f9a7ce4234e0cef59e0de3a3bfe
[blender-staging.git] / release / scripts / ui / properties_render.py
1 # ##### BEGIN GPL LICENSE BLOCK #####
2 #
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.
7 #
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.
12 #
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 #
17 # ##### END GPL LICENSE BLOCK #####
18
19 # <pep8 compliant>
20 import bpy
21
22
23 class RENDER_MT_presets(bpy.types.Menu):
24     bl_label = "Render Presets"
25     preset_subdir = "render"
26     preset_operator = "script.execute_preset"
27     draw = bpy.types.Menu.draw_preset
28
29
30 class RENDER_MT_ffmpeg_presets(bpy.types.Menu):
31     bl_label = "FFMPEG Presets"
32     preset_subdir = "ffmpeg"
33     preset_operator = "script.python_file_run"
34     draw = bpy.types.Menu.draw_preset
35
36
37 class RenderButtonsPanel():
38     bl_space_type = 'PROPERTIES'
39     bl_region_type = 'WINDOW'
40     bl_context = "render"
41     # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
42
43     @classmethod
44     def poll(cls, context):
45         rd = context.scene.render
46         return (context.scene and rd.use_game_engine is False) and (rd.engine in cls.COMPAT_ENGINES)
47
48
49 class RENDER_PT_render(RenderButtonsPanel, bpy.types.Panel):
50     bl_label = "Render"
51     COMPAT_ENGINES = {'BLENDER_RENDER'}
52
53     def draw(self, context):
54         layout = self.layout
55
56         rd = context.scene.render
57
58         split = layout.split()
59
60         col = split.column()
61         col.operator("render.render", text="Image", icon='RENDER_STILL')
62
63         col = split.column()
64         col.operator("render.render", text="Animation", icon='RENDER_ANIMATION').animation = True
65
66         layout.prop(rd, "display_mode", text="Display")
67
68
69 class RENDER_PT_layers(RenderButtonsPanel, bpy.types.Panel):
70     bl_label = "Layers"
71     bl_options = {'DEFAULT_CLOSED'}
72     COMPAT_ENGINES = {'BLENDER_RENDER'}
73
74     def draw(self, context):
75         layout = self.layout
76
77         scene = context.scene
78         rd = scene.render
79
80         row = layout.row()
81         row.template_list(rd, "layers", rd.layers, "active_index", rows=2)
82
83         col = row.column(align=True)
84         col.operator("scene.render_layer_add", icon='ZOOMIN', text="")
85         col.operator("scene.render_layer_remove", icon='ZOOMOUT', text="")
86
87         row = layout.row()
88         rl = rd.layers.active
89         if rl:
90             row.prop(rl, "name")
91         row.prop(rd, "use_single_layer", text="", icon_only=True)
92
93         split = layout.split()
94
95         col = split.column()
96         col.prop(scene, "layers", text="Scene")
97         col.label(text="")
98         col.prop(rl, "light_override", text="Light")
99         col.prop(rl, "material_override", text="Material")
100
101         col = split.column()
102         col.prop(rl, "layers", text="Layer")
103         col.label(text="Mask Layers:")
104         col.prop(rl, "layers_zmask", text="")
105
106         layout.separator()
107         layout.label(text="Include:")
108
109         split = layout.split()
110
111         col = split.column()
112         col.prop(rl, "use_zmask")
113         row = col.row()
114         row.prop(rl, "invert_zmask", text="Negate")
115         row.active = rl.use_zmask
116         col.prop(rl, "use_all_z")
117
118         col = split.column()
119         col.prop(rl, "use_solid")
120         col.prop(rl, "use_halo")
121         col.prop(rl, "use_ztransp")
122         col.prop(rl, "use_sky")
123                 
124         col = split.column()
125         col.prop(rl, "use_edge_enhance")
126         col.prop(rl, "use_strand")
127         col.prop(rl, "use_freestyle")
128
129         layout.separator()
130
131         split = layout.split()
132
133         col = split.column()
134         col.label(text="Passes:")
135         col.prop(rl, "use_pass_combined")
136         col.prop(rl, "use_pass_z")
137         col.prop(rl, "use_pass_vector")
138         col.prop(rl, "use_pass_normal")
139         col.prop(rl, "use_pass_uv")
140         col.prop(rl, "use_pass_mist")
141         col.prop(rl, "use_pass_object_index")
142         col.prop(rl, "use_pass_color")
143
144         col = split.column()
145         col.label()
146         col.prop(rl, "use_pass_diffuse")
147         row = col.row()
148         row.prop(rl, "use_pass_specular")
149         row.prop(rl, "exclude_specular", text="")
150         row = col.row()
151         row.prop(rl, "use_pass_shadow")
152         row.prop(rl, "exclude_shadow", text="")
153         row = col.row()
154         row.prop(rl, "use_pass_emit")
155         row.prop(rl, "exclude_emit", text="")
156         row = col.row()
157         row.prop(rl, "use_pass_ambient_occlusion")
158         row.prop(rl, "exclude_ambient_occlusion", text="")
159         row = col.row()
160         row.prop(rl, "use_pass_environment")
161         row.prop(rl, "exclude_environment", text="")
162         row = col.row()
163         row.prop(rl, "use_pass_indirect")
164         row.prop(rl, "exclude_indirect", text="")
165         row = col.row()
166         row.prop(rl, "use_pass_reflection")
167         row.prop(rl, "exclude_reflection", text="")
168         row = col.row()
169         row.prop(rl, "use_pass_refraction")
170         row.prop(rl, "exclude_refraction", text="")
171
172
173 class RENDER_PT_freestyle(RenderButtonsPanel, bpy.types.Panel):
174     bl_label = "Freestyle"
175     COMPAT_ENGINES = {'BLENDER_RENDER'}
176
177     @classmethod
178     def poll(cls, context):
179         rd = context.scene.render
180         rl = rd.layers.active
181         return rl and rl.use_freestyle
182
183     def draw(self, context):
184         layout = self.layout
185
186         rd = context.scene.render
187         rl = rd.layers.active
188         freestyle = rl.freestyle_settings
189
190         split = layout.split()
191
192         col = split.column()
193         col.prop(freestyle, "mode", text="Control Mode")
194
195         if freestyle.mode == "EDITOR":
196             col.label(text="Edge Detection Options:")
197             col.prop(freestyle, "use_smoothness")
198             col.prop(freestyle, "crease_angle")
199             col.prop(freestyle, "sphere_radius")
200             col.prop(freestyle, "kr_derivative_epsilon")
201
202             lineset = freestyle.linesets.active
203
204             col.label(text="Line Sets:")
205             row = col.row()
206             rows = 2
207             if lineset:
208                 rows = 5
209             row.template_list(freestyle, "linesets", freestyle.linesets, "active_index", rows=rows)
210
211             sub = row.column()
212             subsub = sub.column(align=True)
213             subsub.operator("scene.freestyle_lineset_add", icon='ZOOMIN', text="")
214             subsub.operator("scene.freestyle_lineset_remove", icon='ZOOMOUT', text="")
215             if lineset:
216                 sub.separator()
217                 subsub = sub.column(align=True)
218                 subsub.operator("scene.freestyle_lineset_move", icon='TRIA_UP', text="").direction = 'UP'
219                 subsub.operator("scene.freestyle_lineset_move", icon='TRIA_DOWN', text="").direction = 'DOWN'
220
221             if lineset:
222                 col.prop(lineset, "name")
223
224                 col.prop(lineset, "select_by_visibility")
225                 if lineset.select_by_visibility:
226                     sub = col.row(align=True)
227                     sub.prop(lineset, "visibility", expand=True)
228                     if lineset.visibility == "RANGE":
229                         sub = col.row(align=True)
230                         sub.prop(lineset, "qi_start")
231                         sub.prop(lineset, "qi_end")
232                     col.separator() # XXX
233
234                 col.prop(lineset, "select_by_edge_types")
235                 if lineset.select_by_edge_types:
236                     row = col.row()
237                     row.prop(lineset, "edge_type_negation", expand=True)
238                     row = col.row()
239                     row.prop(lineset, "edge_type_combination", expand=True)
240
241                     row = col.row()
242                     sub = row.column()
243                     sub.prop(lineset, "select_silhouette")
244                     sub.prop(lineset, "select_border")
245                     sub.prop(lineset, "select_crease")
246                     sub.prop(lineset, "select_ridge")
247                     sub.prop(lineset, "select_valley")
248                     sub.prop(lineset, "select_suggestive_contour")
249                     sub.prop(lineset, "select_material_boundary")
250                     sub = row.column()
251                     sub.prop(lineset, "select_contour")
252                     sub.prop(lineset, "select_external_contour")
253                     col.separator() # XXX
254
255                 col.prop(lineset, "select_by_group")
256                 if lineset.select_by_group:
257                     col.prop(lineset, "group")
258                     row = col.row()
259                     row.prop(lineset, "group_negation", expand=True)
260
261         else: # freestyle.mode == "SCRIPT"
262
263             col.prop(freestyle, "use_smoothness")
264             col.prop(freestyle, "crease_angle")
265             col.prop(freestyle, "sphere_radius")
266             col.prop(freestyle, "use_ridges_and_valleys")
267             col.prop(freestyle, "use_suggestive_contours")
268             sub = col.row()
269             sub.prop(freestyle, "kr_derivative_epsilon")
270             sub.active = freestyle.use_suggestive_contours
271             col.prop(freestyle, "use_material_boundaries")
272             col.operator("scene.freestyle_module_add")
273
274             for i, module in enumerate(freestyle.modules):
275                 box = layout.box()
276                 box.context_pointer_set("freestyle_module", module)
277                 row = box.row(align=True)
278                 row.prop(module, "use", text="")
279                 row.prop(module, "module_path", text="")
280                 row.operator("scene.freestyle_module_remove", icon='X', text="")
281                 row.operator("scene.freestyle_module_move", icon='TRIA_UP', text="").direction = 'UP'
282                 row.operator("scene.freestyle_module_move", icon='TRIA_DOWN', text="").direction = 'DOWN'
283
284
285 class RENDER_PT_freestyle_linestyle(RenderButtonsPanel, bpy.types.Panel):
286     bl_label = "Freestyle: Line Style"
287     COMPAT_ENGINES = {'BLENDER_RENDER'}
288
289     @classmethod
290     def poll(cls, context):
291         rd = context.scene.render
292         rl = rd.layers.active
293         if rl and rl.use_freestyle:
294             freestyle = rl.freestyle_settings
295             return freestyle.mode == "EDITOR" and freestyle.linesets.active
296         return False
297
298     def draw_modifier_box_header(self, box, modifier):
299         row = box.row()
300         row.context_pointer_set("modifier", modifier)
301         if modifier.expanded:
302             icon = "TRIA_DOWN"
303         else:
304             icon = "TRIA_RIGHT"
305         row.operator("scene.freestyle_modifier_toggle_fold", icon=icon, text="", emboss=False)
306         row.label(text=modifier.rna_type.name)
307         row.prop(modifier, "name", text="")
308         row.prop(modifier, "use", text="")
309         sub = row.row(align=True)
310         sub.operator("scene.freestyle_modifier_move", icon='TRIA_UP', text="").direction = 'UP'
311         sub.operator("scene.freestyle_modifier_move", icon='TRIA_DOWN', text="").direction = 'DOWN'
312         row.operator("scene.freestyle_modifier_remove", icon='X', text="")
313
314     def draw_color_modifier(self, context, modifier):
315         layout = self.layout
316
317         col = layout.column(align=True)
318         self.draw_modifier_box_header(col.box(), modifier)
319         if modifier.expanded:
320             box = col.box()
321             row = box.row()
322             row.prop(modifier, "blend", text="")
323             row.prop(modifier, "influence")
324             if modifier.type == "DISTANCE_FROM_OBJECT":
325                 box.prop(modifier, "target")
326             box.template_color_ramp(modifier, "color_ramp", expand=True)
327             if modifier.type not in ["ALONG_STROKE"]:
328                 row = box.row(align=True)
329                 row.prop(modifier, "range_min")
330                 row.prop(modifier, "range_max")
331
332     def draw_alpha_modifier(self, context, modifier):
333         layout = self.layout
334
335         col = layout.column(align=True)
336         self.draw_modifier_box_header(col.box(), modifier)
337         if modifier.expanded:
338             box = col.box()
339             row = box.row()
340             row.prop(modifier, "blend", text="")
341             row.prop(modifier, "influence")
342             if modifier.type == "DISTANCE_FROM_OBJECT":
343                 box.prop(modifier, "target")
344             row = box.row()
345             row.prop(modifier, "mapping", text="")
346             sub = row.column()
347             sub.prop(modifier, "invert")
348             if modifier.mapping == "CURVE":
349                 sub.enabled = False
350                 box.template_curve_mapping(modifier, "curve")
351             if modifier.type not in ["ALONG_STROKE"]:
352                 row = box.row(align=True)
353                 row.prop(modifier, "range_min")
354                 row.prop(modifier, "range_max")
355
356     def draw_thickness_modifier(self, context, modifier):
357         layout = self.layout
358
359         col = layout.column(align=True)
360         self.draw_modifier_box_header(col.box(), modifier)
361         if modifier.expanded:
362             box = col.box()
363             row = box.row()
364             row.prop(modifier, "blend", text="")
365             row.prop(modifier, "influence")
366             if modifier.type == "DISTANCE_FROM_OBJECT":
367                 box.prop(modifier, "target")
368             row = box.row()
369             row.prop(modifier, "mapping", text="")
370             sub = row.column()
371             sub.prop(modifier, "invert")
372             if modifier.mapping == "CURVE":
373                 sub.enabled = False
374                 box.template_curve_mapping(modifier, "curve")
375             if modifier.type not in ["ALONG_STROKE"]:
376                 row = box.row(align=True)
377                 row.prop(modifier, "range_min")
378                 row.prop(modifier, "range_max")
379             row = box.row(align=True)
380             row.prop(modifier, "value_min")
381             row.prop(modifier, "value_max")
382
383     def draw(self, context):
384         layout = self.layout
385
386         rd = context.scene.render
387         rl = rd.layers.active
388         lineset = rl.freestyle_settings.linesets.active
389         linestyle = lineset.linestyle
390
391         split = layout.split()
392         col = split.column()
393         col.template_ID(lineset, "linestyle", new="scene.freestyle_linestyle_new")
394
395         col.separator()
396         sub = col.row(align=True)
397         sub.prop(linestyle, "panel", expand=True)
398
399         if linestyle.panel == "COLOR":
400             col.label(text="Base Color:")
401             col.prop(linestyle, "color", text="")
402             col.label(text="Modifiers:")
403             layout.operator_menu_enum("scene.freestyle_color_modifier_add", "type", text="Add Modifier")
404             for modifier in linestyle.color_modifiers:
405                 self.draw_color_modifier(context, modifier)
406         elif linestyle.panel == "ALPHA":
407             col.label(text="Base Transparency:")
408             col.prop(linestyle, "alpha")
409             col.label(text="Modifiers:")
410             layout.operator_menu_enum("scene.freestyle_alpha_modifier_add", "type", text="Add Modifier")
411             for modifier in linestyle.alpha_modifiers:
412                 self.draw_alpha_modifier(context, modifier)
413         elif linestyle.panel == "THICKNESS":
414             col.label(text="Base Thickness:")
415             col.prop(linestyle, "thickness")
416             col.label(text="Modifiers:")
417             layout.operator_menu_enum("scene.freestyle_thickness_modifier_add", "type", text="Add Modifier")
418             for modifier in linestyle.thickness_modifiers:
419                 self.draw_thickness_modifier(context, modifier)
420         elif linestyle.panel == "STROKES":
421             col.label(text="Chaining:")
422             col.prop(linestyle, "same_object")
423             col.separator()
424             col.label(text="Caps:")
425             sub = col.row(align=True)
426             sub.prop(linestyle, "caps", expand=True)
427             col.separator()
428             col.prop(linestyle, "use_dashed_line")
429             sub = col.row()
430             sub.enabled = linestyle.use_dashed_line
431             subsub = sub.column()
432             subsub.label(text="Dash")
433             subsub.prop(linestyle, "dash1", text="")
434             subsub = sub.column()
435             subsub.label(text="Gap")
436             subsub.prop(linestyle, "gap1", text="")
437             subsub = sub.column()
438             subsub.label(text="Dash")
439             subsub.prop(linestyle, "dash2", text="")
440             subsub = sub.column()
441             subsub.label(text="Gap")
442             subsub.prop(linestyle, "gap2", text="")
443             subsub = sub.column()
444             subsub.label(text="Dash")
445             subsub.prop(linestyle, "dash3", text="")
446             subsub = sub.column()
447             subsub.label(text="Gap")
448             subsub.prop(linestyle, "gap3", text="")
449         elif linestyle.panel == "DISTORT":
450             pass
451         elif linestyle.panel == "MISC":
452             pass
453
454
455 class RENDER_PT_shading(RenderButtonsPanel, bpy.types.Panel):
456     bl_label = "Shading"
457     COMPAT_ENGINES = {'BLENDER_RENDER'}
458
459     def draw(self, context):
460         layout = self.layout
461
462         rd = context.scene.render
463
464         split = layout.split()
465
466         col = split.column()
467         col.prop(rd, "use_textures", text="Textures")
468         col.prop(rd, "use_shadows", text="Shadows")
469         col.prop(rd, "use_sss", text="Subsurface Scattering")
470         col.prop(rd, "use_envmaps", text="Environment Map")
471
472         col = split.column()
473         col.prop(rd, "use_raytrace", text="Ray Tracing")
474         col.prop(rd, "use_color_management")
475         col.prop(rd, "alpha_mode", text="Alpha")
476
477
478 class RENDER_PT_performance(RenderButtonsPanel, bpy.types.Panel):
479     bl_label = "Performance"
480     bl_options = {'DEFAULT_CLOSED'}
481     COMPAT_ENGINES = {'BLENDER_RENDER'}
482
483     def draw(self, context):
484         layout = self.layout
485
486         rd = context.scene.render
487
488         split = layout.split()
489
490         col = split.column()
491         col.label(text="Threads:")
492         col.row().prop(rd, "threads_mode", expand=True)
493         sub = col.column()
494         sub.enabled = rd.threads_mode == 'FIXED'
495         sub.prop(rd, "threads")
496         sub = col.column(align=True)
497         sub.label(text="Tiles:")
498         sub.prop(rd, "parts_x", text="X")
499         sub.prop(rd, "parts_y", text="Y")
500
501         col = split.column()
502         col.label(text="Memory:")
503         sub = col.column()
504         sub.enabled = not (rd.use_border or rd.use_full_sample)
505         sub.prop(rd, "use_save_buffers")
506         sub = col.column()
507         sub.active = rd.use_compositing
508         sub.prop(rd, "use_free_image_textures")
509         sub = col.column()
510         sub.active = rd.use_raytrace
511         sub.label(text="Acceleration structure:")
512         sub.prop(rd, "raytrace_method", text="")
513         if rd.raytrace_method == 'OCTREE':
514             sub.prop(rd, "octree_resolution", text="Resolution")
515         else:
516             sub.prop(rd, "use_instances", text="Instances")
517         sub.prop(rd, "use_local_coords", text="Local Coordinates")
518
519
520 class RENDER_PT_post_processing(RenderButtonsPanel, bpy.types.Panel):
521     bl_label = "Post Processing"
522     bl_options = {'DEFAULT_CLOSED'}
523     COMPAT_ENGINES = {'BLENDER_RENDER'}
524
525     def draw(self, context):
526         layout = self.layout
527
528         rd = context.scene.render
529
530         split = layout.split()
531
532         col = split.column()
533         col.prop(rd, "use_compositing")
534         col.prop(rd, "use_sequencer")
535
536         col = split.column()
537         col.prop(rd, "dither_intensity", text="Dither", slider=True)
538
539         layout.separator()
540
541         split = layout.split()
542
543         col = split.column()
544         col.prop(rd, "use_fields", text="Fields")
545         sub = col.column()
546         sub.active = rd.use_fields
547         sub.row().prop(rd, "field_order", expand=True)
548         sub.prop(rd, "use_fields_still", text="Still")
549
550         col = split.column()
551         col.prop(rd, "use_edge_enhance")
552         sub = col.column()
553         sub.active = rd.use_edge_enhance
554         sub.prop(rd, "edge_threshold", text="Threshold", slider=True)
555         sub.prop(rd, "edge_color", text="")
556
557         layout.separator()
558
559         split = layout.split()
560         col = split.column()
561         col.prop(rd, "use_freestyle", text="Freestyle")
562
563
564 class RENDER_PT_output(RenderButtonsPanel, bpy.types.Panel):
565     bl_label = "Output"
566     COMPAT_ENGINES = {'BLENDER_RENDER'}
567
568     def draw(self, context):
569         layout = self.layout
570
571         rd = context.scene.render
572         file_format = rd.file_format
573
574         layout.prop(rd, "filepath", text="")
575
576         split = layout.split()
577         col = split.column()
578         col.prop(rd, "file_format", text="")
579         col.row().prop(rd, "color_mode", text="Color", expand=True)
580
581         col = split.column()
582         col.prop(rd, "use_file_extension")
583         col.prop(rd, "use_overwrite")
584         col.prop(rd, "use_placeholder")
585
586         if file_format in ('AVI_JPEG', 'JPEG'):
587             split = layout.split()
588             split.prop(rd, "file_quality", slider=True)
589
590         if file_format == 'PNG':
591             split = layout.split()
592             split.prop(rd, "file_quality", slider=True, text="Compression")
593
594         elif file_format == 'MULTILAYER':
595             split = layout.split()
596
597             col = split.column()
598             col.label(text="Codec:")
599             col.prop(rd, "exr_codec", text="")
600             col = split.column()
601
602         elif file_format == 'OPEN_EXR':
603             split = layout.split()
604
605             col = split.column()
606             col.label(text="Codec:")
607             col.prop(rd, "exr_codec", text="")
608
609             subsplit = split.split()
610             col = subsplit.column()
611             col.prop(rd, "use_exr_half")
612             col.prop(rd, "exr_zbuf")
613
614             col = subsplit.column()
615             col.prop(rd, "exr_preview")
616
617         elif file_format == 'JPEG2000':
618             split = layout.split()
619             col = split.column()
620             col.label(text="Depth:")
621             col.row().prop(rd, "jpeg2k_depth", expand=True)
622
623             col = split.column()
624             col.prop(rd, "jpeg2k_preset", text="")
625             col.prop(rd, "jpeg2k_ycc")
626
627         elif file_format in ('CINEON', 'DPX'):
628             split = layout.split()
629             col = split.column()
630             col.prop(rd, "use_cineon_log", text="Convert to Log")
631
632             col = split.column(align=True)
633             col.active = rd.use_cineon_log
634             col.prop(rd, "cineon_black", text="Black")
635             col.prop(rd, "cineon_white", text="White")
636             col.prop(rd, "cineon_gamma", text="Gamma")
637
638         elif file_format == 'TIFF':
639             split = layout.split()
640             split.prop(rd, "use_tiff_16bit")
641
642         elif file_format == 'QUICKTIME_CARBON':
643             split = layout.split()
644             split.operator("scene.render_data_set_quicktime_codec")
645
646         elif file_format == 'QUICKTIME_QTKIT':
647             split = layout.split()
648             col = split.column()
649             col.prop(rd, "quicktime_codec_type", text="Video Codec")
650             col.prop(rd, "quicktime_codec_spatial_quality", text="Quality")
651
652             # Audio
653             col.prop(rd, "quicktime_audiocodec_type", text="Audio Codec")
654             if rd.quicktime_audiocodec_type != 'No audio':
655                 split = layout.split()
656                 col = split.column()
657                 if rd.quicktime_audiocodec_type == 'LPCM':
658                     col.prop(rd, "quicktime_audio_bitdepth", text="")
659
660                 col = split.column()
661                 col.prop(rd, "quicktime_audio_samplerate", text="")
662
663                 split = layout.split()
664                 col = split.column()
665                 if rd.quicktime_audiocodec_type == 'AAC':
666                     col.prop(rd, "quicktime_audio_bitrate")
667
668                 subsplit = split.split()
669                 col = subsplit.column()
670
671                 if rd.quicktime_audiocodec_type == 'AAC':
672                     col.prop(rd, "quicktime_audio_codec_isvbr")
673
674                 col = subsplit.column()
675                 col.prop(rd, "quicktime_audio_resampling_hq")
676
677
678 class RENDER_PT_encoding(RenderButtonsPanel, bpy.types.Panel):
679     bl_label = "Encoding"
680     bl_options = {'DEFAULT_CLOSED'}
681     COMPAT_ENGINES = {'BLENDER_RENDER'}
682
683     @classmethod
684     def poll(cls, context):
685         rd = context.scene.render
686         return rd.file_format in ('FFMPEG', 'XVID', 'H264', 'THEORA')
687
688     def draw(self, context):
689         layout = self.layout
690
691         rd = context.scene.render
692
693         layout.menu("RENDER_MT_ffmpeg_presets", text="Presets")
694
695         split = layout.split()
696
697         col = split.column()
698         col.prop(rd, "ffmpeg_format")
699         if rd.ffmpeg_format in ('AVI', 'QUICKTIME', 'MKV', 'OGG'):
700             col = split.column()
701             col.prop(rd, "ffmpeg_codec")
702         else:
703             split.label()
704
705         split = layout.split()
706
707         col = split.column()
708         col.prop(rd, "ffmpeg_video_bitrate")
709
710         col = split.column()
711         col.prop(rd, "ffmpeg_gopsize")
712
713         split = layout.split()
714
715         col = split.column()
716         col.label(text="Rate:")
717         col.prop(rd, "ffmpeg_minrate", text="Minimum")
718         col.prop(rd, "ffmpeg_maxrate", text="Maximum")
719         col.prop(rd, "ffmpeg_buffersize", text="Buffer")
720
721         col = split.column()
722
723         col.prop(rd, "ffmpeg_autosplit")
724         col.label(text="Mux:")
725         col.prop(rd, "ffmpeg_muxrate", text="Rate")
726         col.prop(rd, "ffmpeg_packetsize", text="Packet Size")
727
728         # Audio:
729         sub = layout.column()
730
731         if rd.ffmpeg_format not in ('MP3', ):
732             sub.prop(rd, "ffmpeg_audio_codec", text="Audio Codec")
733
734         sub.separator()
735
736         split = sub.split()
737
738         col = split.column()
739         col.prop(rd, "ffmpeg_audio_bitrate")
740         col.prop(rd, "ffmpeg_audio_mixrate")
741
742         col = split.column()
743         col.prop(rd, "ffmpeg_audio_volume", slider=True)
744
745
746 class RENDER_PT_antialiasing(RenderButtonsPanel, bpy.types.Panel):
747     bl_label = "Anti-Aliasing"
748     COMPAT_ENGINES = {'BLENDER_RENDER'}
749
750     def draw_header(self, context):
751         rd = context.scene.render
752
753         self.layout.prop(rd, "use_antialiasing", text="")
754
755     def draw(self, context):
756         layout = self.layout
757
758         rd = context.scene.render
759         layout.active = rd.use_antialiasing
760
761         split = layout.split()
762
763         col = split.column()
764         col.row().prop(rd, "antialiasing_samples", expand=True)
765         sub = col.row()
766         sub.enabled = not rd.use_border
767         sub.prop(rd, "use_full_sample")
768
769         col = split.column()
770         col.prop(rd, "pixel_filter_type", text="")
771         col.prop(rd, "filter_size", text="Size")
772
773
774 class RENDER_PT_motion_blur(RenderButtonsPanel, bpy.types.Panel):
775     bl_label = "Sampled Motion Blur"
776     bl_options = {'DEFAULT_CLOSED'}
777     COMPAT_ENGINES = {'BLENDER_RENDER'}
778         
779     @classmethod
780     def poll(cls, context):
781         rd = context.scene.render
782         return not rd.use_full_sample and (rd.engine in cls.COMPAT_ENGINES)
783
784     def draw_header(self, context):
785         rd = context.scene.render
786
787         self.layout.prop(rd, "use_motion_blur", text="")
788
789     def draw(self, context):
790         layout = self.layout
791
792         rd = context.scene.render
793         layout.active = rd.use_motion_blur
794
795         row = layout.row()
796         row.prop(rd, "motion_blur_samples")
797         row.prop(rd, "motion_blur_shutter")
798
799
800 class RENDER_PT_dimensions(RenderButtonsPanel, bpy.types.Panel):
801     bl_label = "Dimensions"
802     COMPAT_ENGINES = {'BLENDER_RENDER'}
803
804     def draw(self, context):
805         layout = self.layout
806
807         scene = context.scene
808         rd = scene.render
809
810         row = layout.row(align=True)
811         row.menu("RENDER_MT_presets", text=bpy.types.RENDER_MT_presets.bl_label)
812         row.operator("render.preset_add", text="", icon="ZOOMIN")
813         row.operator("render.preset_add", text="", icon="ZOOMOUT").remove_active = True
814         split = layout.split()
815
816         col = split.column()
817         sub = col.column(align=True)
818         sub.label(text="Resolution:")
819         sub.prop(rd, "resolution_x", text="X")
820         sub.prop(rd, "resolution_y", text="Y")
821         sub.prop(rd, "resolution_percentage", text="")
822
823         sub.label(text="Aspect Ratio:")
824         sub.prop(rd, "pixel_aspect_x", text="X")
825         sub.prop(rd, "pixel_aspect_y", text="Y")
826
827         row = col.row()
828         row.prop(rd, "use_border", text="Border")
829         sub = row.row()
830         sub.active = rd.use_border
831         sub.prop(rd, "use_crop_to_border", text="Crop")
832
833         col = split.column()
834         sub = col.column(align=True)
835         sub.label(text="Frame Range:")
836         sub.prop(scene, "frame_start", text="Start")
837         sub.prop(scene, "frame_end", text="End")
838         sub.prop(scene, "frame_step", text="Step")
839
840         sub.label(text="Frame Rate:")
841
842         sub = col.column(align=True)
843         sub.prop(rd, "fps")
844         sub.prop(rd, "fps_base", text="/")
845         subrow = sub.row(align=True)
846         subrow.prop(rd, "frame_map_old", text="Old")
847         subrow.prop(rd, "frame_map_new", text="New")
848
849
850 class RENDER_PT_stamp(RenderButtonsPanel, bpy.types.Panel):
851     bl_label = "Stamp"
852     bl_options = {'DEFAULT_CLOSED'}
853     COMPAT_ENGINES = {'BLENDER_RENDER'}
854
855     def draw_header(self, context):
856         rd = context.scene.render
857
858         self.layout.prop(rd, "use_stamp", text="")
859
860     def draw(self, context):
861         layout = self.layout
862
863         rd = context.scene.render
864
865         layout.active = rd.use_stamp
866
867         split = layout.split()
868
869         col = split.column()
870         col.prop(rd, "use_stamp_time", text="Time")
871         col.prop(rd, "use_stamp_date", text="Date")
872         col.prop(rd, "use_stamp_render_time", text="RenderTime")
873         col.prop(rd, "use_stamp_frame", text="Frame")
874         col.prop(rd, "use_stamp_scene", text="Scene")
875         col.prop(rd, "use_stamp_camera", text="Camera")
876         col.prop(rd, "use_stamp_filename", text="Filename")
877         col.prop(rd, "use_stamp_marker", text="Marker")
878         col.prop(rd, "use_stamp_sequencer_strip", text="Seq. Strip")
879
880         col = split.column()
881         col.active = rd.use_stamp
882         col.prop(rd, "stamp_foreground", slider=True)
883         col.prop(rd, "stamp_background", slider=True)
884         col.separator()
885         col.prop(rd, "stamp_font_size", text="Font Size")
886
887         row = layout.split(percentage=0.2)
888         row.prop(rd, "use_stamp_note", text="Note")
889         sub = row.row()
890         sub.active = rd.use_stamp_note
891         sub.prop(rd, "stamp_note_text", text="")
892
893
894 class RENDER_PT_bake(RenderButtonsPanel, bpy.types.Panel):
895     bl_label = "Bake"
896     bl_options = {'DEFAULT_CLOSED'}
897     COMPAT_ENGINES = {'BLENDER_RENDER'}
898
899     def draw(self, context):
900         layout = self.layout
901
902         rd = context.scene.render
903
904         layout.operator("object.bake_image", icon='RENDER_STILL')
905         
906         layout.prop(rd, "bake_type")
907         
908         if rd.bake_type == 'NORMALS':
909             layout.prop(rd, "bake_normal_space")
910         elif rd.bake_type in ('DISPLACEMENT', 'AO'):
911             layout.prop(rd, "use_bake_normalize")
912         
913         # col.prop(rd, "bake_aa_mode")
914         # col.prop(rd, "use_bake_antialiasing")
915         
916         layout.separator()
917         
918         split = layout.split()
919
920         col = split.column()
921         col.prop(rd, "use_bake_clear")
922         col.prop(rd, "bake_margin")
923         col.prop(rd, "bake_quad_split", text="Split")
924         
925         col = split.column()
926         col.prop(rd, "use_bake_selected_to_active")
927         sub = col.column()
928         sub.active = rd.use_bake_selected_to_active
929         sub.prop(rd, "bake_distance")
930         sub.prop(rd, "bake_bias")
931
932         
933 def register():
934     pass
935
936
937 def unregister():
938     pass
939
940 if __name__ == "__main__":
941     register()