UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
WidgetAnimation.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
11#include "WidgetAnimation.generated.h"
12
13class UMovieScene;
14class UUserWidget;
15
16#if WITH_EDITOR
17struct FSlateBrush;
18#endif
19
20
24UCLASS(BlueprintType, MinimalAPI)
26{
28
29public:
30
31#if WITH_EDITOR
38
40 const FString& GetDisplayLabel() const
41 {
42 return DisplayLabel;
43 }
44
46 UMG_API void SetDisplayLabel(const FString& InDisplayLabel);
47
49 UMG_API virtual FText GetDisplayName() const override;
50#endif
51
58 UFUNCTION(BlueprintCallable, Category="Animation")
59 UMG_API float GetStartTime() const;
60
67 UFUNCTION(BlueprintCallable, Category="Animation")
68 UMG_API float GetEndTime() const;
69
70 // These animation binding functions were added so that we could cleanly upgrade assets
71 // from before animation sharing, they don't actually modify the animation, they just pipe
72 // through to the UUserWidget. If we didn't put the functions here, it would be much more
73 // difficult to upgrade users who were taking advantage of the Many-To-1, blueprint having
74 // many animations binding to the same delegate.
75
76 UFUNCTION(BlueprintCallable, Category = Animation, meta=(BlueprintInternalUseOnly = "TRUE"))
77 void BindToAnimationStarted(UUserWidget* Widget, FWidgetAnimationDynamicEvent Delegate);
78
79 UFUNCTION(BlueprintCallable, Category = Animation, meta = (BlueprintInternalUseOnly = "TRUE"))
80 void UnbindFromAnimationStarted(UUserWidget* Widget, FWidgetAnimationDynamicEvent Delegate);
81
82 UFUNCTION(BlueprintCallable, Category = Animation, meta = (BlueprintInternalUseOnly = "TRUE"))
83 void UnbindAllFromAnimationStarted(UUserWidget* Widget);
84
85 UFUNCTION(BlueprintCallable, Category = Animation, meta = (BlueprintInternalUseOnly = "TRUE"))
86 void BindToAnimationFinished(UUserWidget* Widget, FWidgetAnimationDynamicEvent Delegate);
87
88 UFUNCTION(BlueprintCallable, Category = Animation, meta = (BlueprintInternalUseOnly = "TRUE"))
89 void UnbindFromAnimationFinished(UUserWidget* Widget, FWidgetAnimationDynamicEvent Delegate);
90
91 UFUNCTION(BlueprintCallable, Category = Animation, meta = (BlueprintInternalUseOnly = "TRUE"))
92 void UnbindAllFromAnimationFinished(UUserWidget* Widget);
93
94public:
95
96 // UMovieSceneAnimation overrides
97 virtual void BindPossessableObject(const FGuid& ObjectId, UObject& PossessedObject, UObject* Context) override;
98 virtual bool CanPossessObject(UObject& Object, UObject* InPlaybackContext) const override;
99 virtual UMovieScene* GetMovieScene() const override;
100 virtual UObject* GetParentObject(UObject* Object) const override;
101 virtual void UnbindPossessableObjects(const FGuid& ObjectId) override;
102 virtual void UnbindObjects(const FGuid& ObjectId, const TArray<UObject*>& InObjects, UObject* InContext) override {}
103 virtual void UnbindInvalidObjects(const FGuid& ObjectId, UObject* InContext) override {}
104 virtual void LocateBoundObjects(const FGuid& ObjectId, const UE::UniversalObjectLocator::FResolveParams& ResolveParams, TSharedPtr<const FSharedPlaybackState> SharedPlaybackState, TArray<UObject*, TInlineAllocator<1>>& OutObjects) const override;
105 virtual UObject* CreateDirectorInstance(TSharedRef<const FSharedPlaybackState> SharedPlaybackState, FMovieSceneSequenceID SequenceID) override;
106
107
108#if WITH_EDITOR
109 virtual void IterateDynamicBindings(TFunction<void(const FGuid&, FMovieSceneDynamicBinding&)> InCallback) override;
111 virtual bool IsFilterSupportedImpl(const FString& InFilterName) const override;
112 virtual const FSlateBrush* GetCustomBrushForBinding(FGuid BindingID) const override;
113
116#endif
117 // ~UMovieSceneAnimation overrides
118
119 //~ Begin UObject Interface.
120 virtual bool IsPostLoadThreadSafe() const override;
121 //~ End UObject Interface
122
124 const TArray<FWidgetAnimationBinding>& GetBindings() const { return AnimationBindings; }
125
127 UMG_API void RemoveBinding(const UObject& PossessedObject);
128 UMG_API void RemoveBinding(const FWidgetAnimationBinding& Binding);
129
130
132 bool GetLegacyFinishOnStop() const { return bLegacyFinishOnStop; }
133
134protected:
135
137 virtual void PostLoad() override;
138
139public:
140
142 UPROPERTY()
144
146 UPROPERTY()
147 TArray<FWidgetAnimationBinding> AnimationBindings;
148
149private:
150
152 UPROPERTY()
153 bool bLegacyFinishOnStop;
154
156 UPROPERTY()
157 FString DisplayLabel;
158};
virtual bool IsPostLoadThreadSafe() const override
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_MULTICAST_DELEGATE_OneParam(DelegateName, Param1Type)
Definition DelegateCombinations.h:49
ETrackSupport
Definition MovieSceneSequence.h:57
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
Definition Text.h:385
Definition MovieScene.Build.cs:6
Definition Array.h:670
Definition AndroidPlatformMisc.h:14
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition ContainerAllocationPolicies.h:894
Definition SubclassOf.h:30
Definition MovieSceneSequence.h:73
Definition MovieScene.h:358
Definition Object.h:95
Definition UserWidget.h:284
Definition WidgetAnimation.h:26
virtual void UnbindObjects(const FGuid &ObjectId, const TArray< UObject * > &InObjects, UObject *InContext) override
Definition WidgetAnimation.h:102
virtual void UnbindInvalidObjects(const FGuid &ObjectId, UObject *InContext) override
Definition WidgetAnimation.h:103
const TArray< FWidgetAnimationBinding > & GetBindings() const
Definition WidgetAnimation.h:124
bool GetLegacyFinishOnStop() const
Definition WidgetAnimation.h:132
Definition Guid.h:109
Definition MovieSceneDynamicBinding.h:36
Definition MovieSceneSequenceID.h:13
Definition SlateBrush.h:239
Definition WidgetAnimationBinding.h:27
Definition ObjectPtr.h:488
Definition UniversalObjectLocatorResolveParams.h:47