AnimationIterator is a sealed interface that provides iteration over animation keyframes with support for different playback modes.
Package
Type Parameters
T- The type of keyframe (must implementTimed)
Methods
clear()
type()
hasNext()
Iterator<T>. Returns whether more keyframes are available.
next()
Iterator<T>. Returns the next keyframe.
Type Enum
TheAnimationIterator.Type enum defines animation playback behavior.
Enum Constants
PLAY_ONCE
"once".
Since: 1.15.2
LOOP
"loop".
Since: 1.15.2
HOLD_ON_LAST
"hold".
Since: 1.15.2
Type Methods
create(TimedStorage)
keyframes- The keyframes to iterate over
Implementation Classes
The interface has three sealed implementations:PlayOnce
Implementation forPLAY_ONCE type. Iterates through keyframes once, then returns false for hasNext().
Loop
Implementation forLOOP type. When reaching the end, resets to the first keyframe and continues infinitely.
HoldOnLast
Implementation forHOLD_ON_LAST type. After reaching the last keyframe, continues returning that frame indefinitely.
Usage Examples
Creating an Iterator
Iterating Through Keyframes
Looping Animation
Hold on Last Frame
Resetting an Iterator
Checking Iterator Type
Using with AnimationModifier
JSON Serialization
The enum values serialize to JSON strings:See Also
- AnimationModifier - Animation playback modifier
- BlueprintAnimation - Complete animation data
- AnimationProgress - Keyframe data type
