Update ObjExporter.cpp

In the OBJ spec ( http://www.martinreddy.net/gfx/3d/OBJ.spec ), in the section labeled "Referencing groups of vertices", there is no support for allowing a trailing slash with no valid vertex normal reference at the end. This commit modifies the vertex reference output code to prevent this behavior, as it has been causing compatibility issues with other software that parse OBJ files.
pull/300/head
Nathan Morse 2014-06-20 15:08:29 -07:00
parent 1c4a8e9017
commit d10d20f62f
1 changed files with 2 additions and 5 deletions

View File

@ -243,11 +243,8 @@ void ObjExporter :: WriteGeometryFile()
if (fv.vt) {
mOutput << fv.vt;
}
if (f.kind == 'f') {
mOutput << '/';
if (fv.vn) {
mOutput << fv.vn;
}
if (f.kind == 'f' && fv.vn) {
mOutput << '/' << fv.vn;
}
}
}