class

AnimationClip

A complete animation clip (e.g. "Walk", "Run", "Idle")

Module
Animation
Header
#include "Animation/AnimationClip.h"
Namespace
Mowo

Constructors

SignatureNameDescription
AnimationClip() = defaultAnimationClip

Public functions

ReturnsNameDescription
const std::string&GetName
voidSetName
const std::string&GetAssetIdThe id of the AnimSequence package the clip was read from, empty for a clip that came out of a model's render data.
voidSetAssetId
int32_tFindIndexThe clip a reference names among clips: the AnimSequence package id first — whatever the clip is called and wherever the model lists it — then the name.
floatGetDuration
voidSetDuration
floatGetTicksPerSecond
voidSetTicksPerSecond
voidAddChannel
const std::vector<AnimationChannel>&GetChannels
std::vector<AnimationChannel>&GetChannels
FAnimCompressionStatsCompressTracksQuantize every track into the compressed representation the sampler decodes from.
FAnimCompressionStatsCompressTracks
boolHasCompressedTracks
const std::vector<FCompressedAnimChannel>&GetCompressedChannels
const std::vector<uint8_t>&GetCompressedBlob
uint64_tGetCompressedBytes
voidSetCompressedTracksAdopt an already-encoded clip (the .mmodel cook path).
voidDecompressTracksRebuild float keys from the compressed tracks and drop the compressed form.
voidAddMorphChannel
const std::vector<MorphChannel>&GetMorphChannels
std::vector<MorphChannel>&GetMorphChannels
boolHasMorphChannels
floatSampleMorphChannel
voidAddCurve
const std::vector<FAnimCurve>&GetCurves
std::vector<FAnimCurve>&GetCurves
boolHasCurves
floatEvaluateCurveLinear sample of a named curve; fallback when the clip has no such track.
floatSampleCurveKeys
voidAddEvent
const std::vector<AnimationEvent>&GetEvents
std::vector<AnimationEvent>&GetEvents
const std::vector<AnimSyncMarker>&GetSyncMarkersSync markers, kept sorted by time (AddSyncMarker inserts in order).
std::vector<AnimSyncMarker>&GetSyncMarkers
voidAddSyncMarker
boolHasSyncMarkers
boolFindMarkerSegmentWhich marker segment timeTicks falls in.
boolResolveMarkerSegmentThe inverse: the time in THIS clip at the same position in the same named segment.
voidAddNotify
const std::vector<AnimNotify>&GetNotifies
std::vector<AnimNotify>&GetNotifies
voidAddNotifyState
const std::vector<AnimNotifyState>&GetNotifyStates
std::vector<AnimNotifyState>&GetNotifyStates
voidGetFiredNotifiesNotifies whose time is crossed between prevTime and currTime (ticks), handling loop wrapping — same rule as GetFiredEvents.
voidGetFiredNotifyStateEdgesBegin/end edges of ranged notify states crossed this frame.
voidGetActiveNotifyStatesEvery notify state whose [begin,end) window contains timeTicks — the per-frame Tick phase, so a window-shaped notify (trace sweep, timed buff) can act continuously between its Begin and End edges.
const std::vector<FMotionWarpWindow>&GetWarpWindows
std::vector<FMotionWarpWindow>&GetWarpWindows
voidGetFiredEventsGet events that fire between prevTime and currTime (in ticks), handling loop wrapping
voidBindToSkeletonResolve bone indices from skeleton bone names

Function details

AnimationClip

C++
AnimationClip() = default

GetName

C++
const std::string& GetName() const

SetName

C++
void SetName(const std::string& name)

GetAssetId

C++
const std::string& GetAssetId() const

The id of the AnimSequence package the clip was read from, empty for a clip that came out of a model's render data. A controller state that names this id finds the clip whatever its name or position.

SetAssetId

C++
void SetAssetId(const std::string& id)

FindIndex

C++
static int32_t FindIndex(const std::vector<Ref<AnimationClip>>& clips, const std::string& id, const std::string& name)

The clip a reference names among clips: the AnimSequence package id first — whatever the clip is called and wherever the model lists it — then the name. -1 when neither resolves. An index is not a reference: a reimport or a shared skeleton reorders the list.

GetDuration

C++
float GetDuration() const

SetDuration

C++
void SetDuration(float duration)

GetTicksPerSecond

C++
float GetTicksPerSecond() const

SetTicksPerSecond

C++
void SetTicksPerSecond(float tps)

AddChannel

C++
void AddChannel(AnimationChannel&& channel)

GetChannels

C++
const std::vector<AnimationChannel>& GetChannels() const

GetChannels

C++
std::vector<AnimationChannel>& GetChannels()

CompressTracks

C++
FAnimCompressionStats CompressTracks(const FAnimCompressionSettings& settings, bool discardRawKeys)

Quantize every track into the compressed representation the sampler decodes from. discardRawKeys frees the float key arrays afterwards — that is where the runtime memory actually goes; the channel list itself stays so bone names, bone indices and channel identity survive. Anything that still needs float keys (key reduction, DDC hashing over source data, tooling) must run BEFORE this, or call DecompressTracks.

CompressTracks

C++
FAnimCompressionStats CompressTracks()

HasCompressedTracks

