Hi all,

I found an issue regarding the OBJ writer and saving Face TexCoords.

Basically, what I'm seeing is that the OBJ writer is adding extra vt entries into the OBJ file.  The file still works in Meshlab if I add the missing MTL header to the top of the OBJ file, but I'm unable to reopen the file using OpenMesh.

The error I'm getting is "Only single 2D or 3D texture coordinate per vertexallowed!".  From what I'm seeing, the new OBJ file has (in my case) an additonal 983 VT entries.

To open the mesh, I'm doing: 

    OpenMesh::IO::Options ropt;

    ropt += OpenMesh::IO::Options::FaceTexCoord;

    

    _mesh.request_vertex_normals();

    _mesh.request_face_normals();

    _mesh.request_halfedge_texcoords2D();

    

    if (!OpenMesh::IO::read_mesh(_mesh, path, ropt))

    {

        return false;

    }


    _mesh.update_normals();

    


To save the mesh, I'm doing: 

    OpenMesh::IO::Options wopt;

    if (_mesh.has_vertex_normals())

    {

        wopt += OpenMesh::IO::Options::VertexNormal;

    }

    

    if (_mesh.has_halfedge_texcoords2D())

    {

        std::cout << "has 2d" << std::endl;

        wopt += OpenMesh::IO::Options::FaceTexCoord;

    }

    

    if (!OpenMesh::IO::write_mesh(_mesh, path, wopt))

        return true;


There have been no modifications to the file.

Thanks for your help,
Jan-Michael