Skip to content

from_bevy_mesh doesn't support unindexed glTF #490

@rlidwka

Description

@rlidwka

fn extract_mesh_vertices_indices(mesh: &Mesh) -> Option<(Vec<na::Point3<Real>>, Vec<[u32; 3]>)> {
use rapier::na::point;
let vertices = mesh.attribute(Mesh::ATTRIBUTE_POSITION)?;
let indices = mesh.indices()?;

If mesh.indices() doesn't exist, function returns None.

Turns out, indices can be absent from glTF, and the file will still be valid. In this case, bevy Mesh wouldn't have any indices either (but bevy would display it just fine). You can search the internet by keywords "unindexed mesh gltf", and it's full of bug reports about lack of support from various projects...

I'm using osm2world, and it turns out that it generates unindexed meshes, so... Any ideas how to implement it?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions