Skip to content

Commit

Permalink
fixed runtime animation length
Browse files Browse the repository at this point in the history
  • Loading branch information
rdeioris committed Apr 6, 2022
1 parent 6f49cbf commit caea9b9
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1808,6 +1808,10 @@ UAnimSequence* FglTFRuntimeParser::LoadSkeletalAnimation(USkeletalMesh * Skeleta
FStructProperty* StructProperty = CastField<FStructProperty>(UAnimDataModel::StaticClass()->FindPropertyByName(TEXT("FrameRate")));
FFrameRate* FrameRatePtr = StructProperty->ContainerPtrToValuePtr<FFrameRate>(AnimSequence->GetDataModel());
*FrameRatePtr = FrameRate;
#else
PRAGMA_DISABLE_DEPRECATION_WARNINGS
AnimSequence->SequenceLength = Duration;
PRAGMA_ENABLE_DEPRECATION_WARNINGS
#endif
#else
AnimSequence->SetRawNumberOfFrame(NumFrames);
Expand Down Expand Up @@ -2067,6 +2071,9 @@ UAnimSequence* FglTFRuntimeParser::LoadSkeletalAnimation(USkeletalMesh * Skeleta
#endif
#else
AnimSequence->CompressedData.CompressedDataStructure = MakeUnique<FUECompressedAnimData>();
#if ENGINE_MAJOR_VERSION > 4
AnimSequence->CompressedData.CompressedDataStructure->CompressedNumberOfKeys = NumFrames;
#endif
AnimSequence->CompressedData.BoneCompressionCodec = CompressionCodec;
AnimSequence->CompressedData.CurveCompressionCodec = NewObject<UAnimCurveCompressionCodec_CompressedRichCurve>();
AnimSequence->PostLoad();
Expand Down

0 comments on commit caea9b9

Please sign in to comment.