Remove doubles corrupts UV mapping
The problem turned out to be a bit more tricky then I expected. The model I'm importing contains several duplicate vertices, but as a result also duplicate faces. Depending on the order the faces are defined in, in the OBJ file, the resulting material that is visible differs. So I ended up writing a bit of Python code to pre-process the obj file: remove all double vertices, remove double face definition ensuring that the remaining face has the correct material defined.