From b67c54f8f059c6845f914c8ccf9ff63d5717d05e Mon Sep 17 00:00:00 2001 From: "georgiy.m.markelov@gmail.com" Date: Mon, 24 Jul 2023 14:48:36 +0300 Subject: [PATCH 1/3] Added panel with depth AOV --- hydra_storm/engine.py | 4 ++++ hydra_storm/ui.py | 26 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/hydra_storm/engine.py b/hydra_storm/engine.py index 503042a03..0a0d67281 100644 --- a/hydra_storm/engine.py +++ b/hydra_storm/engine.py @@ -28,6 +28,10 @@ class StormHydraRenderEngine(bpy_hydra.HydraRenderEngine): 'maxLights': settings.max_lights, } + def update_render_passes(self, scene, render_layer): + if render_layer.use_pass_z: + self.register_pass(scene, render_layer, 'Depth', 1, 'Z', 'VALUE') + register, unregister = bpy.utils.register_classes_factory(( StormHydraRenderEngine, diff --git a/hydra_storm/ui.py b/hydra_storm/ui.py index 379f2cf2a..3476e5148 100644 --- a/hydra_storm/ui.py +++ b/hydra_storm/ui.py @@ -163,6 +163,30 @@ class STORM_HYDRA_RENDER_PT_film(bpy.types.Panel): layout.prop(context.scene.render, "film_transparent", text="Transparent Background") +class STORM_HYDRA_RENDER_PT_passes(Panel): + bl_label = "Passes" + bl_context = "view_layer" + + def draw(self, context): + pass + + +class STORM_HYDRA_RENDER_PT_passes_data(Panel): + bl_label = "Data" + bl_context = "view_layer" + bl_parent_id = "STORM_HYDRA_RENDER_PT_passes" + + def draw(self, context): + layout = self.layout + layout.use_property_split = True + layout.use_property_decorate = False + + view_layer = context.view_layer + + col = layout.column(heading="Include", align=True) + col.prop(view_layer, "use_pass_z") + + register_classes, unregister_classes = bpy.utils.register_classes_factory(( STORM_HYDRA_RENDER_PT_final, STORM_HYDRA_RENDER_PT_volume_final, @@ -170,6 +194,8 @@ register_classes, unregister_classes = bpy.utils.register_classes_factory(( STORM_HYDRA_RENDER_PT_volume_viewport, STORM_HYDRA_RENDER_PT_film, STORM_HYDRA_LIGHT_PT_light, + STORM_HYDRA_RENDER_PT_passes, + STORM_HYDRA_RENDER_PT_passes_data, )) -- 2.30.2 From 491efd029b2be280c1d46d583517f50c9a810f6f Mon Sep 17 00:00:00 2001 From: "georgiy.m.markelov@gmail.com" Date: Wed, 26 Jul 2023 20:48:53 +0300 Subject: [PATCH 2/3] Added aovs to get_render_settings --- hydra_storm/engine.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hydra_storm/engine.py b/hydra_storm/engine.py index 0a0d67281..07d68b1bb 100644 --- a/hydra_storm/engine.py +++ b/hydra_storm/engine.py @@ -20,7 +20,7 @@ class StormHydraRenderEngine(bpy_hydra.HydraRenderEngine): def get_render_settings(self, engine_type): settings = bpy.context.scene.hydra_storm.viewport if engine_type == 'VIEWPORT' else \ bpy.context.scene.hydra_storm.final - return { + result = { 'enableTinyPrimCulling': settings.enable_tiny_prim_culling, 'volumeRaymarchingStepSize': settings.volume_raymarching_step_size, 'volumeRaymarchingStepSizeLighting': settings.volume_raymarching_step_size_lighting, @@ -28,6 +28,14 @@ class StormHydraRenderEngine(bpy_hydra.HydraRenderEngine): 'maxLights': settings.max_lights, } + if engine_type == 'FINAL': + result |= { + 'aov:Combined': "color", + 'aov:Depth': "depth", + } + + return result + def update_render_passes(self, scene, render_layer): if render_layer.use_pass_z: self.register_pass(scene, render_layer, 'Depth', 1, 'Z', 'VALUE') -- 2.30.2 From 06840e7fbaa9f81044ea555b372b42f5308162b7 Mon Sep 17 00:00:00 2001 From: "georgiy.m.markelov@gmail.com" Date: Fri, 28 Jul 2023 16:01:06 +0300 Subject: [PATCH 3/3] fix names --- hydra_storm/engine.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hydra_storm/engine.py b/hydra_storm/engine.py index 07d68b1bb..917c161bc 100644 --- a/hydra_storm/engine.py +++ b/hydra_storm/engine.py @@ -30,8 +30,8 @@ class StormHydraRenderEngine(bpy_hydra.HydraRenderEngine): if engine_type == 'FINAL': result |= { - 'aov:Combined': "color", - 'aov:Depth': "depth", + 'aovToken:Combined': "color", + 'aovToken:Depth': "depth", } return result -- 2.30.2