Header menu logo Nu

TrackEntry Type

Stores settings and other state for the playback of an animation on an AnimationState track.

References to a track entry must not be kept after the !:AnimationStateListener.Dispose(TrackEntry) event occurs.

Constructors

Constructor Description

TrackEntry()

Full Usage: TrackEntry()

Instance members

Instance member Description

this.AllowImmediateQueue

Full Usage: this.AllowImmediateQueue

this.Alpha

Full Usage: this.Alpha

Values < 1 mix this animation with the skeleton's current pose (usually the pose resulting from lower tracks). Defaults to 1, which overwrites the skeleton's current pose with this animation.

Typically track 0 is used to completely pose the skeleton, then alpha is used on higher tracks. It doesn't make sense to use alpha on track 0 if the skeleton pose is from the last frame render.

this.AlphaAttachmentThreshold

Full Usage: this.AlphaAttachmentThreshold

When TrackEntry.Alpha is greater than AlphaAttachmentThreshold, attachment timelines are applied. Defaults to 0, so attachment timelines are always applied.

this.Animation

Full Usage: this.Animation

Returns: Animation

The animation to apply for this track entry.

Returns: Animation

this.AnimationEnd

Full Usage: this.AnimationEnd

Seconds for the last frame of this animation. Non-looping animations won't play past this time. Looping animations will loop back to TrackEntry.AnimationStart at this time. Defaults to the animation Animation.Duration.

this.AnimationLast

Full Usage: this.AnimationLast

The time in seconds this animation was last applied. Some timelines use this for one-time triggers. Eg, when this animation is applied, event timelines will fire all events between the AnimationLast time (exclusive) and AnimationTime (inclusive). Defaults to -1 to ensure triggers on frame 0 happen the first time this animation is applied.

this.AnimationStart

Full Usage: this.AnimationStart

Seconds when this animation starts, both initially and after looping. Defaults to 0.

When changing the AnimationStart time, it often makes sense to set TrackEntry.AnimationLast to the same value to prevent timeline keys before the start time from triggering.

this.AnimationTime

Full Usage: this.AnimationTime

Returns: float32

Uses TrackEntry.TrackTime to compute the AnimationTime. When the TrackTime is 0, the AnimationTime is equal to the AnimationStart time.

The animationTime is between TrackEntry.AnimationStart and TrackEntry.AnimationEnd, except if this track entry is non-looping and TrackEntry.AnimationEnd is >= to the animation Animation.Duration, then animationTime continues to increase past TrackEntry.AnimationEnd.

Returns: float32

this.Complete

Full Usage: this.Complete

Returns: TrackEntryDelegate

See for details. Usage in C# and spine-unity is explained on the spine-unity documentation pages.

Returns: TrackEntryDelegate

this.Delay

Full Usage: this.Delay

Seconds to postpone playing the animation. When this track entry is the current track entry, Delay postpones incrementing the TrackEntry.TrackTime. When this track entry is queued, Delay is the time from the start of the previous animation to when this track entry will become the current track entry (ie when the previous track entry TrackEntry.TrackTime >= this track entry's Delay).

TrackEntry.TimeScale affects the delay.

When using AnimationState.AddAnimation with a delay <= 0, the delay is set using the mix duration from the AnimationStateData. If TrackEntry.mixDuration is set afterward, the delay may need to be adjusted.

this.Dispose

Full Usage: this.Dispose

Returns: TrackEntryDelegate

See for details. Usage in C# and spine-unity is explained on the spine-unity documentation pages.

Returns: TrackEntryDelegate

this.End

Full Usage: this.End

Returns: TrackEntryDelegate

See for details. Usage in C# and spine-unity is explained on the spine-unity documentation pages.

Returns: TrackEntryDelegate

this.Event

Full Usage: this.Event

Returns: TrackEntryEventDelegate
Returns: TrackEntryEventDelegate

this.EventThreshold

Full Usage: this.EventThreshold

When the mix percentage (TrackEntry.MixTime / TrackEntry.MixDuration) is less than the EventThreshold, event timelines are applied while this animation is being mixed out. Defaults to 0, so event timelines are not applied while this animation is being mixed out.

this.HoldPrevious

Full Usage: this.HoldPrevious

If true, when mixing from the previous animation to this animation, the previous animation is applied as normal instead of being mixed out.

When mixing between animations that key the same property, if a lower track also keys that property then the value will briefly dip toward the lower track value during the mix. This happens because the first animation mixes from 100% to 0% while the second animation mixes from 0% to 100%. Setting HoldPrevious to true applies the first animation at 100% during the mix so the lower track value is overwritten. Such dipping does not occur on the lowest track which keys the property, only when a higher track also keys the property.

Snapping will occur if HoldPrevious is true and this animation does not key all the same properties as the previous animation.

this.Interrupt

Full Usage: this.Interrupt

Returns: TrackEntryDelegate

See for details. Usage in C# and spine-unity is explained on the spine-unity documentation pages.

Returns: TrackEntryDelegate

this.InterruptAlpha

Full Usage: this.InterruptAlpha

Returns: float32
Returns: float32

this.IsComplete

Full Usage: this.IsComplete

Returns: bool

Returns true if at least one loop has been completed.

Returns: bool

this.IsEmptyAnimation

Full Usage: this.IsEmptyAnimation

Returns: bool

Returns true if this entry is for the empty animation. See AnimationState.SetEmptyAnimation, AnimationState.AddEmptyAnimation, and AnimationState.SetEmptyAnimations.

Returns: bool

this.IsNextReady

Full Usage: this.IsNextReady

Returns: bool

Returns true if there is a TrackEntry.Next track entry that will become the current track entry during the next AnimationState.Update.

Returns: bool

this.Loop

Full Usage: this.Loop

If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its duration.

this.MixAttachmentThreshold

Full Usage: this.MixAttachmentThreshold

When the mix percentage (TrackEntry.MixTime / TrackEntry.MixDuration) is less than the MixAttachmentThreshold, attachment timelines are applied while this animation is being mixed out. Defaults to 0, so attachment timelines are not applied while this animation is being mixed out.

this.MixBlend

Full Usage: this.MixBlend

Controls how properties keyed in the animation are mixed with lower tracks. Defaults to MixBlend.Replace.

Track entries on track 0 ignore this setting and always use MixBlend.First.

The MixBlend can be set for a new track entry only before AnimationState.Apply is first called.

this.MixDrawOrderThreshold

Full Usage: this.MixDrawOrderThreshold

When the mix percentage (TrackEntry.MixTime / TrackEntry.MixDuration) is less than the MixDrawOrderThreshold, draw order timelines are applied while this animation is being mixed out. Defaults to 0, so draw order timelines are not applied while this animation is being mixed out.

this.MixDuration

Full Usage: this.MixDuration

Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData AnimationStateData.GetMix based on the animation before this animation (if any).

The MixDuration can be set manually rather than use the value from AnimationStateData.GetMix. In that case, the MixDuration can be set for a new track entry only before AnimationState.Update is first called.

When using AnimationState.AddAnimation with a Delay <= 0, the TrackEntry.Delay is set using the mix duration from the AnimationStateData. If mixDuration is set afterward, the delay may need to be adjusted. For example:

entry.Delay = entry.previous.TrackComplete - entry.MixDuration;

Alternatively, TrackEntry.SetMixDuration can be used to recompute the delay:

entry.SetMixDuration(0.25f, 0);

this.MixTime

Full Usage: this.MixTime

Seconds from 0 to the TrackEntry.MixDuration when mixing from the previous animation to this animation. May be slightly more than MixDuration when the mix is complete.

this.MixingFrom

Full Usage: this.MixingFrom

Returns: TrackEntry

The track entry for the previous animation when mixing from the previous animation to this animation, or null if no mixing is currently occurring. When mixing from multiple animations, MixingFrom makes up a linked list.

Returns: TrackEntry

this.MixingTo

Full Usage: this.MixingTo

Returns: TrackEntry

The track entry for the next animation when mixing from this animation to the next animation, or null if no mixing is currently occurring. When mixing to multiple animations, MixingTo makes up a linked list.

Returns: TrackEntry

this.Next

Full Usage: this.Next

Returns: TrackEntry

The animation queued to start after this animation, or null if there is none. next makes up a doubly linked list.

See AnimationState.ClearNext to truncate the list.

Returns: TrackEntry

this.Previous

Full Usage: this.Previous

Returns: TrackEntry

The animation queued to play before this animation, or null. previous makes up a doubly linked list.

Returns: TrackEntry

this.Reset

Full Usage: this.Reset

Modifiers: abstract

this.ResetRotationDirections

Full Usage: this.ResetRotationDirections

Resets the rotation directions for mixing this entry's rotate timelines. This can be useful to avoid bones rotating the long way around when using TrackEntry.alpha and starting animations on other tracks.

Mixing with MixBlend.Replace involves finding a rotation between two others, which has two possible solutions: the short way or the long way around. The two rotations likely change over time, so which direction is the short or long way also changes. If the short way was always chosen, bones would flip to the other side when that direction became the long way. TrackEntry chooses the short way the first time it is applied and remembers that direction.

this.Reverse

Full Usage: this.Reverse

If true, the animation will be applied in reverse. Events are not fired when an animation is applied in reverse.

this.SetMixDuration

Full Usage: this.SetMixDuration

Parameters:
    mixDuration : float32
    delay : float32 - If > 0, sets TrackEntry.Delay. If <= 0, the delay set is the duration of the previous track entry minus the specified mix duration plus the specified delay (ie the mix ends at (delay = 0) or before (delay < 0) the previous track entry duration). If the previous entry is looping, its next loop completion is used instead of its duration.

mixDuration : float32
delay : float32

If > 0, sets TrackEntry.Delay. If <= 0, the delay set is the duration of the previous track entry minus the specified mix duration plus the specified delay (ie the mix ends at (delay = 0) or before (delay < 0) the previous track entry duration). If the previous entry is looping, its next loop completion is used instead of its duration.

this.ShortestRotation

Full Usage: this.ShortestRotation

If true, mixing rotation between tracks always uses the shortest rotation direction. If the rotation is animated, the shortest rotation direction may change during the mix.

If false, the shortest rotation direction is remembered when the mix starts and the same direction is used for the rest of the mix. Defaults to false.

this.Start

Full Usage: this.Start

Returns: TrackEntryDelegate

See for details. Usage in C# and spine-unity is explained on the spine-unity documentation pages.

Returns: TrackEntryDelegate

this.TimeScale

Full Usage: this.TimeScale

Multiplier for the delta time when this track entry is updated, causing time for this animation to pass slower or faster. Defaults to 1.

Values < 0 are not supported. To play an animation in reverse, use TrackEntry.Reverse.

TrackEntry.MixTime is not affected by track entry time scale, so TrackEntry.MixDuration may need to be adjusted to match the animation speed.

When using AnimationState.AddAnimation with a Delay <= 0, the TrackEntry.Delay is set using the mix duration from the AnimationStateData, assuming time scale to be 1. If the time scale is not 1, the delay may need to be adjusted.

See AnimationState AnimationState.TimeScale for affecting all animations.

this.ToString

Full Usage: this.ToString

Returns: string
Modifiers: abstract
Returns: string

this.TrackComplete

Full Usage: this.TrackComplete

Returns: float32

If this track entry is non-looping, the track time in seconds when TrackEntry.AnimationEnd is reached, or the current TrackEntry.TrackTime if it has already been reached. If this track entry is looping, the track time when this animation will reach its next TrackEntry.AnimationEnd (the next loop completion).

Returns: float32

this.TrackEnd

Full Usage: this.TrackEnd

The track time in seconds when this animation will be removed from the track. Defaults to the highest possible float value, meaning the animation will be applied until a new animation is set or the track is cleared. If the track end time is reached, no other animations are queued for playback, and mixing from any previous animations is complete, then the properties keyed by the animation are set to the setup pose and the track is cleared.

It may be desired to use AnimationState.AddEmptyAnimation rather than have the animation abruptly cease being applied.

this.TrackIndex

Full Usage: this.TrackIndex

Returns: int

The index of the track where this entry is either current or queued.

Returns: int

this.TrackTime

Full Usage: this.TrackTime

Current time in seconds this track entry has been the current track entry. The track time determines TrackEntry.AnimationTime. The track time can be set to start the animation at a time other than 0, without affecting looping.

this.WasApplied

Full Usage: this.WasApplied

Returns: bool

Returns true if this track entry has been applied at least once.

Returns: bool

Type something to start searching.