BlendGroup Class |
Namespace: DigitalRune.Animation
The BlendGroup type exposes the following members.
Name | Description | |
---|---|---|
BlendGroup |
Initializes a new instance of the BlendGroup class.
|
Name | Description | |
---|---|---|
Add(ITimeline) |
Adds a timeline with a blend weight of 1 to the BlendGroup.
| |
Add(ITimeline, Single) |
Adds a timeline with the specified blend weight to the BlendGroup.
| |
Clear |
Removes all timelines from the BlendGroup.
| |
Contains |
Determines whether the BlendGroup contains a specific timeline.
| |
CreateInstance |
Creates an animation instance that can be used to play back the animation.
(For internal use only.)
| |
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.) | |
GetAnimationTime |
Gets the animation time for the specified time on the timeline.
| |
GetEnumerator |
Returns an enumerator that iterates through the BlendGroup.
| |
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.) | |
GetWeight(Int32) |
Gets the blend weight of the timeline with the specified index.
| |
GetWeight(ITimeline) |
Gets the blend weight of the specified timeline.
| |
GetWeightAsAnimatable(Int32) |
Gets the blend weight of the timeline with the specified index as an
IAnimatablePropertyT.
| |
GetWeightAsAnimatable(ITimeline) |
Gets the blend weight of the specified timeline as an IAnimatablePropertyT.
| |
IndexOf |
Determines the index of a specific timeline in the BlendGroup.
| |
Insert |
Inserts a timeline into the BlendGroup at the specified index.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Remove |
Removes the first occurrence of a specific timeline from the BlendGroup.
| |
RemoveAt |
Removes the timeline at the specified index from the BlendGroup.
| |
SetWeight(Int32, Single) |
Sets the blend weight of the timeline at the specified index.
| |
SetWeight(ITimeline, Single) |
Sets the blend weight of the specified timeline.
| |
SynchronizeDurations |
Synchronizes the durations of the animations in the blend group.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
AddRangeITimeline |
Adds the specified items to the ICollectionT.
(Defined by CollectionHelper.) | |
DoITimeline(ActionITimeline) | Overloaded.
Performs the given action on each element in a sequence when it is enumerated.
(Defined by LinqHelper.) | |
DoITimeline(ActionITimeline, Int32) | Overloaded.
Performs the given action on each element (incorporating its index) in a sequence when it is
enumerated.
(Defined by LinqHelper.) | |
ForEachITimeline(ActionITimeline) | Overloaded.
Immediately performs the given action on each element in a sequence.
(Defined by LinqHelper.) | |
ForEachITimeline(ActionITimeline, Int32) | Overloaded.
Immediately performs the given action on each element (incorporating its index) in a
sequence.
(Defined by LinqHelper.) | |
IndexOfITimeline |
Returns the index of the first element in a sequence that satisfies the specified condition.
(Defined by LinqHelper.) |
Name | Description | |
---|---|---|
Count |
Gets the number of timelines contained in the BlendGroup.
| |
Delay |
Gets or sets the time at which the animation begins.
| |
Duration |
Gets or sets the duration for which the animation is played.
| |
FillBehavior |
Gets or sets a value that specifies how the animation behaves when it reaches the end of its
duration.
| |
Item |
Gets or sets the timeline at the specified index.
| |
LoopBehavior |
Gets or sets the behavior of the animations past the end of the duration.
| |
Speed |
Gets or sets the speed ratio at which the animation is played.
| |
SynchronizedDuration |
Gets the duration of a single cycle of the blended animations.
| |
TargetObject |
Gets or sets the object to which the animation is applied by default.
|
Name | Description | |
---|---|---|
ICollectionITimelineCopyTo | ||
IEnumerableITimelineGetEnumerator |
Returns an enumerator that iterates through the collection.
| |
IEnumerableGetEnumerator |
Returns an enumerator that iterates through the collection.
| |
ICollectionITimelineIsReadOnly |
Gets a value indicating whether this collection is read-only.
| |
IAnimatableObjectGetAnimatablePropertyT |
Gets the property with given name and type which can be animated.
| |
IAnimatableObjectGetAnimatedProperties |
Gets the properties which are currently being animated.
| |
INamedObjectName |
Not implemented.
|
A blend group is a collection of animations (timelines). It automatically blends the animations based on a blend weight, which can be set using SetWeight(ITimeline, Single). The blend weight indicates the importance of the corresponding animation. For example, if one animation has a blend weight of 1 and another animation has a blend weight of 0.5 then the second has less influence on the animation result. A blend weight can be set to 0 to disable the animation.
The blend weights are internally normalized, meaning that the blend weights do not need be in the range [0, 1] when they are set. Blend weights can have any value equal to or greater than 0. The sum of all blend weights should be greater than 0 - i.e. at least one animation should to be active!
A blend group can contain TimelineGroups. In this case the animations within one TimelineGroup are blended with the matching animations in the other TimelineGroups. The animations are matched by comparing the TargetProperty properties.
Synchronization: Most animations have different durations. When blending cyclic animations, for example, a "Walk" cycle and a "Run" cycle of a character, then it is important to synchronize the durations of the animations. When a "Walk" cycle and a "Run" cycle are blended with equal blend weights then the result should be the average of "Walk" and "Run". The duration of the blended animation should be the average both cycles. A key frame of the "Walk" cycle needs to be interpolated with the matching key frame of the "Run" cycle. In order to synchronize the animations the method SynchronizeDurations needs to be called when all animations have been set.
Note that synchronization is optional. The methods SynchronizeDurations does not need to be called if the contained animations do not need to be synchronized.
Limitations: A blend group has certain limitations.
Animating Blend Weights: The blend weights in a blend group can be animated. The method GetWeightAsAnimatable(ITimeline) returns an IAnimatablePropertyT that represent the blend weight of the specified timeline and can be animated.
A blend group also implements the interface IAnimatableObject. The blend weights can also be retrieved using GetAnimatablePropertyT(String) where the blend weights are identified using the strings "Weight0", Weight1", etc. The suffix is the index of the associated timeline.