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