Files
UnrealEngineUWP/Engine/Source/Editor/UnrealEd/Private/Animation/EditorNotifyObject.cpp
Lina Halper 44c1bb3292 COPY from //Dev-Anim to //Dev-Main
#rb: none
#fyi: Laurent.Delayen, Thomas.Sarkanen

[CL 11088765 by Lina Halper in Main branch]
2020-01-22 17:58:55 -05:00

49 lines
1017 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "Animation/EditorNotifyObject.h"
#include "Animation/AnimSequenceBase.h"
UEditorNotifyObject::UEditorNotifyObject(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}
bool UEditorNotifyObject::ApplyChangesToMontage()
{
if(AnimObject)
{
for(FAnimNotifyEvent& Notify : AnimObject->Notifies)
{
if(Notify.Guid == Event.Guid)
{
Event.OnChanged(Event.GetTime());
// If we have a duration this is a state notify
if(Event.GetDuration() > 0.0f)
{
Event.EndLink.OnChanged(Event.EndLink.GetTime());
// Always keep link methods in sync between notifies and duration links
if(Event.GetLinkMethod() != Event.EndLink.GetLinkMethod())
{
Event.EndLink.ChangeLinkMethod(Event.GetLinkMethod());
}
}
Notify = Event;
break;
}
}
}
return true;
}
void UEditorNotifyObject::InitialiseNotify(const FAnimNotifyEvent& InNotify)
{
if(AnimObject)
{
Event = InNotify;
}
}