SkeletonKeyFrameAnimation Class |
Namespace: DigitalRune.Animation.Character
The SkeletonKeyFrameAnimation type exposes the following members.
Name | Description | |
---|---|---|
SkeletonKeyFrameAnimation |
Initializes a new instance of the SkeletonKeyFrameAnimation class.
|
Name | Description | |
---|---|---|
AddKeyFrame |
Adds a key frame for the specified bone.
| |
Clear |
Removes all key frames and bone weights.
| |
Clone |
Clones this instance.
| |
Compress |
Compresses the animation using a simple lossy compression algorithm.
| |
Equals | (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
Freeze |
Prepares this animation for runtime usage. (Must be called after all key frames have been
added!)
| |
GetAnimationTime |
Gets the animation time for the specified time on the timeline.
| |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetState |
Gets the state of the animation for the specified time on the timeline.
| |
GetTotalDuration |
Gets the total length of the timeline.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GetValue |
Gets the value of the animation at the specified time.
| |
GetWeight |
Gets the weight for a specific bone animation channel.
| |
IsBoneAnimated |
Determines whether this animation animates the specified bone.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
SetWeight |
Sets the weight for a specific bone animation channel.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
EnableInterpolation |
Gets or sets a value indicating whether values between key frames are interpolated.
| |
FillBehavior |
Gets or sets a value that specifies how the animation behaves when it reaches the end of its
duration.
| |
IsAdditive |
Gets or sets a value indicating whether the output of the animation is added to the current
value of the property that is being animated.
| |
IsFrozen |
Gets a value indicating whether this animation is frozen.
| |
TargetObject |
Gets or sets the property to which the animation is applied by default.
| |
TargetProperty |
Gets or sets the property to which the animation is applied by default.
| |
Traits |
Gets the traits of the animation values.
|
Name | Description | |
---|---|---|
IAnimationCreateBlendAnimation |
Creates a new BlendAnimationT. (For internal use only.)
| |
ITimelineCreateInstance |
Creates an animation instance that can be used to play back the animation.
(For internal use only.)
|
The SkeletonKeyFrameAnimation is an optimized KeyFrameAnimationT for character animation. A SkeletonKeyFrameAnimation instance animates the bone transforms of a SkeletonPose. It can animate a single bone (e.g. only the head), several bones (e.g. an upper body animation) or all bones of skeleton at once.
A SkeletonKeyFrameAnimation is defined by adding key frames calling the method AddKeyFrame(Int32, TimeSpan, SrtTransform) for the animated bones. The animation controls a bone if at least one key frame for the bone has been added (see also IsBoneAnimated(Int32)). After adding all key frames, Freeze must be called. Freeze optimizes the animation data for fast access at runtime.
When key frames are added after calling Freeze, the animation is automatically reset into an editable state. All internal optimizations will be discarded! Freeze needs to be called again after all key frames are added.
Bone Channel Weights:
A weight can be set for each animated bone (see SetWeight(Int32, Single)). If the weight is 0,
the bone is not animated. If the weight is 1, the bone is animated and replaces all preceding
animations in the animation composition chain. If the weight is less than 1, the bone
animation is blended with preceding animations.
Weights can be modified before and after Freeze. For example, weights can be modified while the animation is running.
Key Frame Interpolation:
A key frame animation contains a list of key frames that define the animation values at
certain points in time. When the animation is played the class automatically looks up the
animation value in the list of key frames. The property EnableInterpolation
defines whether interpolation between key frames is enabled. When the property is set
(default), the values between two key frames are interpolated using linear interpolation.
Cyclic Animations:
A skeleton key frame animation, by default, runs until the last key frame is reached. The
types TimelineClip and AnimationClipT can be used to repeat the
entire key frame animation (or a certain clip) for a number of times using a certain
loop-behavior (see LoopBehavior).
The first and the last key frame need to be identical to achieve a smooth cyclic interpolation.