diff --git a/crates/bevy_gltf/Cargo.toml b/crates/bevy_gltf/Cargo.toml index b09b4a7d68de3..1a8576e00d88b 100644 --- a/crates/bevy_gltf/Cargo.toml +++ b/crates/bevy_gltf/Cargo.toml @@ -24,6 +24,7 @@ bevy_render = { path = "../bevy_render", version = "0.5.0" } bevy_transform = { path = "../bevy_transform", version = "0.5.0" } bevy_math = { path = "../bevy_math", version = "0.5.0" } bevy_scene = { path = "../bevy_scene", version = "0.5.0" } +bevy_log = { path = "../bevy_log", version = "0.5.0" } # other gltf = { version = "0.15.2", default-features = false, features = ["utils", "names", "KHR_materials_unlit"] } diff --git a/crates/bevy_gltf/src/loader.rs b/crates/bevy_gltf/src/loader.rs index 5021eff00cac2..653763e39d806 100644 --- a/crates/bevy_gltf/src/loader.rs +++ b/crates/bevy_gltf/src/loader.rs @@ -140,6 +140,11 @@ async fn load_gltf<'a, 'b>( .map(|v| VertexAttributeValues::Float2(v.into_f32().collect())) { mesh.set_attribute(Mesh::ATTRIBUTE_UV_0, vertex_attribute); + } else { + let len = mesh.count_vertices(); + let uvs = vec![[0.0, 0.0]; len]; + bevy_log::debug!("missing `TEXCOORD_0` vertex attribute, loading zeroed out UVs"); + mesh.set_attribute(Mesh::ATTRIBUTE_UV_0, uvs); } if let Some(vertex_attribute) = reader