EEVEE-Next: Add Raytracing Presets
This PR adds raytracing presets. It contains a preset with default settings and users are able to add their own. Pull Request: https://projects.blender.org/blender/blender/pulls/116223
This commit is contained in:
committed by
Clément Foucault
parent
6692390501
commit
2bb7d767c4
@@ -0,0 +1,14 @@
|
|||||||
|
import bpy
|
||||||
|
eevee = bpy.context.scene.eevee
|
||||||
|
options = eevee.ray_tracing_options
|
||||||
|
|
||||||
|
eevee.ray_tracing_method = 'SCREEN'
|
||||||
|
options.resolution_scale = '2'
|
||||||
|
options.sample_clamp = 10.0
|
||||||
|
options.screen_trace_max_roughness = 0.5
|
||||||
|
options.screen_trace_quality = 0.25
|
||||||
|
options.screen_trace_thickness = 0.20000000298023224
|
||||||
|
options.use_denoise = True
|
||||||
|
options.denoise_spatial = True
|
||||||
|
options.denoise_temporal = True
|
||||||
|
options.denoise_bilateral = True
|
||||||
@@ -515,6 +515,33 @@ class AddPresetTrackingSettings(AddPresetBase, Operator):
|
|||||||
preset_subdir = "tracking_settings"
|
preset_subdir = "tracking_settings"
|
||||||
|
|
||||||
|
|
||||||
|
class AddPresetEEVEERaytracing(AddPresetBase, Operator):
|
||||||
|
"""Add or remove an EEVEE raytracing preset"""
|
||||||
|
bl_idname = "render.eevee_raytracing_preset_add"
|
||||||
|
bl_label = "Add Raytracing Preset"
|
||||||
|
preset_menu = "RENDER_PT_eevee_next_raytracing_presets"
|
||||||
|
|
||||||
|
preset_defines = [
|
||||||
|
"eevee = bpy.context.scene.eevee",
|
||||||
|
"options = eevee.ray_tracing_options"
|
||||||
|
]
|
||||||
|
|
||||||
|
preset_values = [
|
||||||
|
"eevee.ray_tracing_method",
|
||||||
|
"options.resolution_scale",
|
||||||
|
"options.sample_clamp",
|
||||||
|
"options.screen_trace_max_roughness",
|
||||||
|
"options.screen_trace_quality",
|
||||||
|
"options.screen_trace_thickness",
|
||||||
|
"options.use_denoise",
|
||||||
|
"options.denoise_spatial",
|
||||||
|
"options.denoise_temporal",
|
||||||
|
"options.denoise_bilateral",
|
||||||
|
]
|
||||||
|
|
||||||
|
preset_subdir = "eevee/raytracing"
|
||||||
|
|
||||||
|
|
||||||
class AddPresetNodeColor(AddPresetBase, Operator):
|
class AddPresetNodeColor(AddPresetBase, Operator):
|
||||||
"""Add or remove a Node Color Preset"""
|
"""Add or remove a Node Color Preset"""
|
||||||
bl_idname = "node.node_color_preset_add"
|
bl_idname = "node.node_color_preset_add"
|
||||||
@@ -718,6 +745,7 @@ classes = (
|
|||||||
AddPresetTrackingTrackColor,
|
AddPresetTrackingTrackColor,
|
||||||
AddPresetGpencilBrush,
|
AddPresetGpencilBrush,
|
||||||
AddPresetGpencilMaterial,
|
AddPresetGpencilMaterial,
|
||||||
|
AddPresetEEVEERaytracing,
|
||||||
ExecutePreset,
|
ExecutePreset,
|
||||||
WM_MT_operator_presets,
|
WM_MT_operator_presets,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
from bpy.types import Panel
|
from bpy.types import Panel
|
||||||
|
from bl_ui.properties_grease_pencil_common import GreasePencilSimplifyPanel
|
||||||
from bl_ui.space_view3d import (
|
from bl_ui.space_view3d import (
|
||||||
VIEW3D_PT_shading_lighting,
|
VIEW3D_PT_shading_lighting,
|
||||||
VIEW3D_PT_shading_color,
|
VIEW3D_PT_shading_color,
|
||||||
VIEW3D_PT_shading_options,
|
VIEW3D_PT_shading_options,
|
||||||
)
|
)
|
||||||
|
from bl_ui.utils import PresetPanel
|
||||||
from bl_ui.properties_grease_pencil_common import GreasePencilSimplifyPanel
|
|
||||||
|
|
||||||
|
|
||||||
class RenderButtonsPanel:
|
class RenderButtonsPanel:
|
||||||
@@ -555,6 +555,13 @@ class RENDER_PT_eevee_screen_space_reflections(RenderButtonsPanel, Panel):
|
|||||||
col.prop(props, "ssr_firefly_fac")
|
col.prop(props, "ssr_firefly_fac")
|
||||||
|
|
||||||
|
|
||||||
|
class RENDER_PT_eevee_next_raytracing_presets(PresetPanel, Panel):
|
||||||
|
bl_label = "Raytracing Presets"
|
||||||
|
preset_subdir = "eevee/raytracing"
|
||||||
|
preset_operator = "script.execute_preset"
|
||||||
|
preset_add_operator = "render.eevee_raytracing_preset_add"
|
||||||
|
|
||||||
|
|
||||||
class RENDER_PT_eevee_next_raytracing(RenderButtonsPanel, Panel):
|
class RENDER_PT_eevee_next_raytracing(RenderButtonsPanel, Panel):
|
||||||
bl_label = "Raytracing"
|
bl_label = "Raytracing"
|
||||||
bl_options = {'DEFAULT_CLOSED'}
|
bl_options = {'DEFAULT_CLOSED'}
|
||||||
@@ -564,6 +571,9 @@ class RENDER_PT_eevee_next_raytracing(RenderButtonsPanel, Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
return (context.engine in cls.COMPAT_ENGINES)
|
return (context.engine in cls.COMPAT_ENGINES)
|
||||||
|
|
||||||
|
def draw_header_preset(self, _context):
|
||||||
|
RENDER_PT_eevee_next_raytracing_presets.draw_panel_header(self.layout)
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
layout.use_property_split = True
|
layout.use_property_split = True
|
||||||
@@ -1243,6 +1253,7 @@ classes = (
|
|||||||
RENDER_PT_eevee_subsurface_scattering,
|
RENDER_PT_eevee_subsurface_scattering,
|
||||||
RENDER_PT_eevee_screen_space_reflections,
|
RENDER_PT_eevee_screen_space_reflections,
|
||||||
RENDER_PT_eevee_next_horizon_scan,
|
RENDER_PT_eevee_next_horizon_scan,
|
||||||
|
RENDER_PT_eevee_next_raytracing_presets,
|
||||||
RENDER_PT_eevee_next_raytracing,
|
RENDER_PT_eevee_next_raytracing,
|
||||||
RENDER_PT_eevee_next_screen_trace,
|
RENDER_PT_eevee_next_screen_trace,
|
||||||
RENDER_PT_eevee_next_denoise,
|
RENDER_PT_eevee_next_denoise,
|
||||||
|
|||||||
Reference in New Issue
Block a user