Animation Sequence Controller
Use Animation Sequence Controller control animation sequence playback and its relevant properties. The animation sequence frame index starts from zero. When From is equal to To, only one frame will be played. When the first frame index is greater than the last frame index, the animation sequence is played backward. Animation Sequence Controller is in the Utility category.
|Play||Exec||Play the animation sequence from the index set in From|
|Stop||Exec||Stop the animation sequence playback and turn off the visibility of the current animation component|
|Pause||Exec||Pause the animation sequence playback without turning off the visibility|
|Resume||Exec||Resume the animation sequence playback from the paused index|
|Component||Animation Sequence||The animation sequence component|
|From||Number||The frame index of the animation sequence that will be played first|
|To||Number||The frame index of the animation sequence that will be played at last. The maximum available index is the total frame count minus 1.|
|Loop||Number||The number of times of playing the animation sequence|
|Stop on Last||Bool||Select it to stop the animation sequence playback after playing the last frame|
|Exit||Exec||Execute the next node|
|On Play||Exec||Execute the next node when plays the first frame for the first time|
|On Each Play||Exec||Execute the next node when plays the first frame|
|On Each Stop||Exec||Execute the next node when plays the last frame|
|On Stop||Exec||Execute the next node when the animation sequence playback stops|
|Current Frame||Number||The current playback frame index|
In this example, we use the Animation Sequence Controller component to control the play, pause, resume and stop of an animation sequence in Effect House. First of all, we import a texture sequence that is composed of ten images of random questions.
Then we add the Animation Controller to the scene by adding an image entity and then attaching an animation sequence component to that entity. We then replace the texture sequence with the one we have just imported. For the ease of this demo, we uncheck the AutoPlay checkbox on the Animation Sequence component.
We can also play with some parameters to customize the sequence play. For example, here we let the sequence play from the third frame (index 2) to the 9th frame (index 8). Note that animation sequences are 0-indexed in this node.
Then we use the Animation Sequence Controller node to control the sequence. We use the index finger up gesture to trigger the play of animation sequence:
Then we use the Facial Movement Detection node and the Eye Blink event to pause the play of animation sequence. We also use the Victory gesture to trigger the resume of the sequence play. In this case, the sequence will be paused but not disappear.
Last but not least, we use the mouth open event to trigger the stop of the sequence. In this case, the entire animation sequence will disappear.