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