setEmptyAnimation method

TrackEntry setEmptyAnimation(
  1. int trackIndex,
  2. double mixDuration
)

Sets an empty animation for a track at trackIndex, discarding any queued animations, and sets the track entry's TrackEntry.getMixDuration to mixDuration. An empty animation has no timelines and serves as a placeholder for mixing in or out.

Mixing out is done by setting an empty animation with a mix duration using either setEmptyAnimation, setEmptyAnimations, or addEmptyAnimation. Mixing to an empty animation causes the previous animation to be applied less and less over the mix duration. Properties keyed in the previous animation transition to the value from lower tracks or to the setup pose value if no lower tracks key the property. A mix duration of 0 still mixes out over one frame.

Mixing in is done by first setting an empty animation, then adding an animation using addAnimation with the desired delay (an empty animation has a duration of 0) and on the returned track entry, set the TrackEntry.setMixDuration. Mixing from an empty animation causes the new animation to be applied more and more over the mix duration. Properties keyed in the new animation transition from the value from lower tracks or from the setup pose value if no lower tracks key the property to the value keyed in the new animation.

Implementation

TrackEntry setEmptyAnimation(int trackIndex, double mixDuration) {
  final entry = _bindings.spine_animation_state_set_empty_animation(_state, trackIndex, mixDuration);
  return TrackEntry._(entry, this);
}