RendererUnreal

Inheritance diagram of RendererUnreal

Inheritance diagram


class xrfeitoria.renderer.renderer_unreal.RendererUnreal[source]

Renderer class for Unreal.

classmethod add_job(map_path: str, sequence_path: str, output_path: str | Path, resolution: Tuple[int, int], render_passes: List[RenderPass], file_name_format: str = '{sequence_name}/{render_pass}/{camera_name}/{frame_number}', console_variables: Dict[str, float] = {'r.MotionBlurQuality': 0}, anti_aliasing: AntiAliasSetting | None = None, export_audio: bool = False, export_transparent: bool = False) None[source]

Add a rendering job to the renderer queue.

Parameters:
  • map_path (str) – Path to the map file.

  • sequence_path (str) – Path to the sequence file.

  • output_path (PathLike) – Path to the output folder.

  • resolution (Tuple[int, int]) – Resolution of the output image.

  • render_passes (List[RenderPass]) – Render passes to render.

  • file_name_format (str, optional) – File name format of the output image. Defaults to {sequence_name}/{render_pass}/{camera_name}/{frame_number}.

  • console_variables (Dict[str, float], optional) – Console variables to set. Defaults to {'r.MotionBlurQuality': 0}. Ref to What is console_variables for details.

  • anti_aliasing (Optional[RenderJobUnreal.AntiAliasSetting], optional) – Anti aliasing setting. Defaults to None.

  • export_audio (bool, optional) – Whether to export audio. Defaults to False.

  • export_transparent (bool, optional) – Whether to export transparent images. Defaults to False. When enabled, it will reduce the performance.

Note

The motion blur is turned off by default. If you want to turn it on, please set r.MotionBlurQuality to a non-zero value in console_variables.

classmethod clear()

Clear all rendering jobs in the renderer queue.

classmethod render_jobs() None[source]

Render all jobs in the renderer queue.

This method starts the rendering process by setting up a socket connection with the Unreal Engine, rendering the all the render jobs, and then waiting for the engine to send a message indicating that the rendering is complete. If the engine crashes during the rendering process, an error message is logged and the program exits with an error code.

After the rendering is complete, the renderer will perform post-processing in the output_path, including converting camera parameters, vertices, and actor_infos.

Also, this method will clear the render queue after rendering.

classmethod save_queue(path: str | Path) None[source]

Saves the current render queue to a manifest file at the specified path.

Parameters:

path (PathLike) – The path to save the manifest file to.