Importing models into LightWave

Written by Paul Bourke


Import restrictions

Comments apply to version 5.x
The two easy import formats for LightWave are DXF and OBJ files. Unfortunately there seem to be rather restrictive limits on the size of objects, in particular there appears to be a limit of 65535 (2 byte vertex index maybe) to objects. When importing OBJ formats a large number of vertices seem to be read OK but the vertex indices in the face list are added modulo 65536 (It would save a lot of grief if sensible error messages were given in these circumstances!). When importing large DXF models the importing generally fails at some point after 65536 facets.
The solution is to split the model up into a number of separate DXF or OBJ files, import each one and save the object. A tedious process and exactly the sort of thing one expects computer software to do for us.

Example DXF file

The following is an example DXF file illustrating how faces can be imported into LightWave. The red comments should not be included.

999
Place a comment here
  0
SECTION
  2
HEADER
  0
ENDSEC
  0
SECTION
  2
TABLES
  0
TABLE
  0
LAYER
 70
     1
  0
LAYER
  2
Default
 70
    64
 62
     0
  6
CONTINUOUS
  0
ENDTAB
  0
ENDSEC
  0
SECTION
  0
BLOCKS
  0
ENDSEC
  0
SECTION
  2
ENTITIES
  0              <-- This is the start of the face
3DFACE
  8
Default
 10              <-- This is the start of vertex 1
15081.5          <-- x
 20
-3.45644e+06     <-- y
 30
65.8061          <-- z
 11              <-- This is the start of vertex 2
15081
 21
-3.45659e+06
 31
197.422
 12              <-- This is the start of vertex 3
45286.7
 22
-3.45974e+06
 32
592.835
 13              <-- This is the start of vertex 3
45289.4
 23
-3.45969e+06
 33
197.613
                 <-- Place more facets here
  0
ENDSEC
  0
EOF
Note that for a 3 vertex face the 4th vertex is still required and should be made the same as the third vertex.

Example OBJ file

The following is an example of an OBJ file. Note the face indices start at 1 not 0.

g mars.wav
v 15081.5 -3.45644e+06 65.8061   <-- Vertex 1
v 15081 -3.45659e+06 197.422
v 15078.2 -3.45648e+06 329.009
v 15075.4 -3.45663e+06 460.597
                                 <-- Further vertices
usemtl Default
f 1 721 722                      <-- First face (3 vertex)
f 1 722 2
f 2 722 723
f 2 723 3
                                 <-- Further faces