Overview
The AnimTrack node allows you to use animation tracks (3D splines) exported as FBX from 3D modeling softwares in your effect behavior.
It can be used either through the animtrack sampler script functions, or using the template core-library nodes, such as AnimtrackSample
.
Property | Type | Description |
AnimResource | assetPath | Path to the FBX containing the animation track. |
TransformTranslate | bool | Should the animation track sampling take into account the change of position along the animation track. |
TransformRotate | bool | Should the animation track sampling take into account the change of orientation along the animation track. |
TransformScale | bool | Should the animation track sampling take into account the change of scale along the animation track. |
Position | float3 | Transforms the animation track to translate it at this position. |
Orientation | float3 | Transforms the animation track to rotate it according to those euler angles (in degres). |
Scale | float3 | Transforms the animation track to scale it along each axis. |
Output pins | ||
Data | dataAnimPath | The animation track data that can be plugged in the AnimTrackSample node. |
+ all sampler properties |
Usage
To use animation tracks in your effect, you will need to export a spline from any 3D software as a FBX file.
Import this FBX in your PopcornFX project and double click on it in the PopcornFX content browser to open the “Mesh Importer” window.
In the “Bake settings” tab, make sure that you uncheck the “Import Skeleton” property and check the “Import Animation”.
You can also uncheck the “Import Geometry” property if you don’t want to import the mesh data present in the FBX file if any.
Once this is done, you can click on the big “Reimport” button and your path should appear in the viewport.
We can now use this resource as an AnimTrack sampler in an effect. To do that we will create a very basic effect with just an event multiplier and a particle layer:
The event multiplier spawns 10 particles per second for an infinite time:
We can now jump in the “MyParticles” layer to drive the particle behavior using the previously imported animation track FBX.
You can now drop the AnimTrack sample (rig)
template in this layer. This should create the three basic nodes needed to sample an animation track.
By default, this rig uses the node self.lifeRatio
as the sampling cursor. The cursor is just a value between 0 and 1 that specifies at what percentage we want to sample the animation track, so here the particle will move from the beginning to the end of the animation track during its life time.
In the SamplerDataAnimTrack
you can now select your FBX asset containing the animation track.
You should now be able to connect the Position
output from the AnimTrackSample
node to a basic billboard renderer to see the particles moving along the exported path.
This is what the final setup should look like:
You can try changing the SetLife
node input to get the particles to move slower along the track.