Navigation
API > API/Plugins > API/Plugins/Niagara
Recording of multiple frames of simulation data from a running Niagara system. Can be used to play back the captured recording or to inspect the captured data for debug purposes. Depending on the capture settings, not all attributes from the simulation are present in the cache.
To capture a cache, either (1) use the baker tool in the system editor, (2) use the Niagara component cache track in sequencer or (3) manually capture a running system with the "CaptureNiagaraSimCache" Blueprint functions
| Name | UNiagaraSimCache |
| Type | class |
| Header File | /Engine/Plugins/FX/Niagara/Source/Niagara/Classes/NiagaraSimCache.h |
| Include Path | #include "NiagaraSimCache.h" |
Syntax
UCLASS (BlueprintType, MinimalAPI)
class UNiagaraSimCache : public UObject
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UNiagaraSimCache
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UNiagaraSimCache
(
const FObjectInitializer& ObjectInitializer |
NiagaraSimCache.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FOnCacheBeginWrite | TMulticastDelegate_OneParam< void, UNiagaraSimCache * > | NiagaraSimCache.h | |
| FOnCacheEndWrite | TMulticastDelegate_OneParam< void, UNiagaraSimCache * > | NiagaraSimCache.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| CacheAgeResolution | float | Used to reduce rounding issues with age. | NiagaraSimCache.h |
| OnCacheBeginWrite | FOnCacheBeginWrite | NiagaraSimCache.h | |
| OnCacheEndWrite | FOnCacheEndWrite | NiagaraSimCache.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bCanRunAsync | bool | NiagaraSimCache.h |
|
|
| bNeedsReadComponentMappingRecache | bool | NiagaraSimCache.h |
|
|
| CachedScriptVMIds | TArray< FNiagaraVMExecutableDataId > | NiagaraSimCache.h |
|
|
| CacheFrames | TArray< FNiagaraSimCacheFrame > | NiagaraSimCache.h | ||
| CacheGuid | FGuid | NiagaraSimCache.h |
|
|
| CacheLayout | FNiagaraSimCacheLayout | NiagaraSimCache.h | ||
| CaptureStartTime | double | NiagaraSimCache.h | ||
| CaptureTickCount | int32 | NiagaraSimCache.h | ||
| CreateParameters | FNiagaraSimCacheCreateParameters | NiagaraSimCache.h | ||
| DataInterfaceStorage | TMap< FNiagaraVariableBase, TObjectPtr< UObject > > | NiagaraSimCache.h | ||
| DebugData | TObjectPtr< UNiagaraSimCacheDebugData > | NiagaraSimCache.h | ||
| DurationSeconds | float | NiagaraSimCache.h |
|
|
| PendingCommandsInFlight | std::atomic< int32 > | NiagaraSimCache.h | ||
| RWLock | FRWLock | NiagaraSimCache.h | ||
| SoftNiagaraSystem | TSoftObjectPtr< UNiagaraSystem > | NiagaraSimCache.h |
|
|
| StartSeconds | float | NiagaraSimCache.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool BeginAppend
(
FNiagaraSimCacheCreateParameters InCreateParameters, |
NiagaraSimCache.h | ||
bool BeginAppend
(
FNiagaraSimCacheCreateParameters InCreateParameters, |
NiagaraSimCache.h | ||
bool BeginWrite
(
FNiagaraSimCacheCreateParameters InCreateParameters, |
NiagaraSimCache.h | ||
bool BeginWrite
(
FNiagaraSimCacheCreateParameters InCreateParameters, |
NiagaraSimCache.h | ||
bool CanRead
(
UNiagaraSystem* NiagaraSystem |
NiagaraSimCache.h | ||
bool CanRunAsync() |
NiagaraSimCache.h | ||
bool EndWrite
(
bool bAllowAnalytics |
NiagaraSimCache.h | ||
void ForEachEmitterAttribute
(
int32 EmitterIndex, |
Runs a function for each attribute for the provided emitter index. | NiagaraSimCache.h | |
ENiagaraSimCacheAttributeCaptureMode GetAttributeCaptureMode() |
How were the attributes captured for this sim cache. | NiagaraSimCache.h |
|
const FGuid & GetCacheGuid() |
Get the caches assigned GUID, this can be set from a user or will be auto created on first write of the cache. | NiagaraSimCache.h | |
const UObject * GetDataInterfaceStorageObject
(
const FNiagaraVariableBase& DataInterface |
Returns the actual data we have captured in the SimCache for the given data interface. | NiagaraSimCache.h | |
const UNiagaraSimCacheDebugData * GetDebugData() |
Returns the debug data stored inside the cache, intended for internal use only. | NiagaraSimCache.h | |
float GetDurationSeconds() |
Get the duration the cache was recorded over. | NiagaraSimCache.h | |
int GetEmitterIndex
(
FName EmitterName |
Get the emitter index from a name | NiagaraSimCache.h | |
FName GetEmitterName
(
int32 EmitterIndex |
Get the emitter name at the provided index. | NiagaraSimCache.h |
|
| Returns a list of emitters we have captured in the SimCache. | NiagaraSimCache.h |
|
|
int GetEmitterNumInstances
(
int32 EmitterIndex, |
Get number of active instances for the emitter at the given frame. | NiagaraSimCache.h | |
int GetNumEmitters() |
Get number of emitters stored inside the cache. | NiagaraSimCache.h |
|
int GetNumFrames() |
Get number of frames stored in the cache. | NiagaraSimCache.h |
|
float GetStartSeconds() |
Get the time the simulation was at when recorded. | NiagaraSimCache.h |
|
TArray< FNiagaraVariableBase > GetStoredDataInterfaces() |
Returns a list of data interfaces we have captured in the SimCache. | NiagaraSimCache.h | |
UNiagaraSystem * GetSystem
(
bool bLoadSynchronous |
Get the system this cache is based on | NiagaraSimCache.h | |
TSoftObjectPtr< UNiagaraSystem > GetSystemAsset() |
Get the system asset this cache was created from. | NiagaraSimCache.h | |
bool HasStoredDataInterfaces() |
Returns true if we have stored data interfaces, otherwise false. | NiagaraSimCache.h | |
bool IsCacheValid() |
A valid cache is one that contains at least 1 frames worth of data. | NiagaraSimCache.h |
|
bool IsEmpty() |
An empty cache contains no frame data and can not be used | NiagaraSimCache.h |
|
bool IsRebaseEnabled() |
Returns true if we have any rebasing enabled. | NiagaraSimCache.h | |
bool Read
(
float TimeSeconds, |
NiagaraSimCache.h | ||
| Reads Niagara attributes by name from the cache frame and appends them into the relevant arrays. | NiagaraSimCache.h | ||
void ReadColorAttribute
(
TArray< FLinearColor >& OutValues, |
Reads Niagara Color attributes by name from the cache frame and appends them into the OutValues array. | NiagaraSimCache.h |
|
UObject * ReadDataInterfaceAs
(
UClass* RequestedType, |
Reads data interface data from the cache as the requested type. | NiagaraSimCache.h |
|
T * ReadDataInterfaceAs
(
FName AttributeName, |
NiagaraSimCache.h | ||
void ReadFloatAttribute
(
TArray< float >& OutValues, |
Reads Niagara float attributes by name from the cache frame and appends them into the OutValues array. | NiagaraSimCache.h |
|
bool ReadFrame
(
int32 FrameIndex, |
NiagaraSimCache.h | ||
void ReadIDAttribute
(
TArray< FNiagaraID >& OutValues, |
Reads Niagara ID attributes by name from the cache frame and appends them into the OutValues array. | NiagaraSimCache.h |
|
void ReadIntAttribute
(
TArray< int32 >& OutValues, |
Reads Niagara int attributes by name from the cache frame and appends them into the OutValues array. | NiagaraSimCache.h |
|
void ReadPositionAttribute
(
TArray< FVector >& OutValues, |
Reads Niagara Position attributes by name from the cache frame and appends them into the OutValues array. | NiagaraSimCache.h |
|
void ReadPositionAttributeWithRebase
(
TArray< FVector >& OutValues, |
Reads Niagara Position attributes by name from the cache frame and appends them into the OutValues array. | NiagaraSimCache.h |
|
void ReadQuatAttribute
(
TArray< FQuat >& OutValues, |
Reads Niagara Quaternion attributes by name from the cache frame and appends them into the OutValues array. | NiagaraSimCache.h |
|
void ReadQuatAttributeWithRebase
(
TArray< FQuat >& OutValues, |
Reads Niagara Quaternion attributes by name from the cache frame and appends them into the OutValues array. | NiagaraSimCache.h |
|
void ReadVector2Attribute
(
TArray< FVector2D >& OutValues, |
Reads Niagara Vec2 attributes by name from the cache frame and appends them into the OutValues array. | NiagaraSimCache.h |
|
void ReadVector4Attribute
(
TArray< FVector4 >& OutValues, |
Reads Niagara Vec4 attributes by name from the cache frame and appends them into the OutValues array. | NiagaraSimCache.h |
|
void ReadVectorAttribute
(
TArray< FVector >& OutValues, |
Reads Niagara Vec3 attributes by name from the cache frame and appends them into the OutValues array. | NiagaraSimCache.h |
|
void RemoveDebugData() |
Remove the debug data from the cache | NiagaraSimCache.h | |
void SetCacheGuid
(
const FGuid& InGuid |
Set the caches GUID to use. | NiagaraSimCache.h | |
bool WriteFrame
(
UNiagaraComponent* NiagaraComponent |
NiagaraSimCache.h | ||
bool WriteFrame
(
UNiagaraComponent* NiagaraComponent, |
NiagaraSimCache.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool IsReadyForFinishDestroy() |
NiagaraSimCache.h | ||
virtual void Serialize
(
FArchive& Ar |
NiagaraSimCache.h |