This is a replacement for the python .obj exporter, written in C++ by Ankit Meel, with some fixes and modifications and added tests by Howard Trickey.
There are some known differences between the output of this exporter and the python one, namely:
- The py exporter appends the file name on the first comment (header) line of the output .obj file.
- The py exporter has a second comment header line with 'Material Count: <the count>' on it.
I searched the internet to see if these were common or expected in other software's .obj output, and couldn't find that, so I don't think these differences matter. They could be fixed to be exactly like the .py exporter but it would be fiddly to do so.
Other differences:
- the py exporter uses 's off' while the new one uses 's 0' to turn off smoothing groups. Both are acceptable according to the standard.
- the py exporter uses 'usemtl (null)' to say there is no material; the new one uses 'usemtl'.
- the py exporter sorts faces to try to minimize the number of 's' commands needed; the new one does not
- the py exporter puts in order: v's, vt's, vn's; the new one puts in order v's. vn's, vt's.
- the py exporter uses a dictionary of normals with coordinates rounded to 4 places, to try to minimize the number of separate normals needed; the new one doesn't do this
- the py exporter has a 'l' (line) command for every edge, even if they are part of a face, when 'export edges' is enabled; the new on doesn't have that option and always uses 'l' commands but only for loose (wire) edges