Niagara Mesh Array Mini Tutorial
Example Use
Mesh array is a super useful tool in Niagara for displaying different meshes on different particles within the same emitter.
It can be used together with mesh flipbooks to create mesh animations or to optimize emitter count (with some caveats)
It looks somewhat complicated, but It’s actually really straightforward so hopefully this can serve as a resource to get you started.
SETUP
In the Render section, click + and add a new Mesh Renderer
Then in the Mesh Renderer, scroll down to the Meshes Array, and add a few using the + button.
You can change the per mesh size, rotation and offset in here as well
You can also select a StaticMesh Object User Parameter from here if you want to dynamically change the mesh from BP. (Unfortunately it’s not quite possible to pass in an array of meshes)
USE
Once you have it setup like this, you can now select which mesh to show by using the MeshIndex[int32] parameter.
You can set it directly from InitializeParticle in the MeshAttributes section
Or you can set it manually using a set node
MESH FLIPBOOK
This function in the mesh renderer can be used to easily import a set of meshes.
Although the naming required to get it to work is specific.
You’ll want to name your meshes with a suffix, like [_001] [_002] [_003] etc…
Then in the mesh renderer go to MeshFlipbook and enable it (careful it will remove the existing ones).
Next set the following inputs to respectively the first mesh in your sequence, the format (image is setup for _xxx), and the amount of meshes you have in total
The meshes array will automatically be filled with the meshes from your sequence
If you want to animate the sequence you can, for example, use SubUVAnimation Node + setter node to convert from float to int32. (Or write your own module)
EXTRA
Be careful not too use too many different meshes, keep in mind that each mesh will need to be loaded and rendered separately. Use STAT Niagara [Get Dynamic Mesh Elements] etc. to profile.
On the other hand, Niagara can instantiate quite a few meshes before running into issues, so you can use that to your advantage.
Please let me know if you have any issues or corrections.