Skip to content

Commit

Permalink
refactor: Add accumulator_includes_alpha parameter to `add_render_p…
Browse files Browse the repository at this point in the history
…asses` method
  • Loading branch information
HaiyiMei committed Aug 7, 2024
1 parent aa9126b commit b8356f7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/XRFeitoriaUnreal/Content/Python/custom_movie_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,20 +106,28 @@ def set_export_audio(movie_preset: unreal.MoviePipelineMasterConfig) -> None:
)

@staticmethod
def add_render_passes(movie_preset: unreal.MoviePipelineMasterConfig, render_passes: List[RenderPass]) -> None:
def add_render_passes(
movie_preset: unreal.MoviePipelineMasterConfig,
render_passes: List[RenderPass],
accumulator_includes_alpha: bool = True,
) -> None:
"""Add render passes to a movie preset.
Args:
movie_preset (unreal.MoviePipelineMasterConfig): The movie preset to add render passes to.
render_passes (List[RenderPass]): The render passes to add.
The available render passes are defined in `UnrealRenderLayerEnum`: `rgb`, `depth`, `mask`, \
`flow`, `diffuse`, `normal`, `metallic`, `roughness`, `specular`, `tangent`, `basecolor`
accumulator_includes_alpha (bool): Whether the accumulator includes alpha.
https://dev.epicgames.com/documentation/en-us/unreal-engine/python-api/class/MoviePipelineDeferredPassBase#unreal.MoviePipelineDeferredPassBase.accumulator_includes_alpha
"""

# find or add setting
render_pass = movie_preset.find_or_add_setting_by_class(unreal.CustomMoviePipelineDeferredPass)
deferred_config = movie_preset.find_or_add_setting_by_class(unreal.CustomMoviePipelineDeferredPass)
render_pass_config = movie_preset.find_or_add_setting_by_class(unreal.CustomMoviePipelineOutput)

# set alpha
deferred_config.accumulator_includes_alpha = accumulator_includes_alpha

# add render passes
additional_render_passes = []
for render_pass in render_passes:
Expand Down

0 comments on commit b8356f7

Please sign in to comment.