UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MovieSceneVectorSection.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"
7#include "Curves/KeyHandle.h"
8#include "Curves/RichCurve.h"
9#include "MovieSceneSection.h"
10#include "MovieSceneKeyStruct.h"
14#include "MovieSceneVectorSection.generated.h"
15
16class FStructOnScope;
18
22USTRUCT()
25{
27
29 UPROPERTY(EditAnywhere, Category=Key)
31
33
34 virtual void PropagateChanges(const FPropertyChangedEvent& ChangeEvent) override;
35
37 virtual float* GetPropertyChannelByIndex(int32 Index) PURE_VIRTUAL(FMovieSceneFloatVectorKeyStructBase::GetPropertyChannelByIndex, return nullptr; );
38};
40
41
45USTRUCT()
48{
50
51
52 UPROPERTY(EditAnywhere, Category=Key)
53 FVector2f Vector = FVector2f::ZeroVector;
54
55 //~ FMovieSceneFloatVectorKeyStructBase interface
56 virtual float* GetPropertyChannelByIndex(int32 Index) override { return &Vector[Index]; }
57};
58template<> struct TStructOpsTypeTraits<FMovieSceneVector2fKeyStruct> : public TStructOpsTypeTraitsBase2<FMovieSceneVector2fKeyStruct> { enum { WithCopy = false }; };
59
63USTRUCT()
66{
68
69
70 UPROPERTY(EditAnywhere, Category = Key)
71 FVector3f Vector = FVector3f::ZeroVector;
72
73 //~ FMovieSceneFloatVectorKeyStructBase interface
74 virtual float* GetPropertyChannelByIndex(int32 Index) override { return &Vector[Index]; }
75};
76template<> struct TStructOpsTypeTraits<FMovieSceneVector3fKeyStruct> : public TStructOpsTypeTraitsBase2<FMovieSceneVector3fKeyStruct> { enum { WithCopy = false }; };
77
81USTRUCT()
84{
86
87
88 UPROPERTY(EditAnywhere, Category = Key)
90
91 //~ FMovieSceneFloatVectorKeyStructBase interface
92 virtual float* GetPropertyChannelByIndex(int32 Index) override { return &Vector[Index]; }
93};
94template<> struct TStructOpsTypeTraits<FMovieSceneVector4fKeyStruct> : public TStructOpsTypeTraitsBase2<FMovieSceneVector4fKeyStruct> { enum { WithCopy = false }; };
95
96
100USTRUCT()
103{
105
107 UPROPERTY(EditAnywhere, Category=Key)
109
111
112 virtual void PropagateChanges(const FPropertyChangedEvent& ChangeEvent) override;
113
115 virtual double* GetPropertyChannelByIndex(int32 Index) PURE_VIRTUAL(FMovieSceneDoubleVectorKeyStructBase::GetPropertyChannelByIndex, return nullptr; );
116};
118
122USTRUCT()
125{
127
128
129 UPROPERTY(EditAnywhere, Category=Key)
131
132 //~ FMovieSceneDoubleVectorKeyStructBase interface
133 virtual double* GetPropertyChannelByIndex(int32 Index) override { return (double*)&Vector[Index]; }
134};
135template<> struct TStructOpsTypeTraits<FMovieSceneVector2DKeyStruct> : public TStructOpsTypeTraitsBase2<FMovieSceneVector2DKeyStruct> { enum { WithCopy = false }; };
136
140USTRUCT()
143{
145
146
147 UPROPERTY(EditAnywhere, Category = Key)
149
150 //~ FMovieSceneDoubleVectorKeyStructBase interface
151 virtual double* GetPropertyChannelByIndex(int32 Index) override { return &Vector[Index]; }
152};
153template<> struct TStructOpsTypeTraits<FMovieSceneVector3dKeyStruct> : public TStructOpsTypeTraitsBase2<FMovieSceneVector3dKeyStruct> { enum { WithCopy = false }; };
154
155
159USTRUCT()
162{
164
165
166 UPROPERTY(EditAnywhere, Category = Key)
168
169 //~ FMovieSceneDoubleVectorKeyStructBase interface
170 virtual double* GetPropertyChannelByIndex(int32 Index) override { return &Vector[Index]; }
171};
172template<> struct TStructOpsTypeTraits<FMovieSceneVector4dKeyStruct> : public TStructOpsTypeTraitsBase2<FMovieSceneVector4dKeyStruct> { enum { WithCopy = false }; };
173
174
178UCLASS(MinimalAPI)
182{
184
185public:
186
189 {
190 checkf(InChannelsUsed >= 2 && InChannelsUsed <= 4, TEXT("Only 2-4 channels are supported."));
191 ChannelsUsed = InChannelsUsed;
192 RecreateChannelProxy();
193 }
194
196 int32 GetChannelsUsed() const { return ChannelsUsed; }
197
202 {
203 check(Index >= 0 && Index < GetChannelsUsed());
204 return Curves[Index];
205 }
206
207protected:
208
209 //~ UMovieSceneSection interface
210 virtual void Serialize(FArchive& Ar) override;
211 virtual void PostEditImport() override;
212 virtual TSharedPtr<FStructOnScope> GetKeyStruct(TArrayView<const FKeyHandle> KeyHandles) override;
213
214 MOVIESCENETRACKS_API void RecreateChannelProxy();
215
216private:
217
218 //~ IMovieSceneEntityProvider interface
219 virtual void ImportEntityImpl(UMovieSceneEntitySystemLinker* EntityLinker, const FEntityImportParams& Params, FImportedEntity* OutImportedEntity) override;
221
222private:
223
225 UPROPERTY()
226 FMovieSceneFloatChannel Curves[4];
227
229 UPROPERTY()
230 int32 ChannelsUsed;
231};
232
233
237UCLASS(MinimalAPI)
241{
243
244public:
245
248 {
249 checkf(InChannelsUsed >= 2 && InChannelsUsed <= 4, TEXT("Only 2-4 channels are supported."));
250 ChannelsUsed = InChannelsUsed;
251 RecreateChannelProxy();
252 }
253
255 int32 GetChannelsUsed() const { return ChannelsUsed; }
256
261 {
262 check(Index >= 0 && Index < GetChannelsUsed());
263 return Curves[Index];
264 }
265
266protected:
267
268 //~ UMovieSceneSection interface
269 virtual void Serialize(FArchive& Ar) override;
270 virtual void PostEditImport() override;
271 virtual TSharedPtr<FStructOnScope> GetKeyStruct(TArrayView<const FKeyHandle> KeyHandles) override;
272
273 MOVIESCENETRACKS_API void RecreateChannelProxy();
274
275private:
276
277 //~ IMovieSceneEntityProvider interface
278 virtual void ImportEntityImpl(UMovieSceneEntitySystemLinker* EntityLinker, const FEntityImportParams& Params, FImportedEntity* OutImportedEntity) override;
280
281private:
282
284 UPROPERTY()
285 FMovieSceneDoubleChannel Curves[4];
286
288 UPROPERTY()
289 int32 ChannelsUsed;
290};
#define check(expr)
Definition AssertionMacros.h:314
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
#define PURE_VIRTUAL(func,...)
Definition CoreMiscDefines.h:103
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
#define USTRUCT(...)
Definition ObjectMacros.h:746
Definition Archive.h:1208
Definition StructOnScope.h:13
Definition IMovieSceneEntityProvider.h:122
Definition ArrayView.h:139
Definition Range.h:50
Definition SharedPointer.h:692
Definition MovieSceneVectorSection.h:241
int32 GetChannelsUsed() const
Definition MovieSceneVectorSection.h:255
const FMovieSceneDoubleChannel & GetChannel(int32 Index) const
Definition MovieSceneVectorSection.h:260
void SetChannelsUsed(int32 InChannelsUsed)
Definition MovieSceneVectorSection.h:247
Definition MovieSceneEntitySystemLinker.h:113
Definition MovieSceneVectorSection.h:182
void SetChannelsUsed(int32 InChannelsUsed)
Definition MovieSceneVectorSection.h:188
int32 GetChannelsUsed() const
Definition MovieSceneVectorSection.h:196
const FMovieSceneFloatChannel & GetChannel(int32 Index) const
Definition MovieSceneVectorSection.h:201
Definition MovieSceneSection.h:243
U16 Index
Definition radfft.cpp:71
Definition FrameNumber.h:18
Definition MovieSceneDoubleChannel.h:125
Definition MovieSceneVectorSection.h:103
Definition MovieSceneEvaluationField.h:328
Definition MovieSceneEvaluationField.h:109
Definition MovieSceneFloatChannel.h:122
Definition MovieSceneVectorSection.h:25
Definition MovieSceneKeyStructHelper.h:24
Definition MovieSceneKeyStruct.h:19
Definition MovieSceneVectorSection.h:125
Definition MovieSceneVectorSection.h:48
Definition MovieSceneVectorSection.h:143
Definition MovieSceneVectorSection.h:66
Definition MovieSceneVectorSection.h:162
Definition MovieSceneVectorSection.h:84
Definition UnrealType.h:6865
Definition StructOpsTypeTraits.h:11
@ WithCopy
Definition StructOpsTypeTraits.h:17
Definition StructOpsTypeTraits.h:46