Trying to create an anim sequence from code but can't control number of frames

Hi,

I’m trying to create an empty anim sequence containing 30 frames but no matter what I do the anim sequence contains 60000 frames.

My code:

FString AssetPath = GetMesh()->SkeletalMesh->GetSkeleton()->GetOutermost()->GetName();
	FString AssetName = FString::Printf(TEXT("TestAnimAsset%d"), FMath::RandRange(0, 999999));;
	UObject* Parent = CreatePackage(*AssetPath);
	UObject* const Object = LoadObject<UObject>(Parent, *AssetName, nullptr, LOAD_None, nullptr);

	if(Parent)
	{
		UAnimSequence* NewSeq = NewObject<UAnimSequence>(Parent, *AssetName, RF_Public | RF_Standalone);
		if(NewSeq)
		{
			FAssetRegistryModule::AssetCreated(NewSeq);

			NewSeq->SetSkeleton(GetMesh()->SkeletalMesh->GetSkeleton());
		
			NewSeq->GetController().SetFrameRate(FFrameRate(30, 1), false);
			NewSeq->SetSequenceLength(1.f);
		}
	}

Result

Thank you.

Solved thanks to this answer Is there any way to modify bone tracks with C++? - #6 by YuriNK