Skip to content

Commit

Permalink
fixed packaged build on UE5
Browse files Browse the repository at this point in the history
  • Loading branch information
rdeioris committed Apr 6, 2022
1 parent 3dcb457 commit 6f49cbf
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// Copyright 2020, Roberto De Ioris.

#include "glTFRuntimeParser.h"
#if ENGINE_MAJOR_VERSION > 4
#include "Animation/AnimData/AnimDataModel.h"
#endif
#include "Rendering/SkeletalMeshLODModel.h"
#include "Rendering/SkeletalMeshModel.h"
#include "Rendering/SkeletalMeshRenderData.h"
Expand Down Expand Up @@ -1794,6 +1797,7 @@ UAnimSequence* FglTFRuntimeParser::LoadSkeletalAnimation(USkeletalMesh * Skeleta
#endif
AnimSequence->SetPreviewMesh(SkeletalMesh);
#if ENGINE_MAJOR_VERSION > 4
#if WITH_EDITOR
FIntProperty* IntProperty = CastField<FIntProperty>(UAnimDataModel::StaticClass()->FindPropertyByName(TEXT("NumberOfFrames")));
IntProperty->SetPropertyValue_InContainer(AnimSequence->GetDataModel(), NumFrames);
FFloatProperty* FloatProperty = CastField<FFloatProperty>(UAnimDataModel::StaticClass()->FindPropertyByName(TEXT("PlayLength")));
Expand All @@ -1804,6 +1808,7 @@ UAnimSequence* FglTFRuntimeParser::LoadSkeletalAnimation(USkeletalMesh * Skeleta
FStructProperty* StructProperty = CastField<FStructProperty>(UAnimDataModel::StaticClass()->FindPropertyByName(TEXT("FrameRate")));
FFrameRate* FrameRatePtr = StructProperty->ContainerPtrToValuePtr<FFrameRate>(AnimSequence->GetDataModel());
*FrameRatePtr = FrameRate;
#endif
#else
AnimSequence->SetRawNumberOfFrame(NumFrames);
AnimSequence->SequenceLength = Duration;
Expand Down

0 comments on commit 6f49cbf

Please sign in to comment.