Export OBJ (Wavefront)

Wavefront OBJ is a text-based legacy 3D model exchange format. Despite its limitations in efficiency and features (for example, no modern material support or geometry instancing), it remains popular due to its simple syntax and manual editability.

Export options

The general export options are used for OBJ export. If there are issues displaying the exported model correctly in other programs, set Triangulate Meshes to true.

CGA mapping to OBJ

The subsections below outline CGA mapping to OBJ.

Geometry

Geometry mapping is outlined in the following table:

OBJ elementCGA feature

v

Vertex data from asset meshes.

vn

Vertex normal data from asset meshes.

vt

Texture coordinates from colormap texture channel of asset meshes. The per-texture transformations (see material.colormap.{su, sv, tu, tv, rw}) are not included in these texture coordinates.

f

The mesh faces or polygons defined by the vertex, vertex normals, and texture coordinates indices from the asset meshes.

g

The face group name. If the mesh comes directly from an inserted asset, the original name is used. If Mesh Granularity is set to merge meshes by material, this name is controlled by the material.name attribute. Otherwise, an internal name is set depending on the operation that created the geometry.

s

Smoothing groups are not supported and are turned off. Use vertex normals instead.

usemtl

Material name and reference into the corresponding .mtl file (see the Material section below). It is only written if the Materials export option is enabled.

mtllib

Local reference to the corresponding .mtl file. It uses the same base name as the .obj file (but with the .mtl extension) and is written to the same directory.

Material

Material mapping is outlined in the following table:

Note:

The material definitions are exported into separate .mtl files.

MTL elementCGA feature

newmtl

The material name corresponds to the usemtl statement in the .obj files.

illum

If the material of the mesh contains a specular color component equal to (0,0,0) a Lambert material is exported (illum is set to 3). For Phong materials (specular component != zero or reflectivity), it is set to 4.

Kd

Diffuse color. Use the material.color setting.

map_Kd

Diffuse texture. Use the material.colormap setting. This statement is only written if a texture file is assigned to the colormap channel. Optionally, the following uv translation and scaling factors are exported:

If material.colormap.{su,sv} are != 1.0, the -s option is appended with the scaling factors.

If material.colormap.{tu,tv} are != 0.0, the -o option is appended with the translation values.

Ka

Ambient color. Use the material.ambient setting.

Ks

Specular color. Use the material.specular setting if the material is of type Phong (illum = 4).

d

Opacity,. Use the material.opacity setting.

map_d

Opacity map. Use the material.opacitymap setting.

Ns

The specular exponent of the Phong lighting model, also called shininess. Use the material.shininess setting.

Tf

For Maya compatibility, set to (1.0, 1.0, 1.0).

Ni

For Maya compatibility, set to 1.0.

See Rendering, import, and export for more information.