Skip to content

Commit ab6d2fb

Browse files
load zeroed UVs as fallback in gltf loader
1 parent 7342d46 commit ab6d2fb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/bevy_gltf/src/loader.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ async fn load_gltf<'a, 'b>(
140140
.map(|v| VertexAttributeValues::Float2(v.into_f32().collect()))
141141
{
142142
mesh.set_attribute(Mesh::ATTRIBUTE_UV_0, vertex_attribute);
143+
} else {
144+
let len = mesh.count_vertices();
145+
let uvs = vec![[0.0, 0.0]; len];
146+
mesh.set_attribute(Mesh::ATTRIBUTE_UV_0, uvs);
143147
}
144148

145149
if let Some(vertex_attribute) = reader

0 commit comments

Comments
 (0)