Core.PoseMixer
Mixes several weighted animation streams into one output stream.
Read time 1 minuteLast updated 4 hours ago
Definition
- Type: Struct
- Namespace: Unity.Animations
- Assembly: UnityEngine.AnimationCoreModule
[BurstCompile]public struct Core.PoseMixer
Remarks
The mixer adds the continuous channels of each stream, multiplied by the weight of the stream. It takes the discrete channels, such as integers and entity IDs, from the stream with the greatest weight. Use it, for example, to mix streams with the weights that a blend space computes.
To mix streams, follow these steps:
- Declare a . The default value is ready to use.
PoseMixer - Call Core.PoseMixer.Begin with the output stream. The method resets the output stream to zero.
- Call Core.PoseMixer.Add once for each stream and its weight.
- Call Core.PoseMixer.End to finish the mix. The output stream isn't a valid pose until you call it.
All streams must use the same rig. If safety checks are enabled, throws an if a stream uses another rig.
AddInvalidOperationExceptionThe weights aren't normalized. If they sum to more than 1, the translations and scales are a weighted sum of the streams, not an average, and the mixer doesn't add a default pose. The method normalizes rotations once, after the mixer adds all streams. This differs from chaining pairwise blends.
EndAdditional Resources: AnimationStreamBlendingExtensions, FreeformBlendSpace2DData