From ec7d7abde93f2bc552e52b687ad00a61970fc0de Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Thu, 2 Jan 2025 12:53:55 -0800 Subject: [PATCH] GLTF: Always read alphaCutoff property --- modules/gltf/gltf_document.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index 36c7a569dc33..7f70bd35d59e 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -4822,13 +4822,13 @@ Error GLTFDocument::_parse_materials(Ref p_state) { material->set_transparency(BaseMaterial3D::TRANSPARENCY_ALPHA_DEPTH_PRE_PASS); } else if (am == "MASK") { material->set_transparency(BaseMaterial3D::TRANSPARENCY_ALPHA_SCISSOR); - if (material_dict.has("alphaCutoff")) { - material->set_alpha_scissor_threshold(material_dict["alphaCutoff"]); - } else { - material->set_alpha_scissor_threshold(0.5f); - } } } + if (material_dict.has("alphaCutoff")) { + material->set_alpha_scissor_threshold(material_dict["alphaCutoff"]); + } else { + material->set_alpha_scissor_threshold(0.5f); + } if (material_dict.has("extras")) { _attach_extras_to_meta(material_dict["extras"], material);