public void Evaluate() { for (int i = 0; i < this.m_Mixers.Count; i++) { AnimationOutputWeightProcessor.WeightInfo weightInfo = this.m_Mixers[i]; float num = (!weightInfo.modulate) ? 1f : weightInfo.parentMixer.GetInputWeight(weightInfo.port); weightInfo.parentMixer.SetInputWeight(weightInfo.port, num * WeightUtility.NormalizeMixer(weightInfo.mixer)); } this.m_Output.SetWeight(WeightUtility.NormalizeMixer(this.m_LayerMixer)); }
public void Evaluate() { m_Output.SetWeight(1); for (int i = 0; i < m_Mixers.Count; i++) { var mixInfo = m_Mixers[i]; float weight = mixInfo.modulate ? mixInfo.parentMixer.GetInputWeight(mixInfo.port) : 1.0f; mixInfo.parentMixer.SetInputWeight(mixInfo.port, weight * WeightUtility.NormalizeMixer(mixInfo.mixer)); } float normalizedWeight = WeightUtility.NormalizeMixer(m_LayerMixer); var animator = m_Output.GetTarget(); if (animator == null) { return; } #if UNITY_EDITOR // AnimationMotionXToDeltaPlayable must blend with default values when previewing tracks with absolute root motion. bool blendMotionX = !Application.isPlaying && m_MotionXPlayable.IsValid() && m_MotionXPlayable.IsAbsoluteMotion(); if (blendMotionX) { if (!m_PoseMixer.Equals(AnimationLayerMixerPlayable.Null)) { m_PoseMixer.SetInputWeight(0, 1.0f); m_PoseMixer.SetInputWeight(1, normalizedWeight); } } else { if (!m_PoseMixer.Equals(AnimationLayerMixerPlayable.Null)) { m_PoseMixer.SetInputWeight(0, 1.0f); m_PoseMixer.SetInputWeight(1, 1.0f); } m_Output.SetWeight(normalizedWeight); } #else m_Output.SetWeight(normalizedWeight); #endif }
public void Evaluate() { float weight = 1; m_Output.SetWeight(1); for (int i = 0; i < m_Mixers.Count; i++) { var mixInfo = m_Mixers[i]; weight = WeightUtility.NormalizeMixer(mixInfo.mixer); mixInfo.parentMixer.SetInputWeight(mixInfo.port, weight); } // only write the final weight in player/playmode. In editor, we are blending to the appropriate defaults // the last mixer in the list is the final blend, since the list is composed post-order. if (Application.isPlaying) { m_Output.SetWeight(weight); } }
public void Evaluate() { for (int i = 0; i < this.m_Mixers.Count; i++) { AnimationOutputWeightProcessor.WeightInfo weightInfo = this.m_Mixers[i]; float num = (!weightInfo.modulate) ? 1f : PlayableExtensions.GetInputWeight <Playable>(weightInfo.parentMixer, weightInfo.port); PlayableExtensions.SetInputWeight <Playable>(weightInfo.parentMixer, weightInfo.port, num * WeightUtility.NormalizeMixer(weightInfo.mixer)); } PlayableOutputExtensions.SetWeight <AnimationPlayableOutput>(this.m_Output, WeightUtility.NormalizeMixer(this.m_LayerMixer)); }