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[]

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[]

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

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

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>

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.