From 344d18b2ee1ecd50a362ca6b7e42180b90b9d6e4 Mon Sep 17 00:00:00 2001 From: Nicholas Huelin <62965063+SirQuartz@users.noreply.github.com> Date: Sat, 26 Mar 2022 19:21:07 -0400 Subject: [PATCH] Hide "Normal Map" import option when using lossless compression on Texture This pull request resolves an issue where images being imported with lossless compression allowed you to select a normal map, but the normal map only applies if you're using VRAM compression. Thereby making it redundant to appear when using lossless compression. This pull request hides the normal map option when lossless compression is selected. Resolves: #59435 (cherry picked from commit 01ca9d3eec71154b6b0d32d34cab6b9fdb6fd24c) --- editor/import/resource_importer_texture.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index 2de1a0919..bb24b02c9 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -160,6 +160,11 @@ bool ResourceImporterTexture::get_option_visibility(const String &p_option, cons if (compress_mode != COMPRESS_VIDEO_RAM) { return false; } + } else if (p_option == "compress/normal_map") { + int compress_mode = int(p_options["compress/mode"]); + if (compress_mode == COMPRESS_LOSSLESS) { + return false; + } } else if (p_option == "compress/bptc_ldr") { int compress_mode = int(p_options["compress/mode"]); if (compress_mode != COMPRESS_VIDEO_RAM) {