summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-07-18 15:38:32 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-07-18 15:38:32 +0200
commitff8a2780ee777c2456ce42368e1065774c7c4c3f (patch)
treea92f2c59113f25020e642f28f2bcf9f7a8a0f785
parent60966f5bcf9c635c79966a4c16e1af1795331bb3 (diff)
parent416e63ae359f8230a717655db17af556fbdfc247 (diff)
downloadredot-engine-ff8a2780ee777c2456ce42368e1065774c7c4c3f.tar.gz
Merge pull request #94506 from Jordyfel/handle-gltf-bin-missing
Fix handling of missing bin file in gltf separate
-rw-r--r--modules/gltf/gltf_document.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp
index c0232e6d0c..dff1e62e82 100644
--- a/modules/gltf/gltf_document.cpp
+++ b/modules/gltf/gltf_document.cpp
@@ -789,8 +789,9 @@ Error GLTFDocument::_parse_buffers(Ref<GLTFState> p_state, const String &p_base_
ERR_FAIL_COND_V(p_base_path.is_empty(), ERR_INVALID_PARAMETER);
uri = uri.uri_decode();
uri = p_base_path.path_join(uri).replace("\\", "/"); // Fix for Windows.
+ ERR_FAIL_COND_V_MSG(!FileAccess::exists(uri), ERR_FILE_NOT_FOUND, "glTF: Binary file not found: " + uri);
buffer_data = FileAccess::get_file_as_bytes(uri);
- ERR_FAIL_COND_V_MSG(buffer.is_empty(), ERR_PARSE_ERROR, "glTF: Couldn't load binary file as an array: " + uri);
+ ERR_FAIL_COND_V_MSG(buffer_data.is_empty(), ERR_PARSE_ERROR, "glTF: Couldn't load binary file as an array: " + uri);
}
ERR_FAIL_COND_V(!buffer.has("byteLength"), ERR_PARSE_ERROR);