In this example, we will demonstrate how the animations are used to create effects with DeepAR Studio.
At the end of this post, there is an example folder with DeepAR studio file that contains all assets mentioned here. You can download it and use it to try these animations effects or create your own animation effect.
FBX model animations
1. Import FBX
Open the DeepAR Studio
Now import FBX via File → Import Legacy FBX → choose face.fbx from the FBX_model_animations folder
2. Setup material
Select the Mesh quad under RootNode
In Material properties under the Select shader drop-down list choose Unlit texture
For Diffuse texture choose Camera texture
3. Setup animation
First, open the Animation state editor
Go to Assets → Animations state editor
In Animation state editor we will add a few things to make this animation work and to make it a little more interesting by adding a trigger to play the animation. The animation is about enlarging and reducing the size of the eyes and nose.
First, add new state by clicking Add state
You can add any name you want, but for this case, we called it Animation start
Next, add animation for that state by choosing Scene under Animation
The duration time will automatically appear, so you don't need to change that. You can check or uncheck loop if you want to animation play in a loop.
Now, we are going to Add trigger for idle state
For Name, we will choose uncond and for Next state Animation start
Just press Update model and close the Animation state editor
Animation - which fbx animation is played in this state. User will be able to choose one amongst all the loaded animations.
Loop - if set to false animation plays only once, otherwise it is played in a loop
Duration - duration of one animation loop. By default, it is set to the animation loop duration, but it can be shortened or prolonged. If it is shorter than the default animation loop time the animation will be cut before it finishes. If it is longer than the next loop will not start until duration time passes.
Triggers - a list of triggers that cause the animation state machine to advance to the next state.
Trigger name - an action that causes the animation state to advance to the next state.
Check all list parameters for animation states and triggers in the article before.
4. Final results
Download this example with all assets