AExperimentFrameCaptureCamera¶
An actor that captures rendered frames from the scene to disk or to memory.
Syntax¶
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¶
AActor → AExperimentFrameCaptureCamera
Methods¶
| Method | Signature | Description | Blueprint |
|---|---|---|---|
| AExperimentFrameCaptureCamera | AExperimentFrameCaptureCamera::AExperimentFrameCaptureCamera(const FObjectInitializer &objectInitializer) |
Constructs the camera actor and creates all sub-components (scene capture, mesh frustum, render target). | |
| ApplyPostProcessEffect | void AExperimentFrameCaptureCamera::ApplyPostProcessEffect() |
Configures the capture component for the current post-process effect: clears existing blendables and adds the effect's material, loading it on first use. | |
| AttachToActor | void AExperimentFrameCaptureCamera::AttachToActor(AActor *targetActor) |
Attaches this camera to the given actor so it follows its transform. | |
| BeginPlay | void AExperimentFrameCaptureCamera::BeginPlay() override |
Called when the game starts. | |
| EndPlay | void AExperimentFrameCaptureCamera::EndPlay(const EEndPlayReason::Type endPlayReason) override |
Called when the actor is removed from the world. | |
| GetFOVAngle | float AExperimentFrameCaptureCamera::GetFOVAngle() const |
Returns the camera's horizontal field-of-view angle. | |
| GetImageSizeX | uint32 AExperimentFrameCaptureCamera::GetImageSizeX() const |
Returns the configured capture image width in pixels. | |
| GetImageSizeY | uint32 AExperimentFrameCaptureCamera::GetImageSizeY() const |
Returns the configured capture image height in pixels. | |
| GetPostProcessEffect | EExperimentPostProcessEffect AExperimentFrameCaptureCamera::GetPostProcessEffect() const |
Returns the active post-process rendering mode. | |
| InitCaptureRender | void AExperimentFrameCaptureCamera::InitCaptureRender() |
Creates and configures the UTextureRenderTarget2D used as the capture destination. | |
| PostActorCreated | void AExperimentFrameCaptureCamera::PostActorCreated() override |
Called after the actor is created. | |
| ReadPixels | bool AExperimentFrameCaptureCamera::ReadPixels(TArray< FColor > &bitMap) const |
Reads the most recently captured frame into a pixel array. | |
| SaveCaptureToDisk | bool AExperimentFrameCaptureCamera::SaveCaptureToDisk(const FString &filePath) |
Captures the current scene and saves it to a PNG file at the given path. | yes |
| SaveNextFrame | bool AExperimentFrameCaptureCamera::SaveNextFrame() |
Requests that the next available frame be saved to the configured folder. | |
| SetFOVAngle | void AExperimentFrameCaptureCamera::SetFOVAngle(float angle) |
Sets the horizontal field-of-view angle. | |
| SetImageSize | void AExperimentFrameCaptureCamera::SetImageSize(uint32 newSizeX, uint32 newSizeY) |
Sets the capture resolution. | |
| SetPostProcessEffect | void AExperimentFrameCaptureCamera::SetPostProcessEffect(EExperimentPostProcessEffect effect) |
Applies the given post-process effect to all subsequently captured frames. | |
| SetSaveFolder | void AExperimentFrameCaptureCamera::SetSaveFolder(const FString &folder) |
Sets the folder where automatically captured frames are saved. | |
| SetTargetGamma | void AExperimentFrameCaptureCamera::SetTargetGamma(float gamma) |
Sets the target gamma for captured images. | |
| Tick | void AExperimentFrameCaptureCamera::Tick(float deltaSeconds) override |
Called every frame. |
Properties¶
| Property | Type | Description | Blueprint |
|---|---|---|---|
| CameraName | FString |
Camera name from the settings file. | yes |
| CapturesPerSecond | float |
Maximum number of frames per second to capture. | 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 |