From eded094450d17323200cd42a761e12d14d9729dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Sat, 12 Aug 2023 22:30:18 +0200 Subject: [PATCH] gltf loader: add a temporary loader without compression support --- crates/bevy_gltf/src/lib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/bevy_gltf/src/lib.rs b/crates/bevy_gltf/src/lib.rs index 90f8443aabc36..e7d5d84573d97 100644 --- a/crates/bevy_gltf/src/lib.rs +++ b/crates/bevy_gltf/src/lib.rs @@ -44,7 +44,13 @@ impl Plugin for GltfPlugin { .add_asset::() .add_asset::() .add_asset::() - .add_asset::(); + .add_asset::() + // Add the gltf loader first without support for compressed formats. This will be overwritten + // once the render device is initialized. + .add_asset_loader::(GltfLoader { + supported_compressed_formats: CompressedImageFormats::NONE, + custom_vertex_attributes: self.custom_vertex_attributes.clone(), + }); } fn finish(&self, app: &mut App) { @@ -53,6 +59,7 @@ impl Plugin for GltfPlugin { None => CompressedImageFormats::NONE, }; + // Overwrite the gltf loader with support for compressed formats. app.add_asset_loader::(GltfLoader { supported_compressed_formats, custom_vertex_attributes: self.custom_vertex_attributes.clone(),