Merge branch 'master' into 28
[blender.git] / release / scripts / startup / bl_ui / properties_render.py
1 # ##### BEGIN GPL LICENSE BLOCK #####
2
3 #
4 #  This program is free software; you can redistribute it and/or
5 #  modify it under the terms of the GNU General Public License
6 #  as published by the Free Software Foundation; either version 2
7 #  of the License, or (at your option) any later version.
8 #
9 #  This program is distributed in the hope that it will be useful,
10 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 #  GNU General Public License for more details.
13 #
14 #  You should have received a copy of the GNU General Public License
15 #  along with this program; if not, write to the Free Software Foundation,
16 #  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 #
18 # ##### END GPL LICENSE BLOCK #####
19
20 # <pep8 compliant>
21 import bpy
22 from bpy.types import Menu, Panel
23
24
25 class RENDER_MT_presets(Menu):
26     bl_label = "Render Presets"
27     preset_subdir = "render"
28     preset_operator = "script.execute_preset"
29     draw = Menu.draw_preset
30
31
32 class RENDER_MT_ffmpeg_presets(Menu):
33     bl_label = "FFMPEG Presets"
34     preset_subdir = "ffmpeg"
35     preset_operator = "script.python_file_run"
36     draw = Menu.draw_preset
37
38
39 class RENDER_MT_framerate_presets(Menu):
40     bl_label = "Frame Rate Presets"
41     preset_subdir = "framerate"
42     preset_operator = "script.execute_preset"
43     draw = Menu.draw_preset
44
45
46 class RenderButtonsPanel:
47     bl_space_type = 'PROPERTIES'
48     bl_region_type = 'WINDOW'
49     bl_context = "render"
50     # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
51
52     @classmethod
53     def poll(cls, context):
54         scene = context.scene
55         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
56
57
58 class RENDER_PT_context(Panel):
59     bl_space_type = 'PROPERTIES'
60     bl_region_type = 'WINDOW'
61     bl_context = "render"
62     bl_options = {'HIDE_HEADER'}
63     bl_label = ""
64
65     @classmethod
66     def poll(cls, context):
67         return context.scene
68
69     def draw(self, context):
70         layout = self.layout
71
72         scene = context.scene
73         view_render = scene.view_render
74
75         if view_render.has_multiple_engines:
76             layout.prop(view_render, "engine", text="")
77
78
79 class RENDER_PT_render(RenderButtonsPanel, Panel):
80     bl_label = "Render"
81     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
82
83     def draw(self, context):
84         layout = self.layout
85
86         rd = context.scene.render
87
88         row = layout.row(align=True)
89         row.operator("render.render", text="Render", icon='RENDER_STILL')
90         row.operator("render.render", text="Animation", icon='RENDER_ANIMATION').animation = True
91         row.operator("sound.mixdown", text="Audio", icon='PLAY_AUDIO')
92
93         split = layout.split(percentage=0.33)
94
95         split.label(text="Display:")
96         row = split.row(align=True)
97         row.prop(rd, "display_mode", text="")
98         row.prop(rd, "use_lock_interface", icon_only=True)
99
100
101 class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
102     bl_label = "Dimensions"
103     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
104
105     _frame_rate_args_prev = None
106     _preset_class = None
107
108     @staticmethod
109     def _draw_framerate_label(*args):
110         # avoids re-creating text string each draw
111         if RENDER_PT_dimensions._frame_rate_args_prev == args:
112             return RENDER_PT_dimensions._frame_rate_ret
113
114         fps, fps_base, preset_label = args
115
116         if fps_base == 1.0:
117             fps_rate = round(fps)
118         else:
119             fps_rate = round(fps / fps_base, 2)
120
121         # TODO: Change the following to iterate over existing presets
122         custom_framerate = (fps_rate not in {23.98, 24, 25, 29.97, 30, 50, 59.94, 60})
123
124         if custom_framerate is True:
125             fps_label_text = "Custom (%r fps)" % fps_rate
126             show_framerate = True
127         else:
128             fps_label_text = "%r fps" % fps_rate
129             show_framerate = (preset_label == "Custom")
130
131         RENDER_PT_dimensions._frame_rate_args_prev = args
132         RENDER_PT_dimensions._frame_rate_ret = args = (fps_label_text, show_framerate)
133         return args
134
135     @staticmethod
136     def draw_framerate(sub, rd):
137         if RENDER_PT_dimensions._preset_class is None:
138             RENDER_PT_dimensions._preset_class = bpy.types.RENDER_MT_framerate_presets
139
140         args = rd.fps, rd.fps_base, RENDER_PT_dimensions._preset_class.bl_label
141         fps_label_text, show_framerate = RENDER_PT_dimensions._draw_framerate_label(*args)
142
143         sub.menu("RENDER_MT_framerate_presets", text=fps_label_text)
144
145         if show_framerate:
146             sub.prop(rd, "fps")
147             sub.prop(rd, "fps_base", text="/")
148
149     def draw(self, context):
150         layout = self.layout
151
152         scene = context.scene
153         rd = scene.render
154
155         row = layout.row(align=True)
156         row.menu("RENDER_MT_presets", text=bpy.types.RENDER_MT_presets.bl_label)
157         row.operator("render.preset_add", text="", icon='ZOOMIN')
158         row.operator("render.preset_add", text="", icon='ZOOMOUT').remove_active = True
159
160         split = layout.split()
161
162         col = split.column()
163         sub = col.column(align=True)
164         sub.label(text="Resolution:")
165         sub.prop(rd, "resolution_x", text="X")
166         sub.prop(rd, "resolution_y", text="Y")
167         sub.prop(rd, "resolution_percentage", text="")
168
169         sub.label(text="Aspect Ratio:")
170         sub.prop(rd, "pixel_aspect_x", text="X")
171         sub.prop(rd, "pixel_aspect_y", text="Y")
172
173         row = col.row()
174         row.prop(rd, "use_border", text="Border")
175         sub = row.row()
176         sub.active = rd.use_border
177         sub.prop(rd, "use_crop_to_border", text="Crop")
178
179         col = split.column()
180         sub = col.column(align=True)
181         sub.label(text="Frame Range:")
182         sub.prop(scene, "frame_start")
183         sub.prop(scene, "frame_end")
184         sub.prop(scene, "frame_step")
185
186         sub.label(text="Frame Rate:")
187
188         self.draw_framerate(sub, rd)
189
190         subrow = sub.row(align=True)
191         subrow.label(text="Time Remapping:")
192         subrow = sub.row(align=True)
193         subrow.prop(rd, "frame_map_old", text="Old")
194         subrow.prop(rd, "frame_map_new", text="New")
195
196
197 class RENDER_PT_antialiasing(RenderButtonsPanel, Panel):
198     bl_label = "Anti-Aliasing"
199     COMPAT_ENGINES = {'BLENDER_RENDER'}
200
201     def draw_header(self, context):
202         rd = context.scene.render
203
204         self.layout.prop(rd, "use_antialiasing", text="")
205
206     def draw(self, context):
207         layout = self.layout
208
209         rd = context.scene.render
210         layout.active = rd.use_antialiasing
211
212         split = layout.split()
213
214         col = split.column()
215         col.row().prop(rd, "antialiasing_samples", expand=True)
216         sub = col.row()
217         sub.prop(rd, "use_full_sample")
218
219         col = split.column()
220         col.prop(rd, "pixel_filter_type", text="")
221         col.prop(rd, "filter_size", text="Size")
222
223
224 class RENDER_PT_motion_blur(RenderButtonsPanel, Panel):
225     bl_label = "Sampled Motion Blur"
226     bl_options = {'DEFAULT_CLOSED'}
227     COMPAT_ENGINES = {'BLENDER_RENDER'}
228
229     @classmethod
230     def poll(cls, context):
231         scene = context.scene
232         rd = scene.render
233         view_render = scene.view_render
234         return not rd.use_full_sample and (view_render.engine in cls.COMPAT_ENGINES)
235
236     def draw_header(self, context):
237         rd = context.scene.render
238
239         self.layout.prop(rd, "use_motion_blur", text="")
240
241     def draw(self, context):
242         layout = self.layout
243
244         rd = context.scene.render
245         layout.active = rd.use_motion_blur
246
247         row = layout.row()
248         row.prop(rd, "motion_blur_samples")
249         row.prop(rd, "motion_blur_shutter")
250
251
252 class RENDER_PT_shading(RenderButtonsPanel, Panel):
253     bl_label = "Shading"
254     bl_options = {'DEFAULT_CLOSED'}
255     COMPAT_ENGINES = {'BLENDER_RENDER'}
256
257     def draw(self, context):
258         layout = self.layout
259
260         rd = context.scene.render
261
262         split = layout.split()
263
264         col = split.column()
265         col.prop(rd, "use_textures", text="Textures")
266         col.prop(rd, "use_shadows", text="Shadows")
267         col.prop(rd, "use_sss", text="Subsurface Scattering")
268         col.prop(rd, "use_envmaps", text="Environment Map")
269
270         col = split.column()
271         col.prop(rd, "use_raytrace", text="Ray Tracing")
272         col.prop(rd, "alpha_mode", text="Alpha")
273         col.prop(rd, "use_world_space_shading", text="World Space Shading")
274
275
276 class RENDER_PT_performance(RenderButtonsPanel, Panel):
277     bl_label = "Performance"
278     bl_options = {'DEFAULT_CLOSED'}
279     COMPAT_ENGINES = {'BLENDER_RENDER'}
280
281     def draw(self, context):
282         layout = self.layout
283
284         rd = context.scene.render
285
286         split = layout.split()
287
288         col = split.column(align=True)
289         col.label(text="Threads:")
290         col.row(align=True).prop(rd, "threads_mode", expand=True)
291         sub = col.column(align=True)
292         sub.enabled = rd.threads_mode == 'FIXED'
293         sub.prop(rd, "threads")
294
295         col.label(text="Tile Size:")
296         col.prop(rd, "tile_x", text="X")
297         col.prop(rd, "tile_y", text="Y")
298
299         col.separator()
300         col.prop(rd, "preview_start_resolution")
301         col.prop(rd, "preview_pixel_size", text="")
302
303         col = split.column()
304         col.label(text="Memory:")
305         sub = col.column()
306         sub.enabled = not rd.use_full_sample
307         sub.prop(rd, "use_save_buffers")
308         sub = col.column()
309         sub.active = rd.use_compositing
310         sub.prop(rd, "use_free_image_textures")
311         sub = col.column()
312         sub.active = rd.use_raytrace
313         sub.label(text="Acceleration Structure:")
314         sub.prop(rd, "raytrace_method", text="")
315         if rd.raytrace_method == 'OCTREE':
316             sub.prop(rd, "octree_resolution", text="Resolution")
317         else:
318             sub.prop(rd, "use_instances", text="Instances")
319         sub.prop(rd, "use_local_coords", text="Local Coordinates")
320
321
322 class RENDER_PT_post_processing(RenderButtonsPanel, Panel):
323     bl_label = "Post Processing"
324     bl_options = {'DEFAULT_CLOSED'}
325     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
326
327     def draw(self, context):
328         layout = self.layout
329
330         rd = context.scene.render
331
332         split = layout.split()
333
334         col = split.column()
335         col.prop(rd, "use_compositing")
336         col.prop(rd, "use_sequencer")
337
338         split.prop(rd, "dither_intensity", text="Dither", slider=True)
339
340         if context.scene.view_render.engine == 'BLENDER_EEVEE':
341             return
342
343         layout.separator()
344
345         split = layout.split()
346
347         col = split.column()
348         col.prop(rd, "use_fields", text="Fields")
349         sub = col.column()
350         sub.active = rd.use_fields
351         sub.row().prop(rd, "field_order", expand=True)
352         sub.prop(rd, "use_fields_still", text="Still")
353
354         col = split.column()
355         col.prop(rd, "use_edge_enhance")
356         sub = col.column()
357         sub.active = rd.use_edge_enhance
358         sub.prop(rd, "edge_threshold", text="Threshold", slider=True)
359         sub.prop(rd, "edge_color", text="")
360
361
362 class RENDER_PT_stamp(RenderButtonsPanel, Panel):
363     bl_label = "Metadata"
364     bl_options = {'DEFAULT_CLOSED'}
365     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
366
367     def draw(self, context):
368         layout = self.layout
369
370         rd = context.scene.render
371
372         layout.prop(rd, "use_stamp")
373         col = layout.column()
374         col.active = rd.use_stamp
375         row = col.row()
376         row.prop(rd, "stamp_font_size", text="Font Size")
377         row.prop(rd, "use_stamp_labels", text="Draw Labels")
378
379         row = col.row()
380         row.column().prop(rd, "stamp_foreground", slider=True)
381         row.column().prop(rd, "stamp_background", slider=True)
382
383         layout.label("Enabled Metadata")
384         split = layout.split()
385
386         col = split.column()
387         col.prop(rd, "use_stamp_time", text="Time")
388         col.prop(rd, "use_stamp_date", text="Date")
389         col.prop(rd, "use_stamp_render_time", text="RenderTime")
390         col.prop(rd, "use_stamp_frame", text="Frame")
391         col.prop(rd, "use_stamp_scene", text="Scene")
392         col.prop(rd, "use_stamp_memory", text="Memory")
393
394         col = split.column()
395         col.prop(rd, "use_stamp_camera", text="Camera")
396         col.prop(rd, "use_stamp_lens", text="Lens")
397         col.prop(rd, "use_stamp_filename", text="Filename")
398         col.prop(rd, "use_stamp_marker", text="Marker")
399         col.prop(rd, "use_stamp_sequencer_strip", text="Seq. Strip")
400
401         row = layout.split(percentage=0.2)
402         row.prop(rd, "use_stamp_note", text="Note")
403         sub = row.row()
404         sub.active = rd.use_stamp_note
405         sub.prop(rd, "stamp_note_text", text="")
406         if rd.use_sequencer:
407             layout.label("Sequencer:")
408             layout.prop(rd, "use_stamp_strip_meta")
409
410
411 class RENDER_PT_output(RenderButtonsPanel, Panel):
412     bl_label = "Output"
413     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
414
415     def draw(self, context):
416         layout = self.layout
417
418         rd = context.scene.render
419         image_settings = rd.image_settings
420         file_format = image_settings.file_format
421
422         layout.prop(rd, "filepath", text="")
423
424         split = layout.split()
425
426         col = split.column()
427         col.active = not rd.is_movie_format
428         col.prop(rd, "use_overwrite")
429         col.prop(rd, "use_placeholder")
430
431         col = split.column()
432         col.prop(rd, "use_file_extension")
433         col.prop(rd, "use_render_cache")
434
435         layout.template_image_settings(image_settings, color_management=False)
436         if rd.use_multiview:
437             layout.template_image_views(image_settings)
438
439
440 class RENDER_PT_encoding(RenderButtonsPanel, Panel):
441     bl_label = "Encoding"
442     bl_options = {'DEFAULT_CLOSED'}
443     COMPAT_ENGINES = {'BLENDER_RENDER'}
444
445     @classmethod
446     def poll(cls, context):
447         rd = context.scene.render
448         return rd.image_settings.file_format in {'FFMPEG', 'XVID', 'H264', 'THEORA'}
449
450     def draw(self, context):
451         layout = self.layout
452
453         rd = context.scene.render
454         ffmpeg = rd.ffmpeg
455
456         layout.menu("RENDER_MT_ffmpeg_presets", text="Presets")
457
458         split = layout.split()
459         split.prop(rd.ffmpeg, "format")
460         split.prop(ffmpeg, "use_autosplit")
461
462         layout.separator()
463
464         needs_codec = ffmpeg.format in {'AVI', 'QUICKTIME', 'MKV', 'OGG', 'MPEG4'}
465         if needs_codec:
466             layout.prop(ffmpeg, "codec")
467
468         if ffmpeg.codec in {'DNXHD'}:
469             layout.prop(ffmpeg, "use_lossless_output")
470
471         # Output quality
472         if needs_codec and ffmpeg.codec in {'H264', 'MPEG4'}:
473             layout.prop(ffmpeg, "constant_rate_factor")
474
475         # Encoding speed
476         layout.prop(ffmpeg, "ffmpeg_preset")
477         # I-frames
478         layout.prop(ffmpeg, "gopsize")
479         # B-Frames
480         row = layout.row()
481         row.prop(ffmpeg, "use_max_b_frames", text="Max B-frames")
482         pbox = row.split()
483         pbox.prop(ffmpeg, "max_b_frames", text="")
484         pbox.enabled = ffmpeg.use_max_b_frames
485
486         if ffmpeg.constant_rate_factor == 'NONE':
487             split = layout.split()
488             col = split.column()
489             col.label(text="Rate:")
490             col.prop(ffmpeg, "video_bitrate")
491             col.prop(ffmpeg, "minrate", text="Minimum")
492             col.prop(ffmpeg, "maxrate", text="Maximum")
493             col.prop(ffmpeg, "buffersize", text="Buffer")
494
495             col = split.column()
496             col.label(text="Mux:")
497             col.prop(ffmpeg, "muxrate", text="Rate")
498             col.prop(ffmpeg, "packetsize", text="Packet Size")
499
500         layout.separator()
501
502         # Audio:
503         if ffmpeg.format != 'MP3':
504             layout.prop(ffmpeg, "audio_codec", text="Audio Codec")
505
506         if ffmpeg.audio_codec != 'NONE':
507             row = layout.row()
508             row.prop(ffmpeg, "audio_bitrate")
509             row.prop(ffmpeg, "audio_volume", slider=True)
510
511
512 class RENDER_PT_bake(RenderButtonsPanel, Panel):
513     bl_label = "Bake"
514     bl_options = {'DEFAULT_CLOSED'}
515     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
516
517     def draw(self, context):
518         layout = self.layout
519
520         rd = context.scene.render
521
522         layout.operator("object.bake_image", icon='RENDER_STILL')
523
524         layout.prop(rd, "bake_type")
525
526         multires_bake = False
527         if rd.bake_type in ['NORMALS', 'DISPLACEMENT', 'DERIVATIVE', 'AO']:
528             layout.prop(rd, "use_bake_multires")
529             multires_bake = rd.use_bake_multires
530
531         if not multires_bake:
532             if rd.bake_type == 'NORMALS':
533                 layout.prop(rd, "bake_normal_space")
534             elif rd.bake_type in {'DISPLACEMENT', 'AO'}:
535                 layout.prop(rd, "use_bake_normalize")
536
537             # col.prop(rd, "bake_aa_mode")
538             # col.prop(rd, "use_bake_antialiasing")
539
540             layout.separator()
541
542             split = layout.split()
543
544             col = split.column()
545             col.prop(rd, "use_bake_to_vertex_color")
546             sub = col.column()
547             sub.active = not rd.use_bake_to_vertex_color
548             sub.prop(rd, "use_bake_clear")
549             sub.prop(rd, "bake_margin")
550             sub.prop(rd, "bake_quad_split", text="Split")
551
552             col = split.column()
553             col.prop(rd, "use_bake_selected_to_active")
554             sub = col.column()
555             sub.active = rd.use_bake_selected_to_active
556             sub.prop(rd, "bake_distance")
557             sub.prop(rd, "bake_bias")
558         else:
559             split = layout.split()
560
561             col = split.column()
562             col.prop(rd, "use_bake_clear")
563             col.prop(rd, "bake_margin")
564
565             if rd.bake_type == 'DISPLACEMENT':
566                 col = split.column()
567                 col.prop(rd, "use_bake_lores_mesh")
568
569             if rd.bake_type == 'AO':
570                 col = split.column()
571                 col.prop(rd, "bake_bias")
572                 col.prop(rd, "bake_samples")
573
574         if rd.bake_type == 'DERIVATIVE':
575             row = layout.row()
576             row.prop(rd, "use_bake_user_scale", text="")
577
578             sub = row.column()
579             sub.active = rd.use_bake_user_scale
580             sub.prop(rd, "bake_user_scale", text="User Scale")
581
582
583 class RENDER_PT_clay_layer_settings(RenderButtonsPanel, Panel):
584     bl_label = "Clay Layer Settings"
585     COMPAT_ENGINES = {'BLENDER_CLAY'}
586
587     def draw(self, context):
588         layout = self.layout
589         props = context.scene.layer_properties['BLENDER_CLAY']
590
591         col = layout.column()
592         col.prop(props, "ssao_samples")
593
594
595 class RENDER_PT_clay_collection_settings(RenderButtonsPanel, Panel):
596     bl_label = "Clay Collection Settings"
597     COMPAT_ENGINES = {'BLENDER_CLAY'}
598
599     def draw(self, context):
600         layout = self.layout
601         props = context.scene.collection_properties['BLENDER_CLAY']
602
603         col = layout.column()
604         col.template_icon_view(props, "matcap_icon")
605         col.prop(props, "matcap_rotation")
606         col.prop(props, "matcap_hue")
607         col.prop(props, "matcap_saturation")
608         col.prop(props, "matcap_value")
609         col.prop(props, "ssao_factor_cavity")
610         col.prop(props, "ssao_factor_edge")
611         col.prop(props, "ssao_distance")
612         col.prop(props, "ssao_attenuation")
613         col.prop(props, "hair_brightness_randomness")
614
615
616 class RENDER_PT_eevee_ambient_occlusion(RenderButtonsPanel, Panel):
617     bl_label = "Ambient Occlusion"
618     bl_options = {'DEFAULT_CLOSED'}
619     COMPAT_ENGINES = {'BLENDER_EEVEE'}
620
621     @classmethod
622     def poll(cls, context):
623         scene = context.scene
624         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
625
626     def draw_header(self, context):
627         scene = context.scene
628         props = scene.layer_properties['BLENDER_EEVEE']
629         self.layout.prop(props, "gtao_enable", text="")
630
631     def draw(self, context):
632         layout = self.layout
633         scene = context.scene
634         props = scene.layer_properties['BLENDER_EEVEE']
635
636         layout.active = props.gtao_enable
637         col = layout.column()
638         col.prop(props, "gtao_use_bent_normals")
639         col.prop(props, "gtao_bounce")
640         col.prop(props, "gtao_distance")
641         col.prop(props, "gtao_factor")
642         col.prop(props, "gtao_quality")
643
644
645 class RENDER_PT_eevee_motion_blur(RenderButtonsPanel, Panel):
646     bl_label = "Motion Blur"
647     bl_options = {'DEFAULT_CLOSED'}
648     COMPAT_ENGINES = {'BLENDER_EEVEE'}
649
650     @classmethod
651     def poll(cls, context):
652         scene = context.scene
653         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
654
655     def draw_header(self, context):
656         scene = context.scene
657         props = scene.layer_properties['BLENDER_EEVEE']
658         self.layout.prop(props, "motion_blur_enable", text="")
659
660     def draw(self, context):
661         layout = self.layout
662         scene = context.scene
663         props = scene.layer_properties['BLENDER_EEVEE']
664
665         layout.active = props.motion_blur_enable
666         col = layout.column()
667         col.prop(props, "motion_blur_samples")
668         col.prop(props, "motion_blur_shutter")
669
670
671 class RENDER_PT_eevee_depth_of_field(RenderButtonsPanel, Panel):
672     bl_label = "Depth of Field"
673     bl_options = {'DEFAULT_CLOSED'}
674     COMPAT_ENGINES = {'BLENDER_EEVEE'}
675
676     @classmethod
677     def poll(cls, context):
678         scene = context.scene
679         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
680
681     def draw_header(self, context):
682         scene = context.scene
683         props = scene.layer_properties['BLENDER_EEVEE']
684         self.layout.prop(props, "dof_enable", text="")
685
686     def draw(self, context):
687         layout = self.layout
688         scene = context.scene
689         props = scene.layer_properties['BLENDER_EEVEE']
690
691         layout.active = props.dof_enable
692         col = layout.column()
693         col.prop(props, "bokeh_max_size")
694         col.prop(props, "bokeh_threshold")
695
696
697 class RENDER_PT_eevee_bloom(RenderButtonsPanel, Panel):
698     bl_label = "Bloom"
699     bl_options = {'DEFAULT_CLOSED'}
700     COMPAT_ENGINES = {'BLENDER_EEVEE'}
701
702     @classmethod
703     def poll(cls, context):
704         scene = context.scene
705         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
706
707     def draw_header(self, context):
708         scene = context.scene
709         props = scene.layer_properties['BLENDER_EEVEE']
710         self.layout.prop(props, "bloom_enable", text="")
711
712     def draw(self, context):
713         layout = self.layout
714         scene = context.scene
715         props = scene.layer_properties['BLENDER_EEVEE']
716
717         layout.active = props.bloom_enable
718         col = layout.column()
719         col.prop(props, "bloom_threshold")
720         col.prop(props, "bloom_knee")
721         col.prop(props, "bloom_radius")
722         col.prop(props, "bloom_color")
723         col.prop(props, "bloom_intensity")
724         col.prop(props, "bloom_clamp")
725
726
727 class RENDER_PT_eevee_volumetric(RenderButtonsPanel, Panel):
728     bl_label = "Volumetric"
729     bl_options = {'DEFAULT_CLOSED'}
730     COMPAT_ENGINES = {'BLENDER_EEVEE'}
731
732     @classmethod
733     def poll(cls, context):
734         scene = context.scene
735         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
736
737     def draw_header(self, context):
738         scene = context.scene
739         props = scene.layer_properties['BLENDER_EEVEE']
740         self.layout.prop(props, "volumetric_enable", text="")
741
742     def draw(self, context):
743         layout = self.layout
744         scene = context.scene
745         props = scene.layer_properties['BLENDER_EEVEE']
746
747         layout.active = props.volumetric_enable
748         col = layout.column()
749         col.prop(props, "volumetric_start")
750         col.prop(props, "volumetric_end")
751         col.prop(props, "volumetric_tile_size")
752         col.prop(props, "volumetric_samples")
753         col.prop(props, "volumetric_sample_distribution")
754         col.prop(props, "volumetric_lights")
755         col.prop(props, "volumetric_light_clamp")
756         col.prop(props, "volumetric_shadows")
757         col.prop(props, "volumetric_shadow_samples")
758         col.prop(props, "volumetric_colored_transmittance")
759
760
761 class RENDER_PT_eevee_subsurface_scattering(RenderButtonsPanel, Panel):
762     bl_label = "Subsurface Scattering"
763     bl_options = {'DEFAULT_CLOSED'}
764     COMPAT_ENGINES = {'BLENDER_EEVEE'}
765
766     @classmethod
767     def poll(cls, context):
768         scene = context.scene
769         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
770
771     def draw_header(self, context):
772         scene = context.scene
773         props = scene.layer_properties['BLENDER_EEVEE']
774         self.layout.prop(props, "sss_enable", text="")
775
776     def draw(self, context):
777         layout = self.layout
778         scene = context.scene
779         props = scene.layer_properties['BLENDER_EEVEE']
780
781         col = layout.column()
782         col.prop(props, "sss_samples")
783         col.prop(props, "sss_jitter_threshold")
784         col.prop(props, "sss_separate_albedo")
785
786
787 class RENDER_PT_eevee_screen_space_reflections(RenderButtonsPanel, Panel):
788     bl_label = "Screen Space Reflections"
789     bl_options = {'DEFAULT_CLOSED'}
790     COMPAT_ENGINES = {'BLENDER_EEVEE'}
791
792     @classmethod
793     def poll(cls, context):
794         scene = context.scene
795         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
796
797     def draw_header(self, context):
798         scene = context.scene
799         props = scene.layer_properties['BLENDER_EEVEE']
800         self.layout.prop(props, "ssr_enable", text="")
801
802     def draw(self, context):
803         layout = self.layout
804         scene = context.scene
805         props = scene.layer_properties['BLENDER_EEVEE']
806
807         col = layout.column()
808         col.active = props.ssr_enable
809         col.prop(props, "ssr_refraction")
810         col.prop(props, "ssr_halfres")
811         col.prop(props, "ssr_quality")
812         col.prop(props, "ssr_max_roughness")
813         col.prop(props, "ssr_thickness")
814         col.prop(props, "ssr_border_fade")
815         col.prop(props, "ssr_firefly_fac")
816
817
818 class RENDER_PT_eevee_shadows(RenderButtonsPanel, Panel):
819     bl_label = "Shadows"
820     bl_options = {'DEFAULT_CLOSED'}
821     COMPAT_ENGINES = {'BLENDER_EEVEE'}
822
823     @classmethod
824     def poll(cls, context):
825         scene = context.scene
826         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
827
828     def draw(self, context):
829         layout = self.layout
830         scene = context.scene
831         props = scene.layer_properties['BLENDER_EEVEE']
832
833         col = layout.column()
834         col.prop(props, "shadow_method")
835         col.prop(props, "shadow_size")
836         col.prop(props, "shadow_high_bitdepth")
837
838
839 class RENDER_PT_eevee_sampling(RenderButtonsPanel, Panel):
840     bl_label = "Sampling"
841     bl_options = {'DEFAULT_CLOSED'}
842     COMPAT_ENGINES = {'BLENDER_EEVEE'}
843
844     @classmethod
845     def poll(cls, context):
846         scene = context.scene
847         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
848
849     def draw(self, context):
850         layout = self.layout
851         scene = context.scene
852         props = scene.layer_properties['BLENDER_EEVEE']
853
854         col = layout.column()
855         col.prop(props, "taa_samples")
856         col.prop(props, "taa_render_samples")
857
858
859 class RENDER_PT_eevee_indirect_lighting(RenderButtonsPanel, Panel):
860     bl_label = "Indirect Lighting"
861     bl_options = {'DEFAULT_CLOSED'}
862     COMPAT_ENGINES = {'BLENDER_EEVEE'}
863
864     @classmethod
865     def poll(cls, context):
866         scene = context.scene
867         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
868
869     def draw(self, context):
870         layout = self.layout
871         scene = context.scene
872         props = scene.layer_properties['BLENDER_EEVEE']
873
874         col = layout.column()
875         col.prop(props, "gi_diffuse_bounces")
876         col.prop(props, "gi_cubemap_resolution")
877         col.prop(props, "gi_visibility_resolution")
878
879
880 class RENDER_PT_eevee_film(RenderButtonsPanel, Panel):
881     bl_label = "Film"
882     bl_options = {'DEFAULT_CLOSED'}
883     COMPAT_ENGINES = {'BLENDER_EEVEE'}
884
885     @classmethod
886     def poll(cls, context):
887         scene = context.scene
888         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
889
890     def draw(self, context):
891         layout = self.layout
892         scene = context.scene
893         rd = scene.render
894
895         split = layout.split()
896
897         col = split.column()
898         col.prop(rd, "filter_size")
899
900         col = split.column()
901         col.prop(rd, "alpha_mode", text="Alpha")
902
903
904 classes = (
905     RENDER_MT_presets,
906     RENDER_MT_ffmpeg_presets,
907     RENDER_MT_framerate_presets,
908     RENDER_PT_context,
909     RENDER_PT_render,
910     RENDER_PT_dimensions,
911     RENDER_PT_antialiasing,
912     RENDER_PT_motion_blur,
913     RENDER_PT_shading,
914     RENDER_PT_performance,
915     RENDER_PT_post_processing,
916     RENDER_PT_stamp,
917     RENDER_PT_output,
918     RENDER_PT_encoding,
919     RENDER_PT_bake,
920     RENDER_PT_clay_layer_settings,
921     RENDER_PT_clay_collection_settings,
922     RENDER_PT_eevee_sampling,
923     RENDER_PT_eevee_film,
924     RENDER_PT_eevee_shadows,
925     RENDER_PT_eevee_indirect_lighting,
926     RENDER_PT_eevee_subsurface_scattering,
927     RENDER_PT_eevee_screen_space_reflections,
928     RENDER_PT_eevee_ambient_occlusion,
929     RENDER_PT_eevee_volumetric,
930     RENDER_PT_eevee_motion_blur,
931     RENDER_PT_eevee_depth_of_field,
932     RENDER_PT_eevee_bloom,
933 )
934
935 if __name__ == "__main__":  # only for live edit.
936     from bpy.utils import register_class
937     for cls in classes:
938         register_class(cls)