Saving out mip data

Given a UTexture2D, I’m accessing the compressed mip data, processing it, and exporting in my own format.

The jist of the code is:

FTexturePlatformData* TextureData = *Texture->GetRunningPlatformData();

TextureData->TryInlineMipData();

for( int32 MipIndex = LODBias; MipIndex < TextureData->Mips.Num(); MipIndex++ )

{

FTexture2DMipMap& MipData = TextureData->Mips[MipIndex];

RawMipInfo[MipIndex].TotalSize = MipData.BulkData.GetBulkDataSize();

MipData.BulkData.GetCopy( &RawMipInfo[MipIndex].BlockData );

This works fine, but only once. Bulk data can only be safely accessed once in game, but should be fine in the editor?

What is the correct procedure for repeatedly accessing bulk data (specifically FTexturePlatformData mip data) repeatedly?

Cheers
John

Using void GetMipData(int32 FirstMipToLoad, void** OutMipData); seems to work much better.

This needed exposing via ENGINE_API in the version I have

Cheers
John