Files
UnrealEngineUWP/Engine/Source/Editor/AnimationEditor/Public/IAnimationEditor.h
brooke hubert 8f0c7f389f Persona based editors use asset editor toolkits to create and own their mode managers
#Jira UE-94282
#rb lauren.barnes

[CL 13812948 by brooke hubert in ue5-main branch]
2020-07-01 11:20:18 -04:00

63 lines
2.0 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "PersonaAssetEditorToolkit.h"
#include "IHasPersonaToolkit.h"
#include "Animation/SmartName.h"
class UAnimationAsset;
class IAnimationSequenceBrowser;
class UAnimSequenceBase;
struct FRichCurve;
class ITimeSliderController;
enum class ERawCurveTrackTypes : uint8;
class IAnimationEditor : public FPersonaAssetEditorToolkit, public IHasPersonaToolkit
{
public:
/** Set the animation asset of the editor. */
virtual void SetAnimationAsset(UAnimationAsset* AnimAsset) = 0;
/** Get the asset browser we host */
virtual IAnimationSequenceBrowser* GetAssetBrowser() const = 0;
/** Support structure for EditCurves */
struct FCurveEditInfo
{
FCurveEditInfo(const FText& InCurveDisplayName, const FLinearColor& InCurveColor, const FSmartName& InName, ERawCurveTrackTypes InType, int32 InCurveIndex, FSimpleDelegate OnCurveModified = FSimpleDelegate())
: CurveDisplayName(InCurveDisplayName)
, CurveColor(InCurveColor)
, Name(InName)
, Type(InType)
, CurveIndex(InCurveIndex)
, OnCurveModified(OnCurveModified)
{}
FCurveEditInfo(const FSmartName& InName, ERawCurveTrackTypes InType, int32 InCurveIndex)
: Name(InName)
, Type(InType)
, CurveIndex(InCurveIndex)
{}
bool operator==(const FCurveEditInfo& InCurveEditInfo) const
{
return Name.UID == InCurveEditInfo.Name.UID && Type == InCurveEditInfo.Type && CurveIndex == InCurveEditInfo.CurveIndex;
}
FText CurveDisplayName;
FLinearColor CurveColor;
FSmartName Name;
ERawCurveTrackTypes Type;
int32 CurveIndex;
FSimpleDelegate OnCurveModified;
};
/** Edit the specified curves on the specified sequence */
virtual void EditCurves(UAnimSequenceBase* InAnimSequence, const TArray<FCurveEditInfo>& InCurveInfo, const TSharedPtr<ITimeSliderController>& InExternalTimeSliderController) = 0;
/** Stop editing the specified curves */
virtual void StopEditingCurves(const TArray<FCurveEditInfo>& InCurveInfo) = 0;
};