Files
UnrealEngineUWP/Engine/Source/Editor/MovieSceneTools/Private/MovieSceneBuiltInEasingFunctionVisualizer.h
benjamin jillich a33398bd9b New custom widget for EAlphaBlendOption properties showing a combo box with the curve graph and name
* New custom widget for EAlphaBlendOption properties showing a combo box with the curve graph and name inside it. Once clicking on it, a borderless overlay window will be opened showing a grid of available curve types (like in Sequencer).
* Refactor: Separated the easing customization into a grid compound widget that shows the curve types and the actual customization.
* The grid widget holding the curves now has a filter, to exclude unsupported curve types for various situations. (e.g. we do support more easing curve types than we do for alpha blends in state transitions).
* Created a new compound widget that shows a curve and the name below it, which is used as button content for the new combo box.
* Curve types use grouping set in the enum.

Testing:
* Made sure the easing curve type menu in Sequencer works the way it worked before.
* Made sure the blend modes in the state transitions and e.g. a blend poses anim graph node works the same way as before.

#jira: https://jira.it.epicgames.com/browse/UE-166261
Initial slack channel discussion: https://epicgames.slack.com/archives/C044VB3LCKX/p1664989593947499
Continued slack thread: https://epicgames.slack.com/archives/C0450453V6J/p1665577875211299
#preflight 63578cdef726e94fe038af63

[CL 22746945 by benjamin jillich in ue5-main branch]
2022-10-25 03:28:25 -04:00

46 lines
1.5 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "HAL/Platform.h"
#include "IDetailCustomization.h"
#include "Generators/MovieSceneEasingCurves.h"
#include "Templates/SharedPointer.h"
#include "Widgets/SCompoundWidget.h"
class IDetailLayoutBuilder;
enum class EMovieSceneBuiltInEasing : uint8;
class FReply;
class IPropertyHandle;
/** Widget showing the curve graph */
class SBuiltInFunctionVisualizer : public SCompoundWidget
{
public:
SLATE_BEGIN_ARGS(SBuiltInFunctionVisualizer) {}
SLATE_END_ARGS();
virtual ~SBuiltInFunctionVisualizer() = default;
void Construct(const FArguments& InArgs, EMovieSceneBuiltInEasing InValue);
void SetType(EMovieSceneBuiltInEasing InValue);
void SetAnimationDuration(float TimeInSeconds) { AnimationDuration = TimeInSeconds; }
private:
void OnMouseEnter(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override final;
void OnMouseLeave(const FPointerEvent& MouseEvent) override final;
EActiveTimerReturnType TickInterp(const double InCurrentTime, const float InDeltaTime);
int32 OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& MyClippingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled) const;
TSharedPtr<FActiveTimerHandle> TimerHandle;
double MouseOverTime;
EMovieSceneBuiltInEasing EasingType;
FVector2D InterpValue;
TArray<FVector2D> Samples;
float AnimationDuration = 0.5f; /** Preview animation duration in seconds. */
};