Fix absolute gltf asset paths too.
CI / build-and-test (pull_request) Successful in 11m29s

This commit is contained in:
2026-09-14 15:03:24 +02:00
parent 445f249153
commit 47662fe4ba
+8 -10
View File
@@ -3,6 +3,7 @@
use std::{
collections::{HashMap, HashSet},
io,
path::Path,
};
use bevy::{
@@ -547,12 +548,8 @@ impl AssetLoader for FighterBakeSourceLoader {
let manifest: FighterManifest = ron::de::from_bytes(&manifest_bytes)
.map_err(|error| io::Error::new(io::ErrorKind::InvalidData, error))?;
let model_path = load_context
.path()
.resolve_embed_str(&manifest.model_path)
.map_err(|error| io::Error::other(error.to_string()))?;
let model_bytes = load_context
.read_asset_bytes(model_path.clone_owned())
.read_asset_bytes(&manifest.model_path)
.await
.map_err(|error| io::Error::other(error.to_string()))?;
@@ -562,11 +559,12 @@ impl AssetLoader for FighterBakeSourceLoader {
for buffer in gltf.buffers() {
let bytes = match buffer.source() {
gltf::buffer::Source::Uri(uri) => load_context
.read_asset_bytes(
model_path
.resolve_embed_str(uri)
.map_err(|error| io::Error::other(error.to_string()))?,
)
.read_asset_bytes(AssetPath::from_path_buf(
Path::new(&manifest.model_path)
.parent()
.unwrap_or_else(|| Path::new(""))
.join(uri),
))
.await
.map_err(|error| io::Error::other(error.to_string()))?,
gltf::buffer::Source::Bin => gltf.blob.clone().ok_or_else(|| {