Class Animation
- 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
Clip
Gets the animation clip data for ModelAnimation2 format.
public AnimationClip Clip { get; }
Property Value
Delta
Gets or sets a value indicating whether this is a delta animation.
public bool Delta { get; init; }
Property Value
Events
Gets the events defined in this animation.
public AnimationEvent[] Events { get; }
Property Value
Fps
Gets the frames per second of the animation.
public float Fps { get; }
Property Value
FrameCount
Gets the total number of frames in the animation.
public int FrameCount { get; }
Property Value
Hidden
Gets or sets a value indicating whether the animation is hidden.
public bool Hidden { get; init; }
Property Value
IsLooping
Gets a value indicating whether the animation loops.
public bool IsLooping { get; }
Property Value
Movements
Gets the movement data for this animation.
public AnimationMovement[] Movements { get; }
Property Value
Name
Gets the name of the animation.
public string Name { get; }
Property Value
SequenceParams
Gets the sequence parameters for this animation.
public AnimationSequenceParams SequenceParams { get; }
Property Value
Worldspace
Gets or sets a value indicating whether this animation is in world space.
public bool Worldspace { get; init; }
Property Value
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
KVObjectdecodeKey
KVObjectskeleton
SkeletonflexControllers
FlexController[]
Returns
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
ResourcedecodeKey
KVObjectskeleton
SkeletonflexControllers
FlexController[]
Returns
GetMovementOffsetData(float)
Returns interpolated root motion data at the specified time.
public AnimationMovement.MovementData GetMovementOffsetData(float time)
Parameters
time
float
Returns
GetMovementOffsetData(int)
Returns interpolated root motion data at the specified frame.
public AnimationMovement.MovementData GetMovementOffsetData(int frame)
Parameters
frame
int
Returns
HasMovementData()
Determines whether this animation has movement data.
public bool HasMovementData()
Returns
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.