From 664c69defe3712cec8d07797adbaa8bd1ad2df29 Mon Sep 17 00:00:00 2001 From: Kelekelio Date: Mon, 11 May 2026 12:11:36 +0200 Subject: [PATCH] feature/webp_and_texture_quality_settings --- CUE4Parse | 2 +- FModel/Settings/UserSettings.cs | 10 +++++++++- FModel/ViewModels/SettingsViewModel.cs | 4 ++++ FModel/ViewModels/TabControlViewModel.cs | 2 +- FModel/Views/SettingsView.xaml | 10 ++++++++-- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/CUE4Parse b/CUE4Parse index 81458ae7..7382811d 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit 81458ae77d3f3230d7582a77ffd938510430a4bf +Subproject commit 7382811d0c452d7d4759fd21c704e81b58307400 diff --git a/FModel/Settings/UserSettings.cs b/FModel/Settings/UserSettings.cs index ea62298c..a1775f4e 100644 --- a/FModel/Settings/UserSettings.cs +++ b/FModel/Settings/UserSettings.cs @@ -75,7 +75,8 @@ public static bool IsEndpointValid(EEndpointType type, out EndpointSettings endp Platform = Default.CurrentDir.TexturePlatform, ExportMorphTargets = Default.SaveMorphTargets, ExportMaterials = Default.SaveEmbeddedMaterials, - ExportHdrTexturesAsHdr = Default.SaveHdrTexturesAsHdr + ExportHdrTexturesAsHdr = Default.SaveHdrTexturesAsHdr, + TextureQuality = Default.TextureQuality }; private bool _showChangelog = true; @@ -562,6 +563,13 @@ public bool SaveHdrTexturesAsHdr set => SetProperty(ref _saveHdrTexturesAsHdr, value); } + private int _textureQuality = 100; + public int TextureQuality + { + get => _textureQuality; + set => SetProperty(ref _textureQuality, value); + } + private bool _featurePreviewNewAssetExplorer = true; public bool FeaturePreviewNewAssetExplorer { diff --git a/FModel/ViewModels/SettingsViewModel.cs b/FModel/ViewModels/SettingsViewModel.cs index 0d6ace36..48271e80 100644 --- a/FModel/ViewModels/SettingsViewModel.cs +++ b/FModel/ViewModels/SettingsViewModel.cs @@ -220,6 +220,7 @@ public string UnluacOpcodeMap private ENaniteMeshFormat _naniteMeshExportFormatSnapshot; private EMaterialFormat _materialExportFormatSnapshot; private ETextureFormat _textureExportFormatSnapshot; + private int _textureQualitySnapshot; private bool _mappingsUpdate = false; @@ -264,6 +265,7 @@ public void Initialize() _naniteMeshExportFormatSnapshot = UserSettings.Default.NaniteMeshExportFormat; _materialExportFormatSnapshot = UserSettings.Default.MaterialExportFormat; _textureExportFormatSnapshot = UserSettings.Default.TextureExportFormat; + _textureQualitySnapshot = UserSettings.Default.TextureQuality; SelectedUePlatform = _uePlatformSnapshot; SelectedUeGame = _ueGameSnapshot; @@ -337,6 +339,8 @@ public bool Save(out List whatShouldIDo) UserSettings.Default.TextureExportFormat = SelectedTextureExportFormat; UserSettings.Default.AesReload = SelectedAesReload; UserSettings.Default.DiscordRpc = SelectedDiscordRpc; + if (_textureQualitySnapshot != UserSettings.Default.TextureQuality) + restart = false; if (SelectedDiscordRpc == EDiscordRpc.Never) _discordHandler.Shutdown(); diff --git a/FModel/ViewModels/TabControlViewModel.cs b/FModel/ViewModels/TabControlViewModel.cs index dbeb4423..897fee19 100644 --- a/FModel/ViewModels/TabControlViewModel.cs +++ b/FModel/ViewModels/TabControlViewModel.cs @@ -107,7 +107,7 @@ private void SetImage(CTexture bitmap) if (PixelFormatUtils.IsHDR(bitmap.PixelFormat) || (UserSettings.Default.TextureExportFormat != ETextureFormat.Jpeg && UserSettings.Default.TextureExportFormat != ETextureFormat.Png)) { - ImageBuffer = bitmap.Encode(UserSettings.Default.TextureExportFormat, UserSettings.Default.SaveHdrTexturesAsHdr, out var ext); + ImageBuffer = bitmap.Encode(UserSettings.Default.TextureExportFormat, UserSettings.Default.SaveHdrTexturesAsHdr, out var ext, UserSettings.Default.TextureQuality); ExportName += "." + ext; } else diff --git a/FModel/Views/SettingsView.xaml b/FModel/Views/SettingsView.xaml index c7e8a1bf..89aaa17a 100644 --- a/FModel/Views/SettingsView.xaml +++ b/FModel/Views/SettingsView.xaml @@ -366,6 +366,7 @@ + @@ -541,8 +542,13 @@ - - + + + + +