Skip to content

AMRIFrameCaptureCamera

An actor that captures rendered frames from the scene to disk or to memory.

Syntax

class AMRIFrameCaptureCamera : public AActor

Remarks

Attach to the replicated player pawn during demo playback to render frames depth maps, semantic segmentation images, or surface normals during demo playback. Configure the post-process mode, resolution, FOV, and capture rate in the editor or at runtime. UCLASS

Inheritance Hierarchy

AActorAMRIFrameCaptureCamera

Methods

Method Signature Description Blueprint
AMRIFrameCaptureCamera AMRIFrameCaptureCamera::AMRIFrameCaptureCamera(const FObjectInitializer &objectInitializer) Constructs the camera actor and creates all sub-components (scene capture, mesh frustum, render target).
AttachToActor void AMRIFrameCaptureCamera::AttachToActor(AActor *targetActor) Attaches this camera to the given actor so it follows its transform.
BeginPlay void AMRIFrameCaptureCamera::BeginPlay() override Called when the game starts.
EndPlay void AMRIFrameCaptureCamera::EndPlay(const EEndPlayReason::Type endPlayReason) override Called when the actor is removed from the world.
GetFOVAngle float AMRIFrameCaptureCamera::GetFOVAngle() const Returns the camera's horizontal field-of-view angle.
GetImageSizeX uint32 AMRIFrameCaptureCamera::GetImageSizeX() const Returns the configured capture image width in pixels.
GetImageSizeY uint32 AMRIFrameCaptureCamera::GetImageSizeY() const Returns the configured capture image height in pixels.
GetPostProcessEffect EMRIPostProcessEffect AMRIFrameCaptureCamera::GetPostProcessEffect() const Returns the active post-process rendering mode.
InitCaptureRender void AMRIFrameCaptureCamera::InitCaptureRender() Creates and configures the UTextureRenderTarget2D used as the capture destination.
PostActorCreated void AMRIFrameCaptureCamera::PostActorCreated() override Called after the actor is created.
ReadPixels bool AMRIFrameCaptureCamera::ReadPixels(TArray< FColor > &bitMap) const Reads the most recently captured frame into a pixel array.
SaveCaptureToDisk bool AMRIFrameCaptureCamera::SaveCaptureToDisk(const FString &filePath) Captures the current scene and saves it to a PNG file at the given path. yes
SaveNextFrame bool AMRIFrameCaptureCamera::SaveNextFrame() Requests that the next available frame be saved to the configured folder.
SetFOVAngle void AMRIFrameCaptureCamera::SetFOVAngle(float angle) Sets the horizontal field-of-view angle.
SetImageSize void AMRIFrameCaptureCamera::SetImageSize(uint32 newSizeX, uint32 newSizeY) Sets the capture resolution.
SetPostProcessEffect void AMRIFrameCaptureCamera::SetPostProcessEffect(EMRIPostProcessEffect effect) Applies the given post-process effect to all subsequently captured frames.
SetSaveFolder void AMRIFrameCaptureCamera::SetSaveFolder(const FString &folder) Sets the folder where automatically captured frames are saved.
SetTargetGamma void AMRIFrameCaptureCamera::SetTargetGamma(float gamma) Sets the target gamma for captured images.
Tick void AMRIFrameCaptureCamera::Tick(float deltaSeconds) override Called every frame.

Properties

Property Type Description Blueprint
CapturesPerSecond float Maximum number of frames per second to capture. yes
FileName FString Base filename prefix used for saved frame files. yes
SaveToFolder FString Folder path where captured frames are written when bCaptureScene is true. yes
bCaptureScene bool If true, the camera captures a frame every tick (rate-limited by CapturesPerSecond). yes