unreal.ViewportCapture

class unreal.ViewportCapture(image: ToolsetImage = Ellipsis, camera_location: Vector = Ellipsis, camera_rotation: Rotator = Ellipsis, camera_fov: float = 0.0, grid: ViewportGrid = Ellipsis, labeled_actors: None = [])

Bases: StructBase

Describes the results of a viewport capture. Includes a screenshot of the level viewport plus structured metadata describing the camera. When annotations are enabled, the associated metadata will be populated and the image will include a projected world-space grid and per-actor labels.

C++ Source:

  • Plugin: EditorToolset

  • Module: EditorToolset

  • File: EditorAppToolset.h

Editor Properties: (see get_editor_property/set_editor_property)

  • camera_fov (float): [Read-Write] Level viewport camera field of view, in degrees.

  • camera_location (Vector): [Read-Write] Level viewport camera location (world space, cm).

  • camera_rotation (Rotator): [Read-Write] Level viewport camera rotation (world space).

  • grid (ViewportGrid): [Read-Write] Grid parameters used for the annotation. SpacingCm is zero when the grid was disabled.

  • image (ToolsetImage): [Read-Write] The captured screenshot (PNG encoded as base64). Empty on failure. Pixel dimensions are available via FToolsetImage.

  • labeled_actors (Array[ViewportLabel]): [Read-Write] One entry per labeled actor in the image.

property camera_fov: float

[Read-Only] Level viewport camera field of view, in degrees.

Type:

(float)

property camera_location: Vector

[Read-Only] Level viewport camera location (world space, cm).

Type:

(Vector)

property camera_rotation: Rotator

[Read-Only] Level viewport camera rotation (world space).

Type:

(Rotator)

property grid: ViewportGrid

[Read-Only] Grid parameters used for the annotation. SpacingCm is zero when the grid was disabled.

Type:

(ViewportGrid)

property image: ToolsetImage

[Read-Only] The captured screenshot (PNG encoded as base64). Empty on failure. Pixel dimensions are available via FToolsetImage.

Type:

(ToolsetImage)

property labeled_actors: None

[Read-Only] One entry per labeled actor in the image.

Type:

(Array[ViewportLabel])