Table of Contents

Class Animation

Namespace
PlumJsonAnimator.Models.SkeletonNameSpace
Assembly
PlumJsonAnimator.dll

Provides methods for work with animations

public class Animation : INotifyable, INotifyPropertyChanged
Inheritance
Animation
Implements
Inherited Members

Constructors

Animation(GlobalState, Interpolation)

public Animation(GlobalState globalState, Interpolation interpolation)

Parameters

globalState GlobalState
interpolation Interpolation

Animation(GlobalState, Interpolation, string)

public Animation(GlobalState globalState, Interpolation interpolation, string name)

Parameters

globalState GlobalState
interpolation Interpolation
name string

Fields

BoneAnimationBinding

public Dictionary<Bone, BoneAnimation> BoneAnimationBinding

Field Value

Dictionary<Bone, BoneAnimation>

currentTime

public double currentTime

Field Value

double

Properties

IsRun

public bool IsRun { get; set; }

Property Value

bool

Name

public string Name { get; set; }

Property Value

string

Methods

AddKeyFrame(Bone, TransformModesTypes)

Add keyframe to animation via UI

public void AddKeyFrame(Bone b, TransformModesTypes type)

Parameters

b Bone

Bone

type TransformModesTypes

Current transform type

ContainsAnimationBone(BoneAnimation)

Checks if the bone has any movement

public bool ContainsAnimationBone(BoneAnimation boneAnimation)

Parameters

boneAnimation BoneAnimation

Returns

bool

ContainsBone(Bone)

Checks whether a bone is involved in an animation

public bool ContainsBone(Bone bone)

Parameters

bone Bone

Returns

bool

DeleteBoneFromAnimation(Bone)

public void DeleteBoneFromAnimation(Bone bone)

Parameters

bone Bone

DeleteKeyFrame(Bone, TransformModesTypes)

Delete keyframe

public void DeleteKeyFrame(Bone b, TransformModesTypes type)

Parameters

b Bone

Bone

type TransformModesTypes

Current transform type

FindKeyFrame(Bone, double, TransformModesTypes, bool)

Find current keyframes

public double FindKeyFrame(Bone b, double time, TransformModesTypes type, bool isNext)

Parameters

b Bone

Bone

time double

Current time

type TransformModesTypes

Current transform type

isNext bool

Next or previous keyframe

Returns

double

GenerateCode()

Turn animation JSON object into JSON string

public string GenerateCode()

Returns

string

GenerateJSONData()

Turn animation data into JSON object

public AnimationData GenerateJSONData()

Returns

AnimationData

GetKeyFramesMarks(Bone)

Collects data about keyframes for drawing in ui

public Dictionary<double, Dictionary<KeyFrameTypes, bool>> GetKeyFramesMarks(Bone b)

Parameters

b Bone

Returns

Dictionary<double, Dictionary<KeyFrameTypes, bool>>

A dictionary, contains time-keys and another dictionary with keyframes

MaxTime()

Animation end time

public double MaxTime()

Returns

double

RotateBone(Bone, double?)

Add bone rotating into current animation

public void RotateBone(Bone b, double? value)

Parameters

b Bone

Bone that has to be moved

value double?

Target angle

RotateBone(Bone, double?, double?)

Add bone translating into current animation

public void RotateBone(Bone b, double? value, double? currTime)

Parameters

b Bone

Bone that has to be moved

value double?

Target angle

currTime double?

Target time

SetupBones()

Sets all bones according to the current time

public void SetupBones()

Step()

Makes animation step

public void Step()

TranslateBone(Bone, double?, double?)

Add bone translating into current animation

public void TranslateBone(Bone b, double? x, double? y)

Parameters

b Bone

Bone that has to be moved

x double?

Target x coordinate

y double?

Target y coordinate

TranslateBone(Bone, double?, double?, double?)

Add bone translating into current animation

public void TranslateBone(Bone b, double? x, double? y, double? currTime)

Parameters

b Bone

Bone that has to be moved

x double?

Target x coordinate

y double?

Target y coordinate

currTime double?

Target time