Reading & Writing Files in Maya API

 

 

MFileIO

Maya provides you with a general interface for reading and writing maya related files.

The class MFileIO allows you to load and save Maya ascii & binary files. It also allows you to import and export custom file formats.

For the purpose of command line or batch process exporters, this class may well come in useful.

 

 

 


#include<maya/MFileIO.h>

// open a maya binary file
if( MS::kSucess != MFileIO::open("somefile.mb") ) {
  cerr << "could not open file\n";
return false;
}

// save a maya ascii file
if( MS::kSucess != MFileIO::saveAs("somefile.ma") ) {
  cerr << "could not open file\n";
return false;
}

// create a new maya scene
if( MS::kSucess != MFileIO::new(true) ) {
  cerr << "could not open file\n";
return false;

}


 

 

 

 

What Next?

Using MGlobal

Traversing The Scenegraph

Accessing Attributes

Accessing Node Connections

index

Rob Bateman [2004]

[HOME] [MEL] [API]