If your FBX file contains any animations, the Datasmith FBX importer for Deltagen and VRED adds a new instance of one of the following classes to your Level:
- For Deltagen, BP_AnimationPlayer.
- For VRED, VREDAnimationPlayer
This animation player Actor is set up automatically with a reference to your animation Data Table, so that it can access all of the animation data that Datasmith imported from your source file. It also has a reference to a root Actor that is placed at the top of your imported scene hierarchy, immediately under the Datasmith Scene Actor, so that it can find the scene elements that it needs to modify when you choose to play those animations. You'll find these settings in the Deltagen or Default (for VRED) section of the Details panel:
Animation Blueprint API
The animation player class is pre-set with several Blueprint functions that you can call at runtime to select which animations you want to play in your Level, and when.
If you edit the animation player Actor, you can find these functions in the functions list in the My Blueprint panel, and drag them into the Event Graph to call them in response to custom events you create:
To find these Blueprint nodes in a different Blueprint class or a UMG widget that you create:
- Create a new variable, and set its type to be an Object Reference to the BP_AnimationPlayer or VREDAnimationPlayer class.
Set this variable to point to the animation player object you've placed in your Level.
- Add a Get node for that variable to your Event Graph, and drag from its output pin to create a new node.
- Look in the Call Function category (and also the Deltagen category if you're working with Deltagen) to find the functions for controlling your animations:
Click for full image.
The nodes that you'll use most often are:
||Plays the animation whose name matches the name that you pass to the node.
||Resets all animatable Actors in the Level to their default transforms.
||Switches the animation currently being run by this animation player.
||Evaluates the current animation at the time that you pass to the node, and sets the transform of all animated Actors in the Level to match those transforms.
|Get Animation Names
||Returns an Array that contains the names of all animations you can pass to the Play Animation node.
The following image shows an example of how these Blueprint API functions could be used within a UMG UI widget. The animation nodes are highlighted.
Click for full image.