Closed hadronized closed 8 years ago
?
I cannot load obj exported from 3Ds Max, because the order / abscence of some keys make the parser fail. For instance, unnamed objects (no o) causes an error when reading the first vertex. Or the normals come after the texture coordinates (or the other way around, I don’t quit remember), making the parser fail as well.
Can you attach an minimal-ish example?
The example I tested on is 45MB big, so… not yet :D. But looking at the parser, I guess there’s something wrong with the order the parser expects things to occur.
Though:
# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
# File Created: 24.07.2016 15:28:16
#mtllib Magnum fury test build 2.mtl
#
# object Object030
#
v 46.9378 58.0687 -53.6929
v 46.4123 56.1572 -53.9380
v 45.5589 54.3956 -54.3359
v 46.9378 62.0444 -53.6929
…
thread 'main' panicked at 'called
Result::unwrap()on an
Errvalue: ParseFailed(ParseError { line_number: 10, message: "Expected end of input but got v." })', ../src/libcore/result.rs:799
Ok, looks like it’s a problem with unammed object. I’ll fix that and push a PR soon.
Ok, I fixed the problem with objects. Now I have another problem. Fixing it as well.
Ok, almost there. Just need to fix the texture coordinates parser, and it’ll be good!
The parsing order might be dependent on the way the parser expects tokens to appear.