C++
bool HasCompressedTracks() const

GetCompressedChannels

C++
const std::vector<FCompressedAnimChannel>& GetCompressedChannels() const

GetCompressedBlob

C++
const std::vector<uint8_t>& GetCompressedBlob() const

GetCompressedBytes

C++
uint64_t GetCompressedBytes() const

SetCompressedTracks

C++
void SetCompressedTracks(std::vector<FCompressedAnimChannel>&& channels, std::vector<uint8_t>&& blob)

Adopt an already-encoded clip (the .mmodel cook path). The channel list must already be sized to match, since bone identity lives there.

DecompressTracks

C++
void DecompressTracks()

Rebuild float keys from the compressed tracks and drop the compressed form. Lossless only for tracks that fell back to Raw; a quantized track comes back within its authored tolerance, not bit-exact.

AddMorphChannel

C++
void AddMorphChannel(MorphChannel&& channel)

GetMorphChannels

C++
const std::vector<MorphChannel>& GetMorphChannels() const

GetMorphChannels

C++
std::vector<MorphChannel>& GetMorphChannels()

HasMorphChannels

C++
bool HasMorphChannels() const

SampleMorphChannel

C++
static float SampleMorphChannel(const MorphChannel& channel, float timeInTicks)

AddCurve

C++
void AddCurve(FAnimCurve&& curve)

GetCurves

C++
const std::vector<FAnimCurve>& GetCurves() const

GetCurves

C++
std::vector<FAnimCurve>& GetCurves()

HasCurves

C++
bool HasCurves() const

EvaluateCurve

C++
float EvaluateCurve(const std::string& name, float timeInTicks, float fallback = 0.0f) const

Linear sample of a named curve; fallback when the clip has no such track. Same key interpolation as morph channels.

SampleCurveKeys

C++
static float SampleCurveKeys(const std::vector<MorphKey>& keys, float timeInTicks)

AddEvent

C++
void AddEvent(const AnimationEvent& event)

GetEvents

C++
const std::vector<AnimationEvent>& GetEvents() const

GetEvents

C++
std::vector<AnimationEvent>& GetEvents()

GetSyncMarkers

C++
const std::vector<AnimSyncMarker>& GetSyncMarkers() const

Sync markers, kept sorted by time (AddSyncMarker inserts in order).

GetSyncMarkers

C++
std::vector<AnimSyncMarker>& GetSyncMarkers()

AddSyncMarker

C++
void AddSyncMarker(const AnimSyncMarker& marker)

HasSyncMarkers

C++
bool HasSyncMarkers() const

FindMarkerSegment

C++
bool FindMarkerSegment(float timeTicks, AnimMarkerSegment& out) const

Which marker segment timeTicks falls in. The last marker wraps to the first ACROSS the loop point, so a time before the first marker or after the last is inside that wrapping segment rather than outside every one. False when the clip carries fewer than two markers.

ResolveMarkerSegment

C++
bool ResolveMarkerSegment(const AnimMarkerSegment& segment, float& outTimeTicks) const

The inverse: the time in THIS clip at the same position in the same named segment. False when this clip has no such pair — the caller then falls back to phase sync rather than snapping to an unrelated marker.

AddNotify

C++
void AddNotify(const AnimNotify& notify)

GetNotifies

C++
const std::vector<AnimNotify>& GetNotifies() const

GetNotifies

C++
std::vector<AnimNotify>& GetNotifies()

AddNotifyState

C++
void AddNotifyState(const AnimNotifyState& state)

GetNotifyStates

C++
const std::vector<AnimNotifyState>& GetNotifyStates() const

GetNotifyStates

C++
std::vector<AnimNotifyState>& GetNotifyStates()

GetFiredNotifies

C++
void GetFiredNotifies(float prevTimeTicks, float currTimeTicks, bool looping, std::vector<const AnimNotify*>& outNotifies) const

Notifies whose time is crossed between prevTime and currTime (ticks), handling loop wrapping — same rule as GetFiredEvents.

GetFiredNotifyStateEdges

C++
void GetFiredNotifyStateEdges(float prevTimeTicks, float currTimeTicks, bool looping, std::vector<FFiredNotifyStateEdge>& outEdges) const

Begin/end edges of ranged notify states crossed this frame.

GetActiveNotifyStates

C++
void GetActiveNotifyStates(float timeTicks, std::vector<const AnimNotifyState*>& outActive) const

Every notify state whose [begin,end) window contains timeTicks — the per-frame Tick phase, so a window-shaped notify (trace sweep, timed buff) can act continuously between its Begin and End edges.

GetWarpWindows

C++
const std::vector<FMotionWarpWindow>& GetWarpWindows() const

GetWarpWindows

C++
std::vector<FMotionWarpWindow>& GetWarpWindows()

GetFiredEvents

C++
void GetFiredEvents(float prevTimeTicks, float currTimeTicks, bool looping, std::vector<const AnimationEvent*>& outEvents) const

Get events that fire between prevTime and currTime (in ticks), handling loop wrapping

BindToSkeleton

C++
void BindToSkeleton(const class Skeleton& skeleton)

Resolve bone indices from skeleton bone names

Generated from Animation/AnimationClip.h via animation.json · Oct 26, 2026Version 1.0.0