13 #include "GameFramework/Actor.h"
14 #include "NVSceneCapturerUtils.h"
15 #include "NVSceneFeatureExtractor.h"
16 #include "NVSceneCapturerViewpointComponent.h"
17 #include "NVImageExporter.h"
18 #include "NVSceneDataHandler.h"
19 #include "NVSceneCapturerActor.generated.h"
21 USTRUCT(BlueprintType)
31 uint32 segmentation_class_id;
34 uint32 segmentation_instance_id;
37 FMatrix fixed_model_transform;
40 FVector cuboid_dimensions;
43 FVector CuboidCenterLocal;
49 USTRUCT(BlueprintType)
56 TArray<FString> exported_object_classes;
59 TArray<FNCapturerSettingExportedActorData> exported_objects;
63 USTRUCT(BlueprintType)
73 uint32 ExportedObjectCount;
76 TArray<FNCapturerSettingExportedActorData> ExportedObjects;
79 USTRUCT(BlueprintType)
99 FMatrix CameraProjectionMatrix;
102 USTRUCT(BlueprintType)
109 TArray<FNVViewpointSettingExportData> camera_settings;
115 DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FNVSceneCapturer_Started,
ANVSceneCapturerActor*, SceneCapturer);
116 DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FNVSceneCapturer_Stopped,
ANVSceneCapturerActor*, SceneCapturer);
117 DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FNVSceneCapturer_Completed,
ANVSceneCapturerActor*, SceneCapturer,
bool, bIsSucceeded);
123 UCLASS(Blueprintable, ClassGroup = (NVIDIA), Config=Engine,
124 HideCategories = (Replication, Tick, Tags, Input, Actor, Rendering, Collision, Physics, Navigation, Shape, Cooking, HLOD, Mobile))
135 UFUNCTION(BlueprintCallable, Category =
"Capturer")
137 UFUNCTION(BlueprintCallable, Category =
"Capturer")
138 int32 GetNumberOfFramesToCapture()
const
140 return NumberOfFramesToCapture;
144 UFUNCTION(BlueprintCallable, Category =
"Capturer")
146 UFUNCTION(BlueprintCallable, Category =
"Capturer")
147 void StopCapturing();
148 UFUNCTION(BlueprintCallable, Category =
"Capturer")
149 void PauseCapturing();
150 UFUNCTION(BlueprintCallable, Category =
"Capturer")
151 void ResumeCapturing();
155 UFUNCTION(BlueprintCallable, Category =
"Capturer")
158 UFUNCTION(BlueprintCallable, Category =
"Capturer")
159 void TakeOverViewport();
160 UFUNCTION(BlueprintCallable, Category =
"Capturer")
161 void ReturnViewportToPlayerController();
163 UFUNCTION(BlueprintCallable, Category =
"Capturer")
164 ENVSceneCapturerState GetCurrentState()
const
170 UFUNCTION(BlueprintCallable, Category =
"Capturer")
173 return CapturedFrameCounter;
177 UFUNCTION(BlueprintCallable, Category =
"Capturer")
179 UFUNCTION(BlueprintCallable, Category = "Capturer")
180 int32 GetNumberOfFramesLeftToCapture() const;
181 UFUNCTION(BlueprintCallable, Category = "Capturer")
182 float GetEstimatedTimeUntilFinishCapturing() const;
183 UFUNCTION(BlueprintCallable, Category = "Capturer")
184 float GetCaptureProgressFraction() const;
185 UFUNCTION(BlueprintCallable, Category = "Capturer")
186 float GetCapturedDuration() const;
188 UFUNCTION(BlueprintCallable, Category = "Capturer")
192 UFUNCTION(BlueprintCallable, Category = "Capturer")
201 UPROPERTY(BlueprintAssignable, Category = "Events")
203 UPROPERTY(BlueprintAssignable, Category = "Events")
204 FNVSceneCapturer_Stopped OnStoppedEvent;
205 UPROPERTY(BlueprintAssignable, Category = "Events")
206 FNVSceneCapturer_Completed OnCompletedEvent;
209 virtual
void PostLoad() final;
210 virtual
void BeginPlay() final;
211 virtual
void EndPlay(const EEndPlayReason::Type EndPlayReason) final;
212 virtual
void PostInitializeComponents() final;
213 virtual
void Tick(
float DeltaTime) final;
214 #if WITH_EDITORONLY_DATA
215 virtual void PostEditChangeProperty(
struct FPropertyChangedEvent& PropertyChangedEvent)
override;
216 void OnActorSelected(UObject* Object);
217 #endif //WITH_EDITORONLY_DATA
220 void UpdateSettingsFromCommandLine();
221 void UpdateViewpointList();
222 void StartCapturing_Internal();
223 void CaptureSceneToPixelsData();
224 void CheckCaptureScene();
225 void UpdateCapturerSettings();
227 bool CanHandleMoreSceneData()
const;
231 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"Capture")
234 UPROPERTY(EditAnywhere, SimpleDisplay, Category = Settings, meta = (ShowOnlyInnerProperties))
238 UPROPERTY(EditAnywhere, SimpleDisplay, Category = FeatureExtraction, meta = (ShowOnlyInnerProperties))
243 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
247 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Capture")
251 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Capture")
256 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Capture", meta=(UIMin=0))
260 UPROPERTY(EditAnywhere, Category = "Capture")
264 UPROPERTY(EditAnywhere, Instanced, BlueprintReadOnly, Category = "Capture")
268 UPROPERTY(EditAnywhere, Instanced, BlueprintReadOnly, Category = "Capture")
272 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Capture")
281 float StartCapturingTimestamp;
284 float CapturedDuration;
287 float StartCapturingDuration;
290 float LastCaptureTimestamp;
296 AActor* CachedPlayerControllerViewTarget;
299 ENVSceneCapturerState CurrentState;
302 int32 NumberOfFramesToCapture;
305 bool bNeedToExportScene;
308 bool bTakingOverViewport;
311 bool bSkipFirstFrame;
314 FTimerHandle TimeHandle_StartCapturingDelay;
UNVSceneCapturerViewpointComponent: Represents each viewpoint from where the capturer captures data...
int32 MaxNumberOfFramesToCapture
Maximum number of scenes (>= 0) to export before stopping NOTE: If TotalNumberOfScenesToExport == 0 t...
float TimeBetweenSceneCapture
NOTE: TimeBetweenSceneExport <= 0 mean export every frame.
TArray< FNVNamedImageSizePreset > ImageSizePresets
List of available image size presets.
class USphereComponent * CollisionComponent
Collision of the capturer actor.
FNVSceneCapturer_Started OnStartedEvent
Event properties.
class UNVSceneDataHandler * SceneDataHandler
Control what to do with the captured scene data.
UNVSceneDataHandler * GetSceneDataHandler() const
Control what to do with the captured scene data.
class UNVSceneDataVisualizer * SceneDataVisualizer
Control what to do with the captured scene data.
float GetCapturedFPS() const
Capturing information.
UNVSceneDataVisualizer * GetSceneDataVisualizer() const
Control what to do with the captured scene data.
TArray< FNVFeatureExtractorSettings > FeatureExtractorSettings
List of the feature extractors this capturer support.
ANVSceneCapturerActor(const FObjectInitializer &ObjectInitializer)
Use SpawnActor() to create this instance.
bool bPauseGameLogicWhenFlushing
If true, the capturer will pause the game logic when it's trying to flushing - handle the scene data ...
bool bAutoStartCapturing
If true, this capturer will automatically start capturing the scene right when the game start (every ...
bool bIsActive
Whether this capturer actor is active and can start capturing or not.
FNVFrameCounter GetCapturedFrameCounter() const
Frame counters.
bool bTakeOverGameViewport
If true, the player's camera will be tied to this exporter's location and rotation.
void StartCapturing()
Capture controls.
NVSceneDataVisualizer - visualize all the captured data (image buffer and object annotation info) usi...
void SetNumberOfFramesToCapture(int32 NewSceneCount)
Setter and Getter for Number of scene to capture.
The scene exporter actor.
bool ToggleTakeOverViewport()
return false means PlayerController view. true means Viewport is taken over.
Base interface for serializing/visualizing captured pixel and annotation data.