Timeline Mixer Documentation
TimelineMixer.AnimationBalancer Class Reference

Keeps animation mixer playable input values from becoming overweight. If the total weights on an animation mixer playable exceed 1f the animations do not look correct or blended properly. AnimationBalancer fixes this by automatically reducing weights of all connections if the total intended weights exceed 1f. Connections target values are remembered, and will be restored if the total input weight does not exceed 1f. More...

Public Member Functions

void SetTargetWeight (float targetWeight, List< int > connectionPorts, bool isSoloMode=false)
 Sets the target weight for connections to try to reach More...
 
void BalanceWeights ()
 All AnimationMixerPlayable input weights (Excluding the first if it is linked to an AnimatorControllerPlayable) will be normalized between 0 and 1, preventing animation artifacts. Target values are remembered and restored.
 

Private Attributes

Playable animationMixer
 The Animation Mixer Playable to balance input weights on.
 
int inputCount
 Cache number of inputs.
 
float[] targetWeights = new float[] { }
 Keep track of the intended connection weights so they can be restored when appropriate.
 
List< int > connectionPorts = new List<int>()
 List of the output ports from the Timeline Playable that will have weights modified.
 

Detailed Description

Keeps animation mixer playable input values from becoming overweight. If the total weights on an animation mixer playable exceed 1f the animations do not look correct or blended properly. AnimationBalancer fixes this by automatically reducing weights of all connections if the total intended weights exceed 1f. Connections target values are remembered, and will be restored if the total input weight does not exceed 1f.

Member Function Documentation

◆ SetTargetWeight()

void TimelineMixer.AnimationBalancer.SetTargetWeight ( float  targetWeight,
List< int >  connectionPorts,
bool  isSoloMode = false 
)
inline

Sets the target weight for connections to try to reach

Parameters
targetWeightThe target weight between the timeline and mixer
connectionPortsList of the output ports from the Timeline Playable that will have weights modified