forked from blender/blender-addons
Implement transparent background for Storm delegate #21
@ -33,6 +33,14 @@ class StormHydraRenderEngine(bpy_hydra.HydraRenderEngine):
|
||||
'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((
|
||||
StormHydraRenderEngine,
|
||||
))
|
||||
|
@ -48,6 +48,11 @@ class RenderProperties(bpy.types.PropertyGroup):
|
||||
description="Limit maximum number of lights",
|
||||
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):
|
||||
|
@ -58,6 +58,21 @@ class STORM_HYDRA_RENDER_PT_volume_final(bpy.types.Panel):
|
||||
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
|
||||
#
|
||||
@ -96,6 +111,21 @@ class STORM_HYDRA_RENDER_PT_volume_viewport(bpy.types.Panel):
|
||||
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):
|
||||
"""Physical light sources"""
|
||||
bl_label = "Light"
|
||||
@ -152,8 +182,11 @@ class STORM_HYDRA_LIGHT_PT_light(Panel):
|
||||
register_classes, unregister_classes = bpy.utils.register_classes_factory((
|
||||
STORM_HYDRA_RENDER_PT_final,
|
||||
STORM_HYDRA_RENDER_PT_volume_final,
|
||||
STORM_HYDRA_RENDER_PT_film_final,
|
||||
STORM_HYDRA_RENDER_PT_viewport,
|
||||
STORM_HYDRA_RENDER_PT_volume_viewport,
|
||||
STORM_HYDRA_RENDER_PT_film_viewport,
|
||||
|
||||
|
||||
STORM_HYDRA_LIGHT_PT_light,
|
||||
))
|
||||
|
Loading…
Reference in New Issue
Block a user