UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MovieSceneFrameMigration.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Containers/Array.h"
6#include "CoreTypes.h"
7#include "Math/Range.h"
8#include "Math/RangeBound.h"
9#include "Misc/FrameNumber.h"
10#include "MovieSceneFwd.h"
12#include "UObject/Class.h"
14
15#include "MovieSceneFrameMigration.generated.h"
16
17class FArchive;
18class FOutputDevice;
19class FString;
20class UObject;
21struct FPropertyTag;
22
26USTRUCT()
28{
30
31
35
36#if WITH_EDITORONLY_DATA
37
42
43#endif
44
51
58
63
68
72 MOVIESCENE_API bool SerializeFromMismatchedTag(FPropertyTag const& Tag, FStructuredArchive::FSlot Slot);
73
78 {
79 return Value.GetLowerBound();
80 }
81
86 {
87 return Value.GetUpperBound();
88 }
89
90 //Needed for copy and pasting of tracks since that mechanism uses string export and import
91 bool ExportTextItem(FString& ValueStr, FMovieSceneFrameRange const& DefaultValue, UObject* Parent, int32 PortFlags, UObject* ExportRootScope) const;
92 bool ImportTextItem(const TCHAR*& Buffer, int32 PortFlags, UObject* Parent, FOutputDevice* ErrorText);
93
94
95private:
96
101 {
102 return A.Value == B.Value;
103 }
104};
105
106
107template<>
114
120template <typename T> inline void ConvertInsertAndSort(int32 IndexAt, FFrameNumber NewFrame, T& Value, TArray<FFrameNumber> &Times, TArray<T> &Values)
121{
122 if (IndexAt > 0)
123 {
124 int32 PrevWhich = IndexAt - 1;
125 //this seems to happen 99% of the time, it is properly sorted.
126 if (NewFrame >= Times[PrevWhich])
127 {
128 Times.Emplace(NewFrame);
129 Values.Emplace(Value);
130 }
131 else
132 {
133 while (--PrevWhich >= 0)
134 {
135 if (NewFrame >= Times[PrevWhich])
136 {
137 Times.Insert(NewFrame, PrevWhich + 1);
138 Values.Insert(Value, PrevWhich + 1);
139 break;
140 }
141 }
142 if (PrevWhich < 0)
143 {
144 Times.Insert(NewFrame, 0);
145 Values.Insert(Value, 0);
146 }
147 }
148 }
149 else
150 {
151 Times.Emplace(NewFrame);
152 Values.Emplace(Value);
153 }
154}
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
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
void ConvertInsertAndSort(int32 IndexAt, FFrameNumber NewFrame, T &Value, TArray< FFrameNumber > &Times, TArray< T > &Values)
Definition MovieSceneFrameMigration.h:120
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define USTRUCT(...)
Definition ObjectMacros.h:746
EPropertyObjectReferenceType
Definition ObjectMacros.h:533
Definition Archive.h:1208
Definition OutputDevice.h:133
Definition StructuredArchiveSlots.h:52
Definition Array.h:670
UE_FORCEINLINE_HINT SizeType Emplace(ArgsType &&... Args)
Definition Array.h:2561
SizeType Insert(std::initializer_list< ElementType > InitList, const SizeType InIndex)
Definition Array.h:1875
Definition RangeBound.h:36
Definition Range.h:50
Definition Object.h:95
Definition FrameNumber.h:18
Definition MovieSceneFrameMigration.h:28
FMovieSceneFrameRange(const TRange< FFrameNumber > &InValue)
Definition MovieSceneFrameMigration.h:55
TRangeBound< FFrameNumber > GetUpperBound() const
Definition MovieSceneFrameMigration.h:85
FMovieSceneFrameRange()
Definition MovieSceneFrameMigration.h:48
friend bool operator==(const FMovieSceneFrameRange &A, const FMovieSceneFrameRange &B)
Definition MovieSceneFrameMigration.h:100
TRangeBound< FFrameNumber > GetLowerBound() const
Definition MovieSceneFrameMigration.h:77
Definition PropertyTag.h:38
Definition StructOpsTypeTraits.h:11
@ WithStructuredSerializeFromMismatchedTag
Definition StructOpsTypeTraits.h:29
@ WithIdenticalViaEquality
Definition StructOpsTypeTraits.h:18
@ WithExportTextItem
Definition StructOpsTypeTraits.h:20
@ WithSerializer
Definition StructOpsTypeTraits.h:23
@ WithImportTextItem
Definition StructOpsTypeTraits.h:21
static constexpr EPropertyObjectReferenceType WithSerializerObjectReferences
Definition StructOpsTypeTraits.h:41
Definition StructOpsTypeTraits.h:46