FNiagaraParameterMapHistory

Traverses a Niagara node graph to identify the variables that have been written and read from a parameter map.

Choose your operating system:

Windows

macOS

Linux

References

Module

NiagaraEditor

Header

/Engine/Plugins/FX/Niagara/Source/NiagaraEditor/Public/NiagaraParameterMapHistory.h

Include

#include "NiagaraParameterMapHistory.h"

Syntax

struct FNiagaraParameterMapHistory

Remarks

Traverses a Niagara node graph to identify the variables that have been written and read from a parameter map. This class is meant to aid in UI and compilation of the graph. There are several main script types and each one interacts slightly differently with the history depending on context.

Variables

Name Description

Public variable

TArray< FNiagar...

 

AdditionalDataSetWrites

List of additional DataSets to be written that were encountered during traversal.

Public variable

bool

 

bParameterCollectionsSkipped

Public variable

TArray< FString...

 

EmitterNamespacesEncountered

List of emitter namespaces encountered as this parameter map was built.

Public variable

TArray< FName >

 

IterationNamespaceOverridesEncountered

List of all the custom iteration source override namespaces encountered

Public variable

TArray< TTuple<...

 

MapNodeVariableMetaData

For each node in MapNodeVisitations, record the start index and end index of variables added within the body of the node, i.e. a Get node will record just the values it pulls out directly.

Public variable

TArray< const c...

 

MapNodeVisitations

List of nodes that manipulated the parameter map from input to output.

Public variable

TArray< const U...

 

MapPinHistory

List of pins that manipulated the parameter map from input to output.

Public variable

ENiagaraScriptU...

 

OriginatingScriptUsage

Public variable

TArray< FString...

 

ParameterCollectionNamespaces

Cached off contents of used parameter collections, in case they change during threaded compilation.

Public variable

TArray< UNiagar...

 

ParameterCollections

Used parameter collections identified during the traversal.

Public variable

TArray< TArray<...

 

ParameterCollectionVariables

Cached off contents of used parameter collections, in case they change during threaded compilation.

Public variable

TArray< TArray<...

 

PerVariableConstantDefaultValue

Public variable

TArray< TArray<...

 

PerVariableConstantValue

Public variable

TArray< TArray<...

 

PerVariableReadHistory

Public variable

TArray< FString...

 

PerVariableWarnings

Are there any warnings that were encountered during the traversal of the graph for a given variable?

Public variable

TArray< TArray<...

 

PerVariableWriteHistory

For each variable that was found, identify the pins that wrote to them in order from first to last write.

Public variable

TMap< FGraphTra...

 

PinToConstantValues

Public variable

TArray< FNiagar...

 

VariableMetaData

The metadata associated with each variable identified during the traversal.

Public variable

TArray< FNiagar...

 

Variables

The variables that have been identified during the traversal.

Public variable

TArray< FNiagar...

 

VariablesWithOriginalAliasesIntact

Constructors

Functions

Name Description

Public function

int32

 

AddExternalVariable

(
    const FNiagaraVariable& InVar
)

Add a variable outside the normal get/set node paradigm.

Public function

int32

 

AddVariable

(
    const FNiagaraVariable& InVar,
    const FNiagaraVariable& InAliasedV...,
    FName ModuleName,
    const UEdGraphPin* InPin,
    TOptional< FNiagaraVariableMetaData...
)

Helper to add a variable to the known list for a parameter map.

Public function Static

FNiagaraVari...

 

BasicAttributeToNamespacedAttribute

(
    const FNiagaraVariable& InVar,
    bool bSanitizeInput
)

Reverses ResolveAsBasicAttribute.

Public function

uint32

 

BeginNodeVisitation

(
    const UNiagaraNode* Node
)

Public function Static

FNiagaraVari...

 

ConvertVariableToRapidIterationConstantName

(
    FNiagaraVariable InVar,
    const TCHAR* InEmitterName,
    ENiagaraScriptUsage InUsage
)

Public function

void

 

EndNodeVisitation

(
    uint32 IndexFromBeginNode
)

Public function Const

int32

 

FindVariable

(
    const FName& VariableName,
    const FNiagaraTypeDefinition& Type
)

Find a variable by both name and type.

Public function Const

int32

 

FindVariableByName

