[GLTFExporter] feat: add and implement export options bExportTextureTransforms

commit c2843c8e9c8aa4bc8c50ad61cc4f304125638c43
Author: Aidin Abedi <aidin.abedi[at]animech.com>
Date: Sun, 18 Oct 2020 13:45:52 +0200

    feat: add and implement export options bExportTextureTransforms
    (cherry picked from commit f6a225f765039a4d23693c9cffc487211075ea3d​)

#preflight none
#skipci

[CL 21640396 by aidinabedi in ue5-release-engine-staging branch]
This commit is contained in:
aidinabedi
2022-08-28 06:30:38 -04:00
parent 067855924a
commit 3182044fa0
3 changed files with 16 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ UGLTFExportOptions::UGLTFExportOptions(const FObjectInitializer& ObjectInitializ
bExportAnimationSequences = true;
bRetargetBoneTransforms = true;
bExportPlaybackSettings = true;
bExportTextureTransforms = true;
bExportSourceTextures = true;
bExportLightmaps = true;
TextureHDREncoding = EGLTFExporterTextureHDREncoding::RGBM;

View File

@@ -1110,6 +1110,12 @@ bool FGLTFMaterialTask::TryGetSourceTexture(const UTexture2D*& OutTexture, int32
return false;
}
if (!Builder.ExportOptions->bExportTextureTransforms && OutTransform != FGLTFJsonTextureTransform())
{
Builder.AddWarningMessage(FString::Printf(TEXT("Texture transform for property %s in material %s disabled by export options"), *FGLTFNameUtility::GetName(Property), *Material->GetName()));
OutTransform = {};
}
return true;
}
@@ -1137,6 +1143,12 @@ bool FGLTFMaterialTask::TryGetSourceTexture(const UTexture2D*& OutTexture, int32
return false;
}
if (!Builder.ExportOptions->bExportTextureTransforms && OutTransform != FGLTFJsonTextureTransform())
{
Builder.AddWarningMessage(FString::Printf(TEXT("Texture transform for property %s in material %s disabled by export options"), *FGLTFNameUtility::GetName(Property), *Material->GetName()));
OutTransform = {};
}
return true;
}

View File

@@ -88,6 +88,9 @@ public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, config, Category = Animation)
uint32 bExportPlaybackSettings : 1;
UPROPERTY(EditAnywhere, BlueprintReadWrite, config, Category = Texture)
uint32 bExportTextureTransforms : 1;
UPROPERTY(EditAnywhere, BlueprintReadWrite, config, Category = Texture)
uint32 bExportSourceTextures : 1;