void UKismetRenderingLibrary::ExportTexture2D(UObject* WorldContextObject, UTexture2D* Texture, const FString& FilePath, const FString& FileName)
{
FString TotalFileName = FPaths::Combine(*FilePath, *FileName);
FText PathError;
FPaths::ValidatePath(TotalFileName, &PathError);
if (Texture && !FileName.IsEmpty() && PathError.IsEmpty())
{
FArchive* Ar = IFileManager::Get().CreateFileWriter(*TotalFileName);
if (Ar)
{
FBufferArchive Buffer;
bool bSuccess = FImageUtils::ExportTexture2DAsHDR(Texture, Buffer);
if (bSuccess)
{
Ar->Serialize(const_cast<uint8*>(Buffer.GetData()), Buffer.Num());
}
delete Ar;
}
else
{
FMessageLog("Blueprint").Warning(LOCTEXT("ExportTexture2D_FileWriterFailedToCreate", "ExportTexture2D: FileWrite failed to create."));
}
}
This is the code, the buffer is your bytes Im guessing, a series of int8
where am i messing up my interps?