sebcrozet/kiss3d

Obj importer does not work with multiobject files

Opened this issue · 1 comments

Hi!

When importing OBJ files the importer does not under stand lines that start with o SOME_NAME, which is a new object within the file.
This causes the generated mesh to not make sense at all. Sometimes this also causes the imported to panic:

Warning: unknown line 1 ignored: `o SOLID.128'
At line 823: could not find the material Planed
Warning: unknown line 824 ignored: `s off'
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 14359', /home/emifre/.cargo/registry/src/github.com-1ecc6299db9ec823/kiss3d-0.30.0/src/loader/obj.rs:436:41
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I am not sure how to help with this issue unfortunately.
Is there a way to get around it? For example I had a look for an STL importer, but this did not exist unfortunately.

Use the tobj crate until this is fixed? It supports triangulation on import so getting meshes in a format ready for kiss3d is painless.