Table of Contents

Class AnimationMetaData

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll
public class AnimationMetaData
Inheritance
AnimationMetaData
Inherited Members

Fields

Animation

The animations code identifier that we want to play

[JsonProperty]
public string Animation

Field Value

string

AnimationSpeed

[JsonProperty]
public float AnimationSpeed

Field Value

float

Attributes

[JsonProperty]
[JsonConverter(typeof(JsonAttributesConverter))]
public JsonObject Attributes

Field Value

JsonObject

BlendMode

[JsonProperty]
public EnumAnimationBlendMode BlendMode

Field Value

EnumAnimationBlendMode

ClientSide

If true, the server does not sync this animation

[JsonProperty]
public bool ClientSide

Field Value

bool

Code

Unique identifier to be able to reference this AnimationMetaData instance

[JsonProperty]
public string Code

Field Value

string

CodeCrc32

public uint CodeCrc32

Field Value

uint

EaseInSpeed

A multiplier applied to the weight value to "ease in" the animation. Choose a high value for looping animations or it will be glitchy

[JsonProperty]
public float EaseInSpeed

Field Value

float

EaseOutSpeed

A multiplier applied to the weight value to "ease out" the animation. Choose a high value for looping animations or it will be glitchy

[JsonProperty]
public float EaseOutSpeed

Field Value

float

ElementBlendMode

[JsonProperty]
public Dictionary<string, EnumAnimationBlendMode> ElementBlendMode

Field Value

Dictionary<string, EnumAnimationBlendMode>

ElementWeight

[JsonProperty]
public Dictionary<string, float> ElementWeight

Field Value

Dictionary<string, float>

HoldEyePosAfterEasein

[JsonProperty]
public float HoldEyePosAfterEasein

Field Value

float

MulWithWalkSpeed

[JsonProperty]
public bool MulWithWalkSpeed

Field Value

bool

StartFrameOnce

public float StartFrameOnce

Field Value

float

SupressDefaultAnimation

[JsonProperty]
public bool SupressDefaultAnimation

Field Value

bool

TriggeredBy

[JsonProperty]
public AnimationTrigger TriggeredBy

Field Value

AnimationTrigger

WasStartedFromTrigger

public bool WasStartedFromTrigger

Field Value

bool

Weight

[JsonProperty]
public float Weight

Field Value

float

WeightCapFactor

This property can be used in cases where a animation with high weight is played alongside another animation with low element weight. In these cases, the easeIn become unaturally fast. Setting a value of 0.8f or similar here addresses this issue 0f = uncapped weight 0.5f = weight cannot exceed 2 1f = weight cannot exceed 1

[JsonProperty]
public float WeightCapFactor

Field Value

float

Methods

Clone()

public AnimationMetaData Clone()

Returns

AnimationMetaData

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

FromBytes(BinaryReader, string)

public static AnimationMetaData FromBytes(BinaryReader reader, string version)

Parameters

reader BinaryReader
version string

Returns

AnimationMetaData

GetCrc32(string)

public static uint GetCrc32(string animcode)

Parameters

animcode string

Returns

uint

GetCurrentAnimationSpeed(float)

public float GetCurrentAnimationSpeed(float walkspeed)

Parameters

walkspeed float

Returns

float

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Init()

public AnimationMetaData Init()

Returns

AnimationMetaData

Matches(int)

public bool Matches(int currentActivities)

Parameters

currentActivities int

Returns

bool

ToBytes(BinaryWriter)

public void ToBytes(BinaryWriter writer)

Parameters

writer BinaryWriter