Merge commit 'origin/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', '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         use_crf = needs_codec and ffmpeg.codec in {'H264', 'MPEG4'}
473         if use_crf:
474             layout.prop(ffmpeg, "constant_rate_factor")
475
476         # Encoding speed
477         layout.prop(ffmpeg, "ffmpeg_preset")
478         # I-frames
479         layout.prop(ffmpeg, "gopsize")
480         # B-Frames
481         row = layout.row()
482         row.prop(ffmpeg, "use_max_b_frames", text="Max B-frames")
483         pbox = row.split()
484         pbox.prop(ffmpeg, "max_b_frames", text="")
485         pbox.enabled = ffmpeg.use_max_b_frames
486
487         if not use_crf or ffmpeg.constant_rate_factor == 'NONE':
488             split = layout.split()
489             col = split.column()
490             col.label(text="Rate:")
491             col.prop(ffmpeg, "video_bitrate")
492             col.prop(ffmpeg, "minrate", text="Minimum")
493             col.prop(ffmpeg, "maxrate", text="Maximum")
494             col.prop(ffmpeg, "buffersize", text="Buffer")
495
496             col = split.column()
497             col.label(text="Mux:")
498             col.prop(ffmpeg, "muxrate", text="Rate")
499             col.prop(ffmpeg, "packetsize", text="Packet Size")
500
501         layout.separator()
502
503         # Audio:
504         if ffmpeg.format != 'MP3':
505             layout.prop(ffmpeg, "audio_codec", text="Audio Codec")
506
507         if ffmpeg.audio_codec != 'NONE':
508             row = layout.row()
509             row.prop(ffmpeg, "audio_bitrate")
510             row.prop(ffmpeg, "audio_volume", slider=True)
511
512
513 class RENDER_PT_bake(RenderButtonsPanel, Panel):
514     bl_label = "Bake"
515     bl_options = {'DEFAULT_CLOSED'}
516     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
517
518     def draw(self, context):
519         layout = self.layout
520
521         rd = context.scene.render
522
523         layout.operator("object.bake_image", icon='RENDER_STILL')
524
525         layout.prop(rd, "bake_type")
526
527         multires_bake = False
528         if rd.bake_type in ['NORMALS', 'DISPLACEMENT', 'DERIVATIVE', 'AO']:
529             layout.prop(rd, "use_bake_multires")
530             multires_bake = rd.use_bake_multires
531
532         if not multires_bake:
533             if rd.bake_type == 'NORMALS':
534                 layout.prop(rd, "bake_normal_space")
535             elif rd.bake_type in {'DISPLACEMENT', 'AO'}:
536                 layout.prop(rd, "use_bake_normalize")
537
538             # col.prop(rd, "bake_aa_mode")
539             # col.prop(rd, "use_bake_antialiasing")
540
541             layout.separator()
542
543             split = layout.split()
544
545             col = split.column()
546             col.prop(rd, "use_bake_to_vertex_color")
547             sub = col.column()
548             sub.active = not rd.use_bake_to_vertex_color
549             sub.prop(rd, "use_bake_clear")
550             sub.prop(rd, "bake_margin")
551             sub.prop(rd, "bake_quad_split", text="Split")
552
553             col = split.column()
554             col.prop(rd, "use_bake_selected_to_active")
555             sub = col.column()
556             sub.active = rd.use_bake_selected_to_active
557             sub.prop(rd, "bake_distance")
558             sub.prop(rd, "bake_bias")
559         else:
560             split = layout.split()
561
562             col = split.column()
563             col.prop(rd, "use_bake_clear")
564             col.prop(rd, "bake_margin")
565
566             if rd.bake_type == 'DISPLACEMENT':
567                 col = split.column()
568                 col.prop(rd, "use_bake_lores_mesh")
569
570             if rd.bake_type == 'AO':
571                 col = split.column()
572                 col.prop(rd, "bake_bias")
573                 col.prop(rd, "bake_samples")
574
575         if rd.bake_type == 'DERIVATIVE':
576             row = layout.row()
577             row.prop(rd, "use_bake_user_scale", text="")
578
579             sub = row.column()
580             sub.active = rd.use_bake_user_scale
581             sub.prop(rd, "bake_user_scale", text="User Scale")
582
583
584 class RENDER_PT_clay_layer_settings(RenderButtonsPanel, Panel):
585     bl_label = "Clay Layer Settings"
586     COMPAT_ENGINES = {'BLENDER_CLAY'}
587
588     def draw(self, context):
589         layout = self.layout
590         props = context.scene.layer_properties['BLENDER_CLAY']
591
592         col = layout.column()
593         col.prop(props, "ssao_samples")
594
595
596 class RENDER_PT_clay_collection_settings(RenderButtonsPanel, Panel):
597     bl_label = "Clay Collection Settings"
598     COMPAT_ENGINES = {'BLENDER_CLAY'}
599
600     def draw(self, context):
601         layout = self.layout
602         props = context.scene.collection_properties['BLENDER_CLAY']
603
604         col = layout.column()
605         col.template_icon_view(props, "matcap_icon")
606         col.prop(props, "matcap_rotation")
607         col.prop(props, "matcap_hue")
608         col.prop(props, "matcap_saturation")
609         col.prop(props, "matcap_value")
610         col.prop(props, "ssao_factor_cavity")
611         col.prop(props, "ssao_factor_edge")
612         col.prop(props, "ssao_distance")
613         col.prop(props, "ssao_attenuation")
614         col.prop(props, "hair_brightness_randomness")
615
616
617 class RENDER_PT_eevee_ambient_occlusion(RenderButtonsPanel, Panel):
618     bl_label = "Ambient Occlusion"
619     bl_options = {'DEFAULT_CLOSED'}
620     COMPAT_ENGINES = {'BLENDER_EEVEE'}
621
622     @classmethod
623     def poll(cls, context):
624         scene = context.scene
625         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
626
627     def draw_header(self, context):
628         scene = context.scene
629         props = scene.layer_properties['BLENDER_EEVEE']
630         self.layout.prop(props, "gtao_enable", text="")
631
632     def draw(self, context):
633         layout = self.layout
634         scene = context.scene
635         props = scene.layer_properties['BLENDER_EEVEE']
636
637         layout.active = props.gtao_enable
638         col = layout.column()
639         col.prop(props, "gtao_use_bent_normals")
640         col.prop(props, "gtao_bounce")
641         col.prop(props, "gtao_distance")
642         col.prop(props, "gtao_factor")
643         col.prop(props, "gtao_quality")
644
645
646 class RENDER_PT_eevee_motion_blur(RenderButtonsPanel, Panel):
647     bl_label = "Motion Blur"
648     bl_options = {'DEFAULT_CLOSED'}
649     COMPAT_ENGINES = {'BLENDER_EEVEE'}
650
651     @classmethod
652     def poll(cls, context):
653         scene = context.scene
654         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
655
656     def draw_header(self, context):
657         scene = context.scene
658         props = scene.layer_properties['BLENDER_EEVEE']
659         self.layout.prop(props, "motion_blur_enable", text="")
660
661     def draw(self, context):
662         layout = self.layout
663         scene = context.scene
664         props = scene.layer_properties['BLENDER_EEVEE']
665
666         layout.active = props.motion_blur_enable
667         col = layout.column()
668         col.prop(props, "motion_blur_samples")
669         col.prop(props, "motion_blur_shutter")
670
671
672 class RENDER_PT_eevee_depth_of_field(RenderButtonsPanel, Panel):
673     bl_label = "Depth of Field"
674     bl_options = {'DEFAULT_CLOSED'}
675     COMPAT_ENGINES = {'BLENDER_EEVEE'}
676
677     @classmethod
678     def poll(cls, context):
679         scene = context.scene
680         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
681
682     def draw_header(self, context):
683         scene = context.scene
684         props = scene.layer_properties['BLENDER_EEVEE']
685         self.layout.prop(props, "dof_enable", text="")
686
687     def draw(self, context):
688         layout = self.layout
689         scene = context.scene
690         props = scene.layer_properties['BLENDER_EEVEE']
691
692         layout.active = props.dof_enable
693         col = layout.column()
694         col.prop(props, "bokeh_max_size")
695         col.prop(props, "bokeh_threshold")
696
697
698 class RENDER_PT_eevee_bloom(RenderButtonsPanel, Panel):
699     bl_label = "Bloom"
700     bl_options = {'DEFAULT_CLOSED'}
701     COMPAT_ENGINES = {'BLENDER_EEVEE'}
702
703     @classmethod
704     def poll(cls, context):
705         scene = context.scene
706         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
707
708     def draw_header(self, context):
709         scene = context.scene
710         props = scene.layer_properties['BLENDER_EEVEE']
711         self.layout.prop(props, "bloom_enable", text="")
712
713     def draw(self, context):
714         layout = self.layout
715         scene = context.scene
716         props = scene.layer_properties['BLENDER_EEVEE']
717
718         layout.active = props.bloom_enable
719         col = layout.column()
720         col.prop(props, "bloom_threshold")
721         col.prop(props, "bloom_knee")
722         col.prop(props, "bloom_radius")
723         col.prop(props, "bloom_color")
724         col.prop(props, "bloom_intensity")
725         col.prop(props, "bloom_clamp")
726
727
728 class RENDER_PT_eevee_volumetric(RenderButtonsPanel, Panel):
729     bl_label = "Volumetric"
730     bl_options = {'DEFAULT_CLOSED'}
731     COMPAT_ENGINES = {'BLENDER_EEVEE'}
732
733     @classmethod
734     def poll(cls, context):
735         scene = context.scene
736         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
737
738     def draw_header(self, context):
739         scene = context.scene
740         props = scene.layer_properties['BLENDER_EEVEE']
741         self.layout.prop(props, "volumetric_enable", text="")
742
743     def draw(self, context):
744         layout = self.layout
745         scene = context.scene
746         props = scene.layer_properties['BLENDER_EEVEE']
747
748         layout.active = props.volumetric_enable
749         col = layout.column()
750         col.prop(props, "volumetric_start")
751         col.prop(props, "volumetric_end")
752         col.prop(props, "volumetric_tile_size")
753         col.prop(props, "volumetric_samples")
754         col.prop(props, "volumetric_sample_distribution")
755         col.prop(props, "volumetric_lights")
756         col.prop(props, "volumetric_light_clamp")
757         col.prop(props, "volumetric_shadows")
758         col.prop(props, "volumetric_shadow_samples")
759         col.prop(props, "volumetric_colored_transmittance")
760
761
762 class RENDER_PT_eevee_subsurface_scattering(RenderButtonsPanel, Panel):
763     bl_label = "Subsurface Scattering"
764     bl_options = {'DEFAULT_CLOSED'}
765     COMPAT_ENGINES = {'BLENDER_EEVEE'}
766
767     @classmethod
768     def poll(cls, context):
769         scene = context.scene
770         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
771
772     def draw_header(self, context):
773         scene = context.scene
774         props = scene.layer_properties['BLENDER_EEVEE']
775         self.layout.prop(props, "sss_enable", text="")
776
777     def draw(self, context):
778         layout = self.layout
779         scene = context.scene
780         props = scene.layer_properties['BLENDER_EEVEE']
781
782         col = layout.column()
783         col.prop(props, "sss_samples")
784         col.prop(props, "sss_jitter_threshold")
785         col.prop(props, "sss_separate_albedo")
786
787
788 class RENDER_PT_eevee_screen_space_reflections(RenderButtonsPanel, Panel):
789     bl_label = "Screen Space Reflections"
790     bl_options = {'DEFAULT_CLOSED'}
791     COMPAT_ENGINES = {'BLENDER_EEVEE'}
792
793     @classmethod
794     def poll(cls, context):
795         scene = context.scene
796         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
797
798     def draw_header(self, context):
799         scene = context.scene
800         props = scene.layer_properties['BLENDER_EEVEE']
801         self.layout.prop(props, "ssr_enable", text="")
802
803     def draw(self, context):
804         layout = self.layout
805         scene = context.scene
806         props = scene.layer_properties['BLENDER_EEVEE']
807
808         col = layout.column()
809         col.active = props.ssr_enable
810         col.prop(props, "ssr_refraction")
811         col.prop(props, "ssr_halfres")
812         col.prop(props, "ssr_quality")
813         col.prop(props, "ssr_max_roughness")
814         col.prop(props, "ssr_thickness")
815         col.prop(props, "ssr_border_fade")
816         col.prop(props, "ssr_firefly_fac")
817
818
819 class RENDER_PT_eevee_shadows(RenderButtonsPanel, Panel):
820     bl_label = "Shadows"
821     bl_options = {'DEFAULT_CLOSED'}
822     COMPAT_ENGINES = {'BLENDER_EEVEE'}
823
824     @classmethod
825     def poll(cls, context):
826         scene = context.scene
827         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
828
829     def draw(self, context):
830         layout = self.layout
831         scene = context.scene
832         props = scene.layer_properties['BLENDER_EEVEE']
833
834         col = layout.column()
835         col.prop(props, "shadow_method")
836         col.prop(props, "shadow_size")
837         col.prop(props, "shadow_high_bitdepth")
838
839
840 class RENDER_PT_eevee_sampling(RenderButtonsPanel, Panel):
841     bl_label = "Sampling"
842     bl_options = {'DEFAULT_CLOSED'}
843     COMPAT_ENGINES = {'BLENDER_EEVEE'}
844
845     @classmethod
846     def poll(cls, context):
847         scene = context.scene
848         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
849
850     def draw(self, context):
851         layout = self.layout
852         scene = context.scene
853         props = scene.layer_properties['BLENDER_EEVEE']
854
855         col = layout.column()
856         col.prop(props, "taa_samples")
857         col.prop(props, "taa_render_samples")
858
859
860 class RENDER_PT_eevee_indirect_lighting(RenderButtonsPanel, Panel):
861     bl_label = "Indirect Lighting"
862     bl_options = {'DEFAULT_CLOSED'}
863     COMPAT_ENGINES = {'BLENDER_EEVEE'}
864
865     @classmethod
866     def poll(cls, context):
867         scene = context.scene
868         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
869
870     def draw(self, context):
871         layout = self.layout
872         scene = context.scene
873         props = scene.layer_properties['BLENDER_EEVEE']
874
875         col = layout.column()
876         col.prop(props, "gi_diffuse_bounces")
877         col.prop(props, "gi_cubemap_resolution")
878         col.prop(props, "gi_visibility_resolution")
879
880
881 class RENDER_PT_eevee_film(RenderButtonsPanel, Panel):
882     bl_label = "Film"
883     bl_options = {'DEFAULT_CLOSED'}
884     COMPAT_ENGINES = {'BLENDER_EEVEE'}
885
886     @classmethod
887     def poll(cls, context):
888         scene = context.scene
889         return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
890
891     def draw(self, context):
892         layout = self.layout
893         scene = context.scene
894         rd = scene.render
895
896         split = layout.split()
897
898         col = split.column()
899         col.prop(rd, "filter_size")
900
901         col = split.column()
902         col.prop(rd, "alpha_mode", text="Alpha")
903
904
905 classes = (
906     RENDER_MT_presets,
907     RENDER_MT_ffmpeg_presets,
908     RENDER_MT_framerate_presets,
909     RENDER_PT_context,
910     RENDER_PT_render,
911     RENDER_PT_dimensions,
912     RENDER_PT_antialiasing,
913     RENDER_PT_motion_blur,
914     RENDER_PT_shading,
915     RENDER_PT_performance,
916     RENDER_PT_post_processing,
917     RENDER_PT_stamp,
918     RENDER_PT_output,
919     RENDER_PT_encoding,
920     RENDER_PT_bake,
921     RENDER_PT_clay_layer_settings,
922     RENDER_PT_clay_collection_settings,
923     RENDER_PT_eevee_sampling,
924     RENDER_PT_eevee_film,
925     RENDER_PT_eevee_shadows,
926     RENDER_PT_eevee_indirect_lighting,
927     RENDER_PT_eevee_subsurface_scattering,
928     RENDER_PT_eevee_screen_space_reflections,
929     RENDER_PT_eevee_ambient_occlusion,
930     RENDER_PT_eevee_volumetric,
931     RENDER_PT_eevee_motion_blur,
932     RENDER_PT_eevee_depth_of_field,
933     RENDER_PT_eevee_bloom,
934 )
935
936 if __name__ == "__main__":  # only for live edit.
937     from bpy.utils import register_class
938     for cls in classes:
939         register_class(cls)