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
globalStateGlobalStateinterpolationInterpolation
Animation(GlobalState, Interpolation, string)
public Animation(GlobalState globalState, Interpolation interpolation, string name)
Parameters
globalStateGlobalStateinterpolationInterpolationnamestring
Fields
BoneAnimationBinding
public Dictionary<Bone, BoneAnimation> BoneAnimationBinding
Field Value
currentTime
public double currentTime
Field Value
Properties
IsRun
public bool IsRun { get; set; }
Property Value
Name
public string Name { get; set; }
Property Value
Methods
AddKeyFrame(Bone, TransformModesTypes)
Add keyframe to animation via UI
public void AddKeyFrame(Bone b, TransformModesTypes type)
Parameters
bBoneBone
typeTransformModesTypesCurrent transform type
ContainsAnimationBone(BoneAnimation)
Checks if the bone has any movement
public bool ContainsAnimationBone(BoneAnimation boneAnimation)
Parameters
boneAnimationBoneAnimation
Returns
ContainsBone(Bone)
Checks whether a bone is involved in an animation
public bool ContainsBone(Bone bone)
Parameters
boneBone
Returns
DeleteBoneFromAnimation(Bone)
public void DeleteBoneFromAnimation(Bone bone)
Parameters
boneBone
DeleteKeyFrame(Bone, TransformModesTypes)
Delete keyframe
public void DeleteKeyFrame(Bone b, TransformModesTypes type)
Parameters
bBoneBone
typeTransformModesTypesCurrent transform type
FindKeyFrame(Bone, double, TransformModesTypes, bool)
Find current keyframes
public double FindKeyFrame(Bone b, double time, TransformModesTypes type, bool isNext)
Parameters
bBoneBone
timedoubleCurrent time
typeTransformModesTypesCurrent transform type
isNextboolNext or previous keyframe
Returns
GenerateCode()
Turn animation JSON object into JSON string
public string GenerateCode()
Returns
GenerateJSONData()
Turn animation data into JSON object
public AnimationData GenerateJSONData()
Returns
GetKeyFramesMarks(Bone)
Collects data about keyframes for drawing in ui
public Dictionary<double, Dictionary<KeyFrameTypes, bool>> GetKeyFramesMarks(Bone b)
Parameters
bBone
Returns
- Dictionary<double, Dictionary<KeyFrameTypes, bool>>
A dictionary, contains time-keys and another dictionary with keyframes
MaxTime()
Animation end time
public double MaxTime()
Returns
RotateBone(Bone, double?)
Add bone rotating into current animation
public void RotateBone(Bone b, double? value)
Parameters
RotateBone(Bone, double?, double?)
Add bone translating into current animation
public void RotateBone(Bone b, double? value, double? currTime)
Parameters
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
TranslateBone(Bone, double?, double?, double?)
Add bone translating into current animation
public void TranslateBone(Bone b, double? x, double? y, double? currTime)