(
    const FName& VariableName,
    bool bAllowPartialMatch
)

Find a variable by name with no concern for type.

Public function Const

const UEdGra...

 

GetDefaultValuePin

(
    int32 VarIdx
)

Get the default value for this variable.

Public function Const

const UNiaga...

 

GetFinalOutputNode()

Get the output node associated with this graph.

Public function Const

const UEdGra...

 

GetFinalPin()

Get the output pin that we traced to build this history object.

Public function Static

FString

 

GetNamespace

(
    const FNiagaraVariable& InVar,
    bool bIncludeDelimiter
)

Get the first namespace entry for this variable. Optionally includes the trailing period.

Public function Const

const UEdGra...

 

GetOriginalPin()

Get the pin that added the parameter map to the graph.

Public function Static

FName

 

GetSourceForInitialValue

(
    const FName& InVariableName
)

Does this parameter contain the "Initial" namespace as one of its intermediate namespaces? If so, remove the "Initial" namespace and return the original value.

Public function Static

FNiagaraVari...

 

GetSourceForInitialValue

(
    const FNiagaraVariable& InVar
)

Does this parameter contain the "Initial" namespace as one of its intermediate namespaces? If so, remove the "Initial" namespace and return the original value.

Public function Static

FNiagaraVari...

 

GetSourceForPreviousValue

(
    const FNiagaraVariable& InVar
)

Does this parameter contain the "Previous" namespace as one of its intermediate namespaces? If so, remove the "Previous" namespace and return the original value.

Public function Static

FName

 

GetSourceForPreviousValue

(
    const FName& InVariableName
)

Does this parameter contain the "Previous" namespace as one of its intermediate namespaces? If so, remove the "Previous" namespace and return the original value.

Public function Static

void

 

GetValidNamespacesForReading

(
    const UNiagaraScript* InScript,
    TArray< FString >& OutputNamespace...
)

Public function Static

void

 

GetValidNamespacesForReading

(
    ENiagaraScriptUsage InScriptUsage,
    int32 InUsageBitmask,
    TArray< FString >& OutputNamespace...
)

Public function Static

bool

 

IsAliasedEmitterParameter

(
    const FNiagaraVariable& InVar
)

Does this parameter start with the "Emitter" namespace?

Public function Static

bool

 

IsAliasedEmitterParameter

(
    const FString& InVarName
)

Does this parameter start with the "Emitter" namespace?

Public function Static

bool

 

IsAliasedModuleParameter

(
    const FNiagaraVariable& InVar
)

Does this parameter start with the "Module" namespace?

Public function Static

bool

 

IsAttribute

(
    const FNiagaraVariableBase& InVar
)

Does this parameter start with the "Particles" namespace?

Public function Static

bool

 

IsEngineParameter

(
    const FNiagaraVariable& InVar
)

Is this parameter in the special "Engine" namespace?

Public function

bool

 

IsExportableExternalConstant

(
    const FNiagaraVariable& InVar,
    const UNiagaraScript* InScript
)

Are we required to export this variable as an external constant?

Public function Static

bool

 

IsExternalConstantNamespace

(
    const FNiagaraVariable& InVar,
    const UNiagaraScript* InScript,
    const FGuid& VersionGuid
)

Does this variable belong in a namespace that needs to come in as an external constant to this script?

Public function Static

bool

 

IsExternalConstantNamespace

(
    const FNiagaraVariable& InVar,
    ENiagaraScriptUsage InUsage,
    int32 InUsageBitmask
)

Does this variable belong in a namespace that needs to come in as an external constant to this script?

Public function Static

bool

 

IsInitialName

(
    const FName& InVariableName
)

Does this variable name contain the "Initial" namespace as one of its intermediate namespaces?

Public function Static

bool

 

IsInitialValue

(
    const FNiagaraVariableBase& InVar
)

Does this parameter contain the "Initial" namespace as one of its intermediate namespaces?

Public function Static

bool

 

IsInNamespace

(
    const FNiagaraVariableBase& InVar,
    const FString& Namespace
)

Does the variable start with this namespace?

Public function

UNiagaraPara...

 

IsParameterCollectionParameter

(
    FNiagaraVariable& InVar,
    bool& bMissingParameter
)

If this is variable is a parameter in one of our tracked collections, return it.

