4.17.1 OBJReader class

The OBJReader class reads Wavefront OBJ files and calls appropriate methods which have to be implemented in a derived class.

class OBJReader( )
Creates an instance of the reader.

read( f)
Read the content of a file. f must be a file like object that can be used to read the content of the file.

begin( )
Callback method that is called before the file is read.

end( )
Callback method that is called after the file was read.

handleUnknown( cmd, arglist)
This method is called when a keyword is encountered that has no corresponding handler method.

The following are the predefined handler methods:

call( filename, *args)

csh( cmd)

mtllib( *files)

usemtl( name)

g( *groups)

s( groupnumber)

v( vert)

vp( vert)

vn( normal)

vt( tvert)

f( *verts)

o( name)

bevel( onoff)

c_interp( onoff)

d_interp( onoff)

lod( level)

shadow_obj( filename)

trace_obj( filename)