diff options
author | Aras Pranckevicius <aras@nesnausk.org> | 2022-07-10 20:09:29 +0300 |
---|---|---|
committer | Aras Pranckevicius <aras@nesnausk.org> | 2022-07-10 20:09:29 +0300 |
commit | fad857f47319166d3ff97029385b50059731a576 (patch) | |
tree | ba1c2d5cd3dda8555123e70293a9bb541b4ffd62 /source/blender/blenlib/intern | |
parent | 4114ace6169282390b199ea593c93445af748903 (diff) |
Fix T99532: New OBJ importer in some cases fails to import faces
The importer code was written under incorrect assumption that vertex
data (v, vn, vt commands etc.) are grouped by object, i.e. follow the
o command, and that each object has its own vertex data commands. This
is not the case -- all the vertex data in the whole OBJ file is
"global", with no relation to any objects/groups; it's just that the
faces belong to the object, and then they pull in any vertices they
like.
This patch fixes this incorrect assumption in the importer:
- Vertex data is now properly global; no need to track some sort of
"offsets" per object like it was doing before.
- For each object, face definitions track the minimum & maximum vertex
indices referenced by the object, and then all that vertex range is
created in the final Blender object. Note: it might be (unusual, but
possible) that an object does not reference a sequential range of
vertices, e.g. just a single face with vertex indices 1, 10, 100 --
the resulting Blender mesh will have all the 100 vertices (some
"loose" without belonging to a face). It should be possible to track
the used vertices exactly (e.g. with a vector set), but I haven't
done that for performance reasons.
Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D15410
Diffstat (limited to 'source/blender/blenlib/intern')
0 files changed, 0 insertions, 0 deletions