Files
UnrealEngineUWP/Engine/Source/Editor/UMGEditor/Private/Animation/UMGDetailKeyframeHandler.cpp
Ben Marsh 20bf0eb6a1 Updating copyright notices to 2017 (copying from //Tasks/UE4/Dev-Copyright-2017).
#rb none
#lockdown Nick.Penwarden

[CL 3226823 by Ben Marsh in Main branch]
2016-12-08 08:52:44 -05:00

32 lines
1.2 KiB
C++

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#include "Animation/UMGDetailKeyframeHandler.h"
#include "Animation/WidgetAnimation.h"
#include "PropertyHandle.h"
FUMGDetailKeyframeHandler::FUMGDetailKeyframeHandler(TSharedPtr<FWidgetBlueprintEditor> InBlueprintEditor)
: BlueprintEditor( InBlueprintEditor )
{}
bool FUMGDetailKeyframeHandler::IsPropertyKeyable(UClass* InObjectClass, const IPropertyHandle& InPropertyHandle) const
{
return BlueprintEditor.Pin()->GetSequencer()->CanKeyProperty(FCanKeyPropertyParams(InObjectClass, InPropertyHandle));
}
bool FUMGDetailKeyframeHandler::IsPropertyKeyingEnabled() const
{
UMovieSceneSequence* Sequence = BlueprintEditor.Pin()->GetSequencer()->GetRootMovieSceneSequence();
return Sequence != nullptr && Sequence != UWidgetAnimation::GetNullAnimation();
}
void FUMGDetailKeyframeHandler::OnKeyPropertyClicked(const IPropertyHandle& KeyedPropertyHandle)
{
TArray<UObject*> Objects;
KeyedPropertyHandle.GetOuterObjects( Objects );
FKeyPropertyParams KeyPropertyParams(Objects, KeyedPropertyHandle, ESequencerKeyMode::ManualKeyForced);
BlueprintEditor.Pin()->GetSequencer()->KeyProperty(KeyPropertyParams);
}