Implement transparent background for Storm delegate #21

Merged
Bogdan Nagirniak merged 4 commits from Vasyl-Pidhirskyi/blender-addons:BLEN-463 into storm-hydra-addon 2023-07-23 21:01:37 +02:00
3 changed files with 15 additions and 46 deletions
Showing only changes of commit b216fe22c4 - Show all commits

View File

@ -33,13 +33,6 @@ class StormHydraRenderEngine(bpy_hydra.HydraRenderEngine):
'maxLights': settings.max_lights, 'maxLights': settings.max_lights,
} }
def get_sync_settings(self, engine_type):
settings = bpy.context.scene.hydra_storm.viewport if engine_type == 'VIEWPORT' else \
bpy.context.scene.hydra_storm.final
return {
'enableAlpha': settings.enable_alpha,
}
register, unregister = bpy.utils.register_classes_factory(( register, unregister = bpy.utils.register_classes_factory((
StormHydraRenderEngine, StormHydraRenderEngine,

View File

@ -48,11 +48,6 @@ class RenderProperties(bpy.types.PropertyGroup):
description="Limit maximum number of lights", description="Limit maximum number of lights",
default=16, min=0, max=16, default=16, min=0, max=16,
) )
enable_alpha: bpy.props.BoolProperty(
name="Enable Color Alpha",
description="World background is transparent, for compositing the render over another background",
default=False,
)
class SceneProperties(Properties): class SceneProperties(Properties):

View File

@ -58,21 +58,6 @@ class STORM_HYDRA_RENDER_PT_volume_final(bpy.types.Panel):
col.prop(settings, "volume_max_texture_memory_per_field") col.prop(settings, "volume_max_texture_memory_per_field")
class STORM_HYDRA_RENDER_PT_film_final(bpy.types.Panel):
bl_parent_id = STORM_HYDRA_RENDER_PT_final.bl_idname
bl_label = "Film"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
layout.prop(context.scene.hydra_storm.final, "enable_alpha", text="Transparent Background")
# #
# VIEWPORT RENDER SETTINGS # VIEWPORT RENDER SETTINGS
# #
@ -111,21 +96,6 @@ class STORM_HYDRA_RENDER_PT_volume_viewport(bpy.types.Panel):
col.prop(settings, "volume_max_texture_memory_per_field") col.prop(settings, "volume_max_texture_memory_per_field")
class STORM_HYDRA_RENDER_PT_film_viewport(bpy.types.Panel):
bl_parent_id = STORM_HYDRA_RENDER_PT_viewport.bl_idname
bl_label = "Film"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
layout.prop(context.scene.hydra_storm.viewport, "enable_alpha", text="Transparent Background")
class STORM_HYDRA_LIGHT_PT_light(Panel): class STORM_HYDRA_LIGHT_PT_light(Panel):
"""Physical light sources""" """Physical light sources"""
bl_label = "Light" bl_label = "Light"
@ -179,15 +149,26 @@ class STORM_HYDRA_LIGHT_PT_light(Panel):
main_col.prop(light, 'size') main_col.prop(light, 'size')
class STORM_HYDRA_RENDER_PT_film(bpy.types.Panel):
bl_label = "Film"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
layout.prop(context.scene.render, "film_transparent", text="Transparent Background")
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,
STORM_HYDRA_RENDER_PT_film_final,
STORM_HYDRA_RENDER_PT_viewport, STORM_HYDRA_RENDER_PT_viewport,
STORM_HYDRA_RENDER_PT_volume_viewport, STORM_HYDRA_RENDER_PT_volume_viewport,
STORM_HYDRA_RENDER_PT_film_viewport, STORM_HYDRA_RENDER_PT_film,
STORM_HYDRA_LIGHT_PT_light, STORM_HYDRA_LIGHT_PT_light,
)) ))