I’m working on a custom Niagara Data Interface returns an array of FVector, expecting which to be referenced in a Niagara asset through the Dynamic Input.
How to set up the NDI properly to return the array of FVector? I’m using this class below to specify the data type and it works in Niagara Data Interface.
UNiagaraDataInterfaceArrayFloat3
However, when I set up the Dynamic Input asset (hoping to return the same vector array so it can be used in Niagara assets), the options are primitive types and there are no array types at all, how to make it return an array type?
Or is it designed this way to avoid sending dynamic arrays for GPU-simulated particles? Or other concerns?
Data interfaces can’t be transient, which is why they can’t be returned or mutated in a temporary way inside the graph. Any mutation to the data is permanent for that instance (unless reset again).
For example you can not take an array as input and output a new array, you can only mutate one that exists in a given namespace (user / system / emitter). They also can not exist per particle as the number of data interfaces has to be known at the end of the compilation process. Technically a data interface author could figure out a creative way to store data per particle, but it’s quite complicated especially for the GPU.
There is no plan to support data interfaces being transient objects that can be passed around between inputs / modules like this.
Adding support to the engine would likely be a many month effort to have it working robustly, but perhaps I’m not fully understanding what you need.
We have already used arrays internally for data channel like behavior, it’s more complicated to setup but there are ways of doing it without making a transient copy like this. We’ve also tested out ways of pushing data from another emitter, one frame latent, but allows you to do things like fireworks without events, etc.
I’m trying to work with a custom Niagara module script that uses vector and float array as inputs. I can hook up user parameters of array types to those inputs, but would like to explore a different way by using Niagara Data Interface so that the data access would be consistent and clean.
Are there specific concerns of why it is not supported?
Also are there any alternative solutions to accessing arrays besides by using user parameters?
Also would there be any foresee-able issues if I were to add the support for array types in the engine code?
We are not able to use Niagara Data Channel yet, since we are in UE5.2. Just trying to figure out the cleanest approach to accessing arrays in Niagara besides user parameter and Niagara Parameter Collection.