Table of Contents

Class Animation

Namespace
ValveResourceFormat.ResourceTypes.ModelAnimation
Assembly
ValveResourceFormat.dll

Represents a model animation with frame data, events, and movement information.

public class Animation

Inheritance

Inherited Members

Constructors

Animation(AnimationClip)

Initializes a new instance of the ValveResourceFormat.ResourceTypes.ModelAnimation.Animation class from an animation clip.

public Animation(AnimationClip clip)

Parameters

clip AnimationClip

Properties

Activities

Gets the activities associated with this animation.

public AnimationActivity[] Activities { get; }

Property Value

AnimationActivity[]

AutoLayers

Gets the auto layer data for this animation. Empty for animations that were constructed without sequence data.

public AnimationAutoLayer[] AutoLayers { get; }

Property Value

AnimationAutoLayer[]

Autoplay

Gets or sets Autoplay value of animation sequence. False for animations constructed without animation sequence data.

public bool Autoplay { get; init; }

Property Value

bool

Clip

Gets the animation clip data for ModelAnimation2 format.

public AnimationClip Clip { get; }

Property Value

AnimationClip

Delta

Gets or sets a value indicating whether this is a delta animation.

public bool Delta { get; init; }

Property Value

bool

Events

Gets the events defined in this animation.

public AnimationEvent[] Events { get; }

Property Value

AnimationEvent[]

Fetch

Gets fetch data for this animation. Null animations that were constructed without sequence data.

public AnimationFetch? Fetch { get; }

Property Value

AnimationFetch?

Fps

Gets the frames per second of the animation.

public float Fps { get; }

Property Value

float

FrameCount

Gets the total number of frames in the animation.

public int FrameCount { get; }

Property Value

int

FromSequence

Gets whether this animation was constructed from sequence data.

public bool FromSequence { get; }

Property Value

bool

Hidden

Gets or sets a value indicating whether the animation is hidden.

public bool Hidden { get; init; }

Property Value

bool

IsLooping

Gets a value indicating whether the animation loops.

public bool IsLooping { get; }

Property Value

bool

Movements

Gets the movement data for this animation.

public AnimationMovement[] Movements { get; }

Property Value

AnimationMovement[]

Name

Gets the name of the animation.

public string Name { get; }

Property Value

string

Realtime

Gets or sets LegacyRealtime value of animation sequence. False for animations constructed without animation sequence data.

public bool Realtime { get; init; }

Property Value

bool

SequenceParams

Gets the sequence parameters for this animation.

public AnimationSequenceParams SequenceParams { get; }

Property Value

AnimationSequenceParams

Worldspace

Gets or sets a value indicating whether this animation is in world space.

public bool Worldspace { get; init; }

Property Value

bool

Methods

DecodeFrame(Frame)

Decodes animation data for the specified frame.

public void DecodeFrame(Frame outFrame)

Parameters

outFrame Frame

FromData(KVObject, KVObject, Skeleton, FlexController[])

Creates animation instances from the provided animation data and decode key.

public static IEnumerable<Animation> FromData(KVObject animationData, KVObject decodeKey, Skeleton skeleton, FlexController[] flexControllers)

Parameters

animationData KVObject
decodeKey KVObject
skeleton Skeleton
flexControllers FlexController[]

Returns

IEnumerable<Animation>

FromResource(Resource, KVObject, Skeleton, FlexController[])

Creates animation instances from a resource file.

public static IEnumerable<Animation> FromResource(Resource resource, KVObject decodeKey, Skeleton skeleton, FlexController[] flexControllers)

Parameters

resource Resource
decodeKey KVObject
skeleton Skeleton
flexControllers FlexController[]

Returns

IEnumerable<Animation>

FromSequenceData(KVObject, KVObject, KVObject, Skeleton, FlexController[])

Creates animation instances from sequence data (ASEQ) and animation data (ANIM). This method uses sequence descriptors from ASEQ for names and metadata, while getting frame data from animations in ANIM that the sequences reference.

public static IEnumerable<Animation> FromSequenceData(KVObject sequenceData, KVObject animationData, KVObject decodeKey, Skeleton skeleton, FlexController[] flexControllers)

Parameters

sequenceData KVObject
animationData KVObject
decodeKey KVObject
skeleton Skeleton
flexControllers FlexController[]

Returns

IEnumerable<Animation>

GetMovementOffsetData(float)

Returns interpolated root motion data at the specified time.

public AnimationMovement.MovementData GetMovementOffsetData(float time)

Parameters

time float

Returns

AnimationMovement.MovementData

GetMovementOffsetData(int)

Returns interpolated root motion data at the specified frame.

public AnimationMovement.MovementData GetMovementOffsetData(int frame)

Parameters

frame int

Returns

AnimationMovement.MovementData

HasMovementData()

Determines whether this animation has movement data.

public bool HasMovementData()

Returns

bool

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Remarks

Returns the animation name.