How to convert v5 objects to the obj v7 format ?

version française

The object format changed several times during X-Plane life.
In version 5, there is a texture file for each face of the object.
In version 6, only one texture for an object.
In version 7, definition changed to be closer to OpenGL commands.

A few examples :

Version 5

I

4 dd_phenix_wall1 // mur1
9 2.5 0
9 0 0
0 0 0
0 2.5 0

99
- I for IBM or A for Apple.
- No version number, it was the first !
- 4 is the number of polygone sides. 1 is for a point, 2 a ligne and 3 a triangle.
- dd_phoenix_wall1 is the texture name for this face. The file must be a BMP. // is the start for comments.
- 9 2.5 0 are the coordinates of the first point. - 99 shows the file end.

Version 6

A
2   // Object only supported by X-Plane version 6.1 and up. Single-Texture object

Bld:chalet   // Texture

4 0.7536 0.9945 0.7558 0.9938        // Toit
12.1   14.5   -17   
12.1   14.5   13   
0   20   13   
0   20   -17   

99  //  Created using ObjectMaker v.6.60 PPC for Macintosh © 2002 by C. Franz
- 2 : this time there is a version number.
- Bld:chalet chalet is the texture name and Bld the name of the sub folder of Custom object textures where the texture file is located.
- 4 means the same thing as before. 0.7536 0.9945 0.7558 0.9938 represents the coordinates of the lower left and upper right corners of the quad used for this face in the texture.
- 12.1 14.5 -17 coordinates of one of the points.

Version 7

I
700
OBJ

Bld:chalet		//

quad		//
12.100000 14.500000 -17.000000    0.994500 0.993800
12.100000 14.500000 13.000000    0.994500 0.755800
0.000000 20.000000 13.000000    0.753600 0.755800
0.000000 20.000000 -17.000000    0.753600 0.993800

end		//
- 700 : new version number.
- quad is a four sided polygon, tri a triangle. And line a ...line.
- end is the end of file.


Convert

Available tools

To convert objects from v6 to v7 there is an easy to use tool. It is ObjConverter from Ben Supnik XPTools. You can find it here : http://www.xsquawkbox.net/tools/xptools/

To convert objects from v5 to v6, it is not that easy. There was a tools created by Christian Franz but he stops working on it. And it is a Mac only tool. If the web site is not closed, you can try this URL : http://www.christian.franz.net/OM/

Manual convertion

As v5 and v6 objects are not very differents, it is possible to use a text editor to update the OBJ file from v5 to v6.

Except if the v5 object was using only one texture file, we will have to re-do texturing.

- Add a 2 to the second line for the version number.
I
2
- Add a texture name.
I
2

texture
- For each polygon, replace the texture name by a four numbers between 0 and 1 (or three if it is a triangle).
4 dd_phenix_wall1 // mur1
9 2.5 0
9 0 0
0 0 0
0 2.5 0
becomes
4  0 0 0 0  // mur1
9 2.5 0
9 0 0
0 0 0
0 2.5 0

After, you only have to convert the object to the v7 format with ObjConverter from the XP-Tools and apply the textures, with ObjEdit from the XP-Tools for instance.

Et voilà !