WIP Make shadows visible for Storm delegate #26

Closed
Vasyl Pidhirskyi wants to merge 2 commits from BLEND-469 into storm-hydra-addon

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Showing only changes of commit aeade3cb95 - Show all commits

View File

@ -6,7 +6,6 @@
import bpy
from .engine import StormHydraRenderEngine
from .preferences import addon_preferences
class Panel(bpy.types.Panel):
@ -98,6 +97,7 @@ class STORM_HYDRA_RENDER_PT_volume_viewport(bpy.types.Panel):
class STORM_HYDRA_LIGHT_PT_light(Panel):
"""Physical light sources"""
bl_idname = 'STORM_HYDRA_LIGHT_PT_light'
bl_label = "Light"
bl_context = 'data'
@ -163,13 +163,64 @@ class STORM_HYDRA_RENDER_PT_film(Panel):
layout.prop(context.scene.render, "film_transparent", text="Transparent Background")
class STORM_HYDRA_RENDER_PT_light_shadows(Panel):
bl_parent_id = STORM_HYDRA_LIGHT_PT_light.bl_idname
bl_label = "Shadow"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
light = context.light
return (
(light and light.type in {'POINT', 'SUN', 'SPOT', 'AREA'})
)
def draw_header(self, context):
light = context.light
self.layout.prop(light, "use_shadow", text="")
def draw(self, context):
layout = self.layout
layout.use_property_split = True
light = context.light
layout.active = light.use_shadow
if light.type == 'SUN':
col = layout.column()
col.prop(light, "shadow_buffer_bias", text="Bias")
col.prop(light, "shadow_cascade_max_distance", text="Max Distance")
col.prop(light, "shadow_cascade_fade", text="Fade")
class STORM_HYDRA_RENDER_PT_shadows(Panel):
bl_label = "Shadows"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
layout = self.layout
layout.use_property_split = True
props = context.scene.eevee
col = layout.column()
col.prop(props, "shadow_cascade_size", text="Cascade Size")
register_classes, unregister_classes = bpy.utils.register_classes_factory((
STORM_HYDRA_RENDER_PT_final,
STORM_HYDRA_RENDER_PT_volume_final,
STORM_HYDRA_RENDER_PT_viewport,
STORM_HYDRA_RENDER_PT_volume_viewport,
STORM_HYDRA_RENDER_PT_film,
STORM_HYDRA_RENDER_PT_shadows,
STORM_HYDRA_LIGHT_PT_light,
STORM_HYDRA_RENDER_PT_light_shadows,
))