Public function Static

bool

 

IsPerInstanceEngineParameter

(
    const FNiagaraVariable& InVar,
    const FString& EmitterAlias
)

Public function Static

bool

 

IsPreviousName

(
    const FName& InVariableName
)

Does this variable name contain the "Previous" namespace as one of its intermediate namespaces?

Public function Static

bool

 

IsPreviousValue

(
    const FNiagaraVariableBase& InVar
)

Does this parameter contain the "Previous" namespace as one of its intermediate namespaces?

Public function Const

bool

 

IsPrimaryDataSetOutput

(
    const FNiagaraVariable& InVar,
    const UNiagaraScript* InScript,
    bool bAllowDataInterfaces,
    bool bAllowStatics
)

Called to determine if a given variable should be output from a script.

Public function Const

bool

 

IsPrimaryDataSetOutput

(
    const FNiagaraVariable& InVar,
    ENiagaraScriptUsage InUsage,
    bool bAllowDataInterfaces,
    bool bAllowStatics
)

Called to determine if a given variable should be output from a script.

Public function Static

bool

 

IsRapidIterationParameter

(
    const FNiagaraVariable& InVar
)

Public function Static

bool

 

IsSystemParameter

(
    const FNiagaraVariable& InVar
)

Is this parameter in the special "System" namespace?

Public function Static

bool

 

IsUserParameter

(
    const FNiagaraVariable& InVar
)

Public function Static

bool

 

IsValidNamespaceForReading

(
    ENiagaraScriptUsage InScriptUsage,
    int32 InUsageBitmask,
    FString Namespace
)

Public function Const

bool

 

IsVariableFromCustomIterationNamespaceOverride

(
    const FNiagaraVariable& InVar
)

Public function Static

bool

 

IsWrittenToScriptUsage

(
    const FNiagaraVariable& InVar,
    ENiagaraScriptUsage InUsage,
    bool bAllowDataInterfaces
)

Public function Static

FString

 

MakeSafeNamespaceString

(
    const FString& InStr
)

Take an input string and make it hlsl safe.

Public function Static

FNiagaraVari...

 

MoveToExternalConstantNamespaceVariable

(
    const FNiagaraVariable& InVar,
    const UNiagaraScript* InScript
)

Take a non-namespaced variable and move it to an appropriate external constant namespace for this script type.

Public function Static

FNiagaraVari...

 

MoveToExternalConstantNamespaceVariable

(
    const FNiagaraVariable& InVar,
    ENiagaraScriptUsage InUsage
)

Take a non-namespaced variable and move it to an appropriate external constant namespace for this script type.

Public function

void

 

RegisterConstantPin

(
    const FGraphTraversalHandle& InTra...,
    const UEdGraphPin* InPin,
    const FString& InValue
)

Public function

void

 

RegisterConstantVariableWrite

(
    const FString& InValue,
    int32 InVarIdx,
    bool bIsSettingDefault
)

Public function

int32

 

RegisterParameterMapPin

(
    const UEdGraphPin* Pin
)

Called in a depth-first traversal to identify a given Niagara Parameter Map pin that was touched during traversal.

Public function Static

FNiagaraVari...

 

ResolveAsBasicAttribute

(
    const FNiagaraVariable& InVar,
    bool bSanitizeInput
)

Remove the Particles namespace if it exists.

Public function Static

FName

 

ResolveEmitterAlias

(
    const FName& InName,
    const FString& InAlias
)

Public function Static

int32

 

SearchArrayForPartialNameMatch

(
    const TArray< FNiagaraVariable >& ...,
    const FName& VariableName
)

Public function Const

bool

 

ShouldIgnoreVariableDefault

(
    const FNiagaraVariable& Var
)

Public function Static

bool

 

SplitRapidIterationParameterName

(
    const FNiagaraVariable& InVar,
    ENiagaraScriptUsage InUsage,
    FString& EmitterName,
    FString& FunctionCallName,
    FString& InputName
)

Public function Static

FNiagaraVari...

 

VariableToNamespacedVariable

(
    const FNiagaraVariable& InVar,
    FString Namespace
)

Prepends the namespace string to the variable name.

Classes

Name

Description

Public struct

FReadHistory

For each variable that was found, identify the pins that read them from the map in order from first to last read.