Support more AOVs #23

Merged
Bogdan Nagirniak merged 4 commits from DagerD/blender-addons:BLEN-461 into storm-hydra-addon 2023-07-29 14:58:37 +02:00
2 changed files with 39 additions and 1 deletions

View File

@ -18,7 +18,7 @@ class StormHydraRenderEngine(bpy.types.HydraRenderEngine):
def get_render_settings(self, engine_type): def get_render_settings(self, engine_type):
settings = bpy.context.scene.hydra_storm.viewport if engine_type == 'VIEWPORT' else \ settings = bpy.context.scene.hydra_storm.viewport if engine_type == 'VIEWPORT' else \
bpy.context.scene.hydra_storm.final bpy.context.scene.hydra_storm.final
return { result = {
'enableTinyPrimCulling': settings.enable_tiny_prim_culling, 'enableTinyPrimCulling': settings.enable_tiny_prim_culling,
'volumeRaymarchingStepSize': settings.volume_raymarching_step_size, 'volumeRaymarchingStepSize': settings.volume_raymarching_step_size,
'volumeRaymarchingStepSizeLighting': settings.volume_raymarching_step_size_lighting, 'volumeRaymarchingStepSizeLighting': settings.volume_raymarching_step_size_lighting,
@ -26,6 +26,18 @@ class StormHydraRenderEngine(bpy.types.HydraRenderEngine):
'maxLights': settings.max_lights, 'maxLights': settings.max_lights,
} }
if engine_type == 'FINAL':
result |= {
'aovToken:Combined': "color",
'aovToken: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')
register, unregister = bpy.utils.register_classes_factory(( register, unregister = bpy.utils.register_classes_factory((
StormHydraRenderEngine, StormHydraRenderEngine,

View File

@ -163,6 +163,30 @@ class STORM_HYDRA_RENDER_PT_film(Panel):
layout.prop(context.scene.render, "film_transparent", text="Transparent Background") 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(( register_classes, unregister_classes = bpy.utils.register_classes_factory((
STORM_HYDRA_RENDER_PT_final, STORM_HYDRA_RENDER_PT_final,
STORM_HYDRA_RENDER_PT_volume_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_volume_viewport,
STORM_HYDRA_RENDER_PT_film, STORM_HYDRA_RENDER_PT_film,
STORM_HYDRA_LIGHT_PT_light, STORM_HYDRA_LIGHT_PT_light,
STORM_HYDRA_RENDER_PT_passes,
STORM_HYDRA_RENDER_PT_passes_data,
)) ))