4.19.1 MBReader class

The MBReader class reads Maya Binary files and calls appropriate methods which have to be implemented in a derived class. A Maya Binary file is composed of chunks that contain the actual data. There can be data chunks that contain the actual data and group chunks that contain the data chunks.

class MBReader( )
Creates an instance of the reader.

filename
The file name (if it could be obtained). This may be used for generating warning or error messages.

read( file)
Read the content of a file. file is either a file like object that can be used to read the content of the file or the name of a file.

abort( )
Aborts reading the current file. This method can be called in handler methods to abort reading the file.

onBeginGroup( chunk)
Callback that is called whenever a new group tag begins. chunk is a GroupChunk object (see section 4.19.3) containing information about the group chunk.

onEndGroup( chunk)
Callback that is called whenever a group goes out of scope. chunk is a GroupChunk object (see section 4.19.3) containing information about the group chunk (it is the same instance that was passed to onBeginGroup()).

onDataChunk( chunk)
Callback that is called for each data chunk. chunk is a Chunk object (see section 4.19.2) that contains information about the chunk and that can be used to read the actual chunk data.