Skip to content

Commit

Permalink
Improve .obj import
Browse files Browse the repository at this point in the history
  • Loading branch information
luboslenco committed Jan 3, 2025
1 parent caf4127 commit 506db62
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions armorcore/sources/iron_obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,15 @@ static void read_face() {
if (uv_temp.length > 0) {
ua[ui++] = read_int() - 1;
}

if (nor_temp.length > 0) {

// Some exporters put fake uv index even when uv data is not present... (f 1/1/1 instead of f 1//1)
bool has_bogus_uv = uv_temp.length == 0 && bytes[part->pos] != '/';
if (has_bogus_uv) {
read_int();
}

part->pos++; // "/"
na[ni++] = read_int() - 1;
}
Expand Down

0 comments on commit 506db62

Please sign in to comment.