Add type trait WithSerializer and implementation for FRawAnimSequenceTrack, to speed up load-times (after resave)

#jira none
#rb Thomas.Sarkanen
#preflight 632457df5f55ba280e021cec

[CL 22047936 by jurre debaare in ue5-release-engine-staging branch]
This commit is contained in:
jurre debaare
2022-09-16 07:38:44 -04:00
parent 3e8ec6a04f
commit 4313650d31
2 changed files with 24 additions and 0 deletions

View File

@@ -126,6 +126,9 @@ struct CORE_API FUE5ReleaseStreamObjectVersion
// Uses RG11B10 format to store the encoded reflection capture data on mobile
StoreReflectionCaptureEncodedHDRDataInRG11B10Format,
// Add WithSerializer type trait and implementation for FRawAnimSequenceTrack
RawAnimSequenceTrackSerializer,
// -----<new versions can be added above this line>-------------------------------------------------
VersionPlusOne,

View File

@@ -10,6 +10,7 @@
#include "Animation/AnimEnums.h"
#include "Misc/SecureHash.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "UObject/UE5ReleaseStreamObjectVersion.h"
#include "AnimTypes.generated.h"
struct FMarkerPair;
@@ -880,9 +881,29 @@ struct ENGINE_API FRawAnimSequenceTrack
return Ar;
}
bool Serialize(FArchive& Ar)
{
Ar.UsingCustomVersion(FUE5ReleaseStreamObjectVersion::GUID);
// Previously generated content was saved without bulk array serialization, so have to rely on UProperty serialization until resaved
if (Ar.CustomVer(FUE5ReleaseStreamObjectVersion::GUID) < FUE5ReleaseStreamObjectVersion::RawAnimSequenceTrackSerializer)
{
return false;
}
Ar << *this;
return true;
}
static const uint32 SingleKeySize = sizeof(FVector3f) + sizeof(FQuat4f) + sizeof(FVector3f);
};
template<> struct TStructOpsTypeTraits<FRawAnimSequenceTrack> : public TStructOpsTypeTraitsBase2<FRawAnimSequenceTrack>
{
enum { WithSerializer = true };
};
UCLASS()
class ENGINE_API URawAnimSequenceTrackExtensions : public UBlueprintFunctionLibrary
{