Merge branch 'master' into blender2.8
[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'}
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'}
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         layout.separator()
341
342         split = layout.split()
343
344         col = split.column()
345         col.prop(rd, "use_fields", text="Fields")
346         sub = col.column()
347         sub.active = rd.use_fields
348         sub.row().prop(rd, "field_order", expand=True)
349         sub.prop(rd, "use_fields_still", text="Still")
350
351         col = split.column()
352         col.prop(rd, "use_edge_enhance")
353         sub = col.column()
354         sub.active = rd.use_edge_enhance
355         sub.prop(rd, "edge_threshold", text="Threshold", slider=True)
356         sub.prop(rd, "edge_color", text="")
357
358
359 class RENDER_PT_stamp(RenderButtonsPanel, Panel):
360     bl_label = "Metadata"
361     bl_options = {'DEFAULT_CLOSED'}
362     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
363
364     def draw(self, context):
365         layout = self.layout
366
367         rd = context.scene.render
368
369         layout.prop(rd, "use_stamp")
370         col = layout.column()
371         col.active = rd.use_stamp
372         row = col.row()
373         row.prop(rd, "stamp_font_size", text="Font Size")
374         row.prop(rd, "use_stamp_labels", text="Draw Labels")
375
376         row = col.row()
377         row.column().prop(rd, "stamp_foreground", slider=True)
378         row.column().prop(rd, "stamp_background", slider=True)
379
380         layout.label("Enabled Metadata")
381         split = layout.split()
382
383         col = split.column()
384         col.prop(rd, "use_stamp_time", text="Time")
385         col.prop(rd, "use_stamp_date", text="Date")
386         col.prop(rd, "use_stamp_render_time", text="RenderTime")
387         col.prop(rd, "use_stamp_frame", text="Frame")
388         col.prop(rd, "use_stamp_scene", text="Scene")
389         col.prop(rd, "use_stamp_memory", text="Memory")
390
391         col = split.column()
392         col.prop(rd, "use_stamp_camera", text="Camera")
393         col.prop(rd, "use_stamp_lens", text="Lens")
394         col.prop(rd, "use_stamp_filename", text="Filename")
395         col.prop(rd, "use_stamp_marker", text="Marker")
396         col.prop(rd, "use_stamp_sequencer_strip", text="Seq. Strip")
397
398         row = layout.split(percentage=0.2)
399         row.prop(rd, "use_stamp_note", text="Note")
400         sub = row.row()
401         sub.active = rd.use_stamp_note
402         sub.prop(rd, "stamp_note_text", text="")
403         if rd.use_sequencer:
404             layout.label("Sequencer:")
405             layout.prop(rd, "use_stamp_strip_meta")
406
407
408 class RENDER_PT_output(RenderButtonsPanel, Panel):
409     bl_label = "Output"
410     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
411
412     def draw(self, context):
413         layout = self.layout
414
415         rd = context.scene.render
416         image_settings = rd.image_settings
417         file_format = image_settings.file_format
418
419         layout.prop(rd, "filepath", text="")
420
421         split = layout.split()
422
423         col = split.column()
424         col.active = not rd.is_movie_format
425         col.prop(rd, "use_overwrite")
426         col.prop(rd, "use_placeholder")
427
428         col = split.column()
429         col.prop(rd, "use_file_extension")
430         col.prop(rd, "use_render_cache")
431
432         layout.template_image_settings(image_settings, color_management=False)
433         if rd.use_multiview:
434             layout.template_image_views(image_settings)
435
436
437 class RENDER_PT_encoding(RenderButtonsPanel, Panel):
438     bl_label = "Encoding"
439     bl_options = {'DEFAULT_CLOSED'}
440     COMPAT_ENGINES = {'BLENDER_RENDER'}
441
442     @classmethod
443     def poll(cls, context):
444         rd = context.scene.render
445         return rd.image_settings.file_format in {'FFMPEG', 'XVID', 'H264', 'THEORA'}
446
447     def draw(self, context):
448         layout = self.layout
449
450         rd = context.scene.render
451         ffmpeg = rd.ffmpeg
452
453         layout.menu("RENDER_MT_ffmpeg_presets", text="Presets")
454
455         split = layout.split()
456         split.prop(rd.ffmpeg, "format")
457         split.prop(ffmpeg, "use_autosplit")
458
459         layout.separator()
460
461         needs_codec = ffmpeg.format in {'AVI', 'QUICKTIME', 'MKV', 'OGG', 'MPEG4'}
462         if needs_codec:
463             layout.prop(ffmpeg, "codec")
464
465         if ffmpeg.codec in {'DNXHD'}:
466             layout.prop(ffmpeg, "use_lossless_output")
467
468         # Output quality
469         if needs_codec and ffmpeg.codec in {'H264', 'MPEG4'}:
470             layout.prop(ffmpeg, "constant_rate_factor")
471
472         # Encoding speed
473         layout.prop(ffmpeg, "ffmpeg_preset")
474         # I-frames
475         layout.prop(ffmpeg, "gopsize")
476         # B-Frames
477         row = layout.row()
478         row.prop(ffmpeg, "use_max_b_frames", text="Max B-frames")
479         pbox = row.split()
480         pbox.prop(ffmpeg, "max_b_frames", text="")
481         pbox.enabled = ffmpeg.use_max_b_frames
482
483         if ffmpeg.constant_rate_factor == 'NONE':
484             split = layout.split()
485             col = split.column()
486             col.label(text="Rate:")
487             col.prop(ffmpeg, "video_bitrate")
488             col.prop(ffmpeg, "minrate", text="Minimum")
489             col.prop(ffmpeg, "maxrate", text="Maximum")
490             col.prop(ffmpeg, "buffersize", text="Buffer")
491
492             col = split.column()
493             col.label(text="Mux:")
494             col.prop(ffmpeg, "muxrate", text="Rate")
495             col.prop(ffmpeg, "packetsize", text="Packet Size")
496
497         layout.separator()
498
499         # Audio:
500         if ffmpeg.format != 'MP3':
501             layout.prop(ffmpeg, "audio_codec", text="Audio Codec")
502
503         if ffmpeg.audio_codec != 'NONE':
504             row = layout.row()
505             row.prop(ffmpeg, "audio_bitrate")
506             row.prop(ffmpeg, "audio_volume", slider=True)
507
508
509 class RENDER_PT_bake(RenderButtonsPanel, Panel):
510     bl_label = "Bake"
511     bl_options = {'DEFAULT_CLOSED'}
512     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
513
514     def draw(self, context):
515         layout = self.layout
516
517         rd = context.scene.render
518
519         layout.operator("object.bake_image", icon='RENDER_STILL')
520
521         layout.prop(rd, "bake_type")
522
523         multires_bake = False
524         if rd.bake_type in ['NORMALS', 'DISPLACEMENT', 'DERIVATIVE', 'AO']:
525             layout.prop(rd, "use_bake_multires")
526             multires_bake = rd.use_bake_multires
527
528         if not multires_bake:
529             if rd.bake_type == 'NORMALS':
530                 layout.prop(rd, "bake_normal_space")
531             elif rd.bake_type in {'DISPLACEMENT', 'AO'}:
532                 layout.prop(rd, "use_bake_normalize")
533
534             # col.prop(rd, "bake_aa_mode")
535             # col.prop(rd, "use_bake_antialiasing")
536
537             layout.separator()
538
539             split = layout.split()
540
541             col = split.column()
542             col.prop(rd, "use_bake_to_vertex_color")
543             sub = col.column()
544             sub.active = not rd.use_bake_to_vertex_color
545             sub.prop(rd, "use_bake_clear")
546             sub.prop(rd, "bake_margin")
547             sub.prop(rd, "bake_quad_split", text="Split")
548
549             col = split.column()
550             col.prop(rd, "use_bake_selected_to_active")
551             sub = col.column()
552             sub.active = rd.use_bake_selected_to_active
553             sub.prop(rd, "bake_distance")
554             sub.prop(rd, "bake_bias")
555         else:
556             split = layout.split()
557
558             col = split.column()
559             col.prop(rd, "use_bake_clear")
560             col.prop(rd, "bake_margin")
561
562             if rd.bake_type == 'DISPLACEMENT':
563                 col = split.column()
564                 col.prop(rd, "use_bake_lores_mesh")
565
566             if rd.bake_type == 'AO':
567                 col = split.column()
568                 col.prop(rd, "bake_bias")
569                 col.prop(rd, "bake_samples")
570
571         if rd.bake_type == 'DERIVATIVE':
572             row = layout.row()
573             row.prop(rd, "use_bake_user_scale", text="")
574
575             sub = row.column()
576             sub.active = rd.use_bake_user_scale
577             sub.prop(rd, "bake_user_scale", text="User Scale")
578
579
580 class RENDER_PT_clay_layer_settings(RenderButtonsPanel, Panel):
581     bl_label = "Clay Layer Settings"
582     COMPAT_ENGINES = {'BLENDER_CLAY'}
583
584     def draw(self, context):
585         layout = self.layout
586         props = context.scene.layer_properties['BLENDER_CLAY']
587
588         col = layout.column()
589         col.prop(props, "ssao_samples")
590
591
592 class RENDER_PT_clay_collection_settings(RenderButtonsPanel, Panel):
593     bl_label = "Clay Collection Settings"
594     COMPAT_ENGINES = {'BLENDER_CLAY'}
595
596     def draw(self, context):
597         layout = self.layout
598         props = context.scene.collection_properties['BLENDER_CLAY']
599
600         col = layout.column()
601         col.template_icon_view(props, "matcap_icon")
602         col.prop(props, "matcap_rotation")
603         col.prop(props, "matcap_hue")
604         col.prop(props, "matcap_saturation")
605         col.prop(props, "matcap_value")
606         col.prop(props, "ssao_factor_cavity")
607         col.prop(props, "ssao_factor_edge")
608         col.prop(props, "ssao_distance")
609         col.prop(props, "ssao_attenuation")
610         col.prop(props, "hair_brightness_randomness")
611
612
613 class RENDER_PT_eevee_ambient_occlusion(RenderButtonsPanel, Panel):
614     bl_label = "Ambient Occlusion"
615     bl_options = {'DEFAULT_CLOSED'}
616     COMPAT_ENGINES = {'BLENDER_EEVEE'}
617
618     @classmethod
619     def poll(cls, context):
620         scene = context.scene
621         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
622
623     def draw_header(self, context):
624         scene = context.scene
625         props = scene.layer_properties['BLENDER_EEVEE']
626         self.layout.prop(props, "gtao_enable", text="")
627
628     def draw(self, context):
629         layout = self.layout
630         scene = context.scene
631         props = scene.layer_properties['BLENDER_EEVEE']
632
633         layout.active = props.gtao_enable
634         col = layout.column()
635         col.prop(props, "gtao_use_bent_normals")
636         col.prop(props, "gtao_denoise")
637         col.prop(props, "gtao_bounce")
638         col.prop(props, "gtao_samples")
639         col.prop(props, "gtao_distance")
640         col.prop(props, "gtao_factor")
641         col.prop(props, "gtao_quality")
642
643
644 class RENDER_PT_eevee_motion_blur(RenderButtonsPanel, Panel):
645     bl_label = "Motion Blur"
646     bl_options = {'DEFAULT_CLOSED'}
647     COMPAT_ENGINES = {'BLENDER_EEVEE'}
648
649     @classmethod
650     def poll(cls, context):
651         scene = context.scene
652         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
653
654     def draw_header(self, context):
655         scene = context.scene
656         props = scene.layer_properties['BLENDER_EEVEE']
657         self.layout.prop(props, "motion_blur_enable", text="")
658
659     def draw(self, context):
660         layout = self.layout
661         scene = context.scene
662         props = scene.layer_properties['BLENDER_EEVEE']
663
664         layout.active = props.motion_blur_enable
665         col = layout.column()
666         col.prop(props, "motion_blur_samples")
667         col.prop(props, "motion_blur_shutter")
668
669
670 class RENDER_PT_eevee_depth_of_field(RenderButtonsPanel, Panel):
671     bl_label = "Depth of Field"
672     bl_options = {'DEFAULT_CLOSED'}
673     COMPAT_ENGINES = {'BLENDER_EEVEE'}
674
675     @classmethod
676     def poll(cls, context):
677         scene = context.scene
678         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
679
680     def draw_header(self, context):
681         scene = context.scene
682         props = scene.layer_properties['BLENDER_EEVEE']
683         self.layout.prop(props, "dof_enable", text="")
684
685     def draw(self, context):
686         layout = self.layout
687         scene = context.scene
688         props = scene.layer_properties['BLENDER_EEVEE']
689
690         layout.active = props.dof_enable
691         col = layout.column()
692         col.prop(props, "bokeh_max_size")
693         col.prop(props, "bokeh_threshold")
694
695
696 class RENDER_PT_eevee_bloom(RenderButtonsPanel, Panel):
697     bl_label = "Bloom"
698     bl_options = {'DEFAULT_CLOSED'}
699     COMPAT_ENGINES = {'BLENDER_EEVEE'}
700
701     @classmethod
702     def poll(cls, context):
703         scene = context.scene
704         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
705
706     def draw_header(self, context):
707         scene = context.scene
708         props = scene.layer_properties['BLENDER_EEVEE']
709         self.layout.prop(props, "bloom_enable", text="")
710
711     def draw(self, context):
712         layout = self.layout
713         scene = context.scene
714         props = scene.layer_properties['BLENDER_EEVEE']
715
716         layout.active = props.bloom_enable
717         col = layout.column()
718         col.prop(props, "bloom_threshold")
719         col.prop(props, "bloom_knee")
720         col.prop(props, "bloom_radius")
721         col.prop(props, "bloom_color")
722         col.prop(props, "bloom_intensity")
723         col.prop(props, "bloom_clamp")
724
725
726 class RENDER_PT_eevee_volumetric(RenderButtonsPanel, Panel):
727     bl_label = "Volumetric"
728     bl_options = {'DEFAULT_CLOSED'}
729     COMPAT_ENGINES = {'BLENDER_EEVEE'}
730
731     @classmethod
732     def poll(cls, context):
733         scene = context.scene
734         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
735
736     def draw_header(self, context):
737         scene = context.scene
738         props = scene.layer_properties['BLENDER_EEVEE']
739         self.layout.prop(props, "volumetric_enable", text="")
740
741     def draw(self, context):
742         layout = self.layout
743         scene = context.scene
744         props = scene.layer_properties['BLENDER_EEVEE']
745
746         layout.active = props.volumetric_enable
747         col = layout.column()
748         col.prop(props, "volumetric_start")
749         col.prop(props, "volumetric_end")
750         col.prop(props, "volumetric_tile_size")
751         col.prop(props, "volumetric_samples")
752         col.prop(props, "volumetric_sample_distribution")
753         col.prop(props, "volumetric_lights")
754         col.prop(props, "volumetric_light_clamp")
755         col.prop(props, "volumetric_shadows")
756         col.prop(props, "volumetric_shadow_samples")
757         col.prop(props, "volumetric_colored_transmittance")
758
759
760 class RENDER_PT_eevee_subsurface_scattering(RenderButtonsPanel, Panel):
761     bl_label = "Subsurface Scattering"
762     bl_options = {'DEFAULT_CLOSED'}
763     COMPAT_ENGINES = {'BLENDER_EEVEE'}
764
765     @classmethod
766     def poll(cls, context):
767         scene = context.scene
768         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
769
770     def draw_header(self, context):
771         scene = context.scene
772         props = scene.layer_properties['BLENDER_EEVEE']
773         self.layout.prop(props, "sss_enable", text="")
774
775     def draw(self, context):
776         layout = self.layout
777         scene = context.scene
778         props = scene.layer_properties['BLENDER_EEVEE']
779
780         col = layout.column()
781         col.prop(props, "sss_samples")
782         col.prop(props, "sss_jitter_threshold")
783
784
785 class RENDER_PT_eevee_screen_space_reflections(RenderButtonsPanel, Panel):
786     bl_label = "Screen Space Reflections"
787     bl_options = {'DEFAULT_CLOSED'}
788     COMPAT_ENGINES = {'BLENDER_EEVEE'}
789
790     @classmethod
791     def poll(cls, context):
792         scene = context.scene
793         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
794
795     def draw_header(self, context):
796         scene = context.scene
797         props = scene.layer_properties['BLENDER_EEVEE']
798         self.layout.prop(props, "ssr_enable", text="")
799
800     def draw(self, context):
801         layout = self.layout
802         scene = context.scene
803         props = scene.layer_properties['BLENDER_EEVEE']
804
805         col = layout.column()
806         col.active = props.ssr_enable
807         col.prop(props, "ssr_refraction")
808         col.prop(props, "ssr_halfres")
809         col.prop(props, "ssr_ray_count")
810         col.prop(props, "ssr_quality")
811         col.prop(props, "ssr_max_roughness")
812         col.prop(props, "ssr_thickness")
813         col.prop(props, "ssr_border_fade")
814         col.prop(props, "ssr_firefly_fac")
815
816
817 class RENDER_PT_eevee_shadows(RenderButtonsPanel, Panel):
818     bl_label = "Shadows"
819     bl_options = {'DEFAULT_CLOSED'}
820     COMPAT_ENGINES = {'BLENDER_EEVEE'}
821
822     @classmethod
823     def poll(cls, context):
824         scene = context.scene
825         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
826
827     def draw(self, context):
828         layout = self.layout
829         scene = context.scene
830         props = scene.layer_properties['BLENDER_EEVEE']
831
832         col = layout.column()
833         col.prop(props, "shadow_method")
834         col.prop(props, "shadow_size")
835         col.prop(props, "shadow_high_bitdepth")
836
837
838 class RENDER_PT_eevee_sampling(RenderButtonsPanel, Panel):
839     bl_label = "Sampling"
840     bl_options = {'DEFAULT_CLOSED'}
841     COMPAT_ENGINES = {'BLENDER_EEVEE'}
842
843     @classmethod
844     def poll(cls, context):
845         scene = context.scene
846         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
847
848     def draw(self, context):
849         layout = self.layout
850         scene = context.scene
851         props = scene.layer_properties['BLENDER_EEVEE']
852
853         col = layout.column()
854         col.prop(props, "taa_samples")
855
856
857 class RENDER_PT_eevee_indirect_lighting(RenderButtonsPanel, Panel):
858     bl_label = "Indirect Lighting"
859     bl_options = {'DEFAULT_CLOSED'}
860     COMPAT_ENGINES = {'BLENDER_EEVEE'}
861
862     @classmethod
863     def poll(cls, context):
864         scene = context.scene
865         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
866
867     def draw(self, context):
868         layout = self.layout
869         scene = context.scene
870         props = scene.layer_properties['BLENDER_EEVEE']
871
872         col = layout.column()
873         col.prop(props, "gi_diffuse_bounces")
874         col.prop(props, "gi_cubemap_resolution")
875
876
877 classes = (
878     RENDER_MT_presets,
879     RENDER_MT_ffmpeg_presets,
880     RENDER_MT_framerate_presets,
881     RENDER_PT_context,
882     RENDER_PT_render,
883     RENDER_PT_dimensions,
884     RENDER_PT_antialiasing,
885     RENDER_PT_motion_blur,
886     RENDER_PT_shading,
887     RENDER_PT_performance,
888     RENDER_PT_post_processing,
889     RENDER_PT_stamp,
890     RENDER_PT_output,
891     RENDER_PT_encoding,
892     RENDER_PT_bake,
893     RENDER_PT_clay_layer_settings,
894     RENDER_PT_clay_collection_settings,
895     RENDER_PT_eevee_sampling,
896     RENDER_PT_eevee_shadows,
897     RENDER_PT_eevee_indirect_lighting,
898     RENDER_PT_eevee_subsurface_scattering,
899     RENDER_PT_eevee_screen_space_reflections,
900     RENDER_PT_eevee_ambient_occlusion,
901     RENDER_PT_eevee_volumetric,
902     RENDER_PT_eevee_motion_blur,
903     RENDER_PT_eevee_depth_of_field,
904     RENDER_PT_eevee_bloom,
905 )
906
907 if __name__ == "__main__":  # only for live edit.
908     from bpy.utils import register_class
909     for cls in classes:
910         register_class(cls)