API Reference · Animation

AnimationClip

Namespace: Ava3D

public sealed class AnimationClip

A named set of tracks — one animation as an authoring tool exported it.

Tracks hold their target Node by reference, so a clip belongs to the node tree it was loaded with. Loading one file twice gives two trees and two sets of clips, which is what two independently animated characters need; AnimationClip.RebindTo is the cheaper route to the same place when the geometry is already shared.

Constructors

MemberDescription
AnimationClip(string name, IReadOnlyList<AnimationTrack> tracks)

Builds a clip from its tracks.

Properties

MemberDescription
float Duration { get; }

The longest track's last key. Zero for a clip of nothing but constants.

bool LoopsCleanly { get; }

Whether the first and last poses match closely enough that playing this on repeat has no visible seam. Used as the default for AnimationState.Loop, which the caller can override.

string Name { get; }

The name the file gave it — "Idle", "Greet" — or null.

IReadOnlyList<AnimationTrack> Tracks { get; }

Every track in the clip.

Methods

MemberDescription
AnimationClip RebindTo(Node root)

This clip bound to the equivalently named nodes under root.

Matching is by Node.Name, which is what a second copy of the same file has in common with the first. A track whose target has no counterpart is dropped rather than throwing, because a rig stripped of a few nodes is a normal thing to want to animate with the clips it came with.

See also