Fix T103441: make OBJ importer ignore any unrecognized trailing per-face index data.

Some files out there (e.g. in T103441) contain face definitions with
four indices, which the importer code was not expecting. The OBJ
standard spells out up to three indices per face corner; the file in
there must be using some sort of non-standard OBJ syntax extension.
Now the code simply ignores any trailing per-face-corner data.
This commit is contained in:
Aras Pranckevicius 2023-01-01 19:30:20 +02:00
parent 8007f7e74f
commit 3277879085
Notes: blender-bot 2023-02-14 06:49:54 +01:00
Referenced by issue #103441, Wavefront OBJ importer only imports vertices
1 changed files with 2 additions and 0 deletions

View File

@ -252,6 +252,8 @@ static void geom_add_polygon(Geometry *geom,
geom->face_corners_.append(corner);
curr_face.corner_count_++;
/* Some files contain extra stuff per face (e.g. 4 indices); skip any remainder (T103441). */
p = drop_non_whitespace(p, end);
/* Skip whitespace to get to the next face corner. */
p = drop_whitespace(p, end);
}