//depot/UE4-Orion/Engine/Source/Runtime/Engine/Private/Animation/AnimMontage.cpp

to //depot/UE4/Engine/Source/Runtime/Engine/Private/Animation/AnimMontage.cpp

#lockdown : Ben.Marsh

Talked to Marc Auidy w.r.t. merging this change to Fortnite

[CL 2721274 by Lina Halper in Main branch]
This commit is contained in:
Lina Halper
2015-10-08 10:06:46 -04:00
committed by lina.halper@epicgames.com
parent 2b7bed798c
commit 0d91c29a77

View File

@@ -877,8 +877,8 @@ void FAnimMontageInstance::Stop(const FAlphaBlend& InBlendOut, bool bInterrupt)
bInterrupted = bInterrupt;
}
// if desired weight is > 0.f, turn that off
if (Blend.GetDesiredValue() > 0.f)
// if it hasn't stopped, stop now
if (IsStopped() == false)
{
// do not use default Montage->BlendOut
// depending on situation, the BlendOut time can change
@@ -1073,7 +1073,7 @@ bool FAnimMontageInstance::SetNextSectionID(int32 const & SectionID, int32 const
void FAnimMontageInstance::OnMontagePositionChanged(FName const & ToSectionName)
{
if (bPlaying && (Blend.GetDesiredValue() == 0.f))
if (bPlaying && IsStopped())
{
UE_LOG(LogAnimation, Warning, TEXT("Changing section on Montage (%s) to '%s' during blend out. This can cause incorrect visuals!"),
*GetNameSafe(Montage), *ToSectionName.ToString());
@@ -1437,8 +1437,8 @@ void FAnimMontageInstance::Advance(float DeltaTime, struct FRootMotionMovementPa
}
}
// If current section is last one, check to trigger a blend out.
if( NextSectionIndex == INDEX_NONE )
// If current section is last one, check to trigger a blend out and if it hasn't stopped yet, see if we should stop
if (NextSectionIndex == INDEX_NONE && !IsStopped())
{
const float DeltaPosToEnd = bPlayingForward ? (CurrentSectionLength - PosInSection) : PosInSection;
const float DeltaTimeToEnd = DeltaPosToEnd / FMath::Abs(CombinedPlayRate);
@@ -1504,7 +1504,7 @@ void FAnimMontageInstance::Advance(float DeltaTime, struct FRootMotionMovementPa
}
// If this Montage has no weight, it should be terminated.
if ((Blend.GetDesiredValue()<= ZERO_ANIMWEIGHT_THRESH) && (Blend.IsComplete()))
if (IsStopped() && (Blend.IsComplete()))
{
// nothing else to do
Terminate();