Skip to content

Commit

Permalink
gltf loader: add a temporary loader without compression support
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Aug 12, 2023
1 parent ac8f367 commit eded094
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion crates/bevy_gltf/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ impl Plugin for GltfPlugin {
.add_asset::<Gltf>()
.add_asset::<GltfNode>()
.add_asset::<GltfPrimitive>()
.add_asset::<GltfMesh>();
.add_asset::<GltfMesh>()
// Add the gltf loader first without support for compressed formats. This will be overwritten
// once the render device is initialized.
.add_asset_loader::<GltfLoader>(GltfLoader {
supported_compressed_formats: CompressedImageFormats::NONE,
custom_vertex_attributes: self.custom_vertex_attributes.clone(),
});
}

fn finish(&self, app: &mut App) {
Expand All @@ -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>(GltfLoader {
supported_compressed_formats,
custom_vertex_attributes: self.custom_vertex_attributes.clone(),
Expand Down

0 comments on commit eded094

Please sign in to comment.