Skip to content

Commit 0659508

Browse files
load zeroed UVs as fallback in gltf loader
1 parent f520a34 commit 0659508

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/bevy_gltf/src/loader.rs

+4
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(indices) = reader.read_indices() {

0 commit comments

Comments
 (0)