Writing a command line exporter


 

 

The Maya API can be used in one of two ways, either to create a plugin, or as a stand-alone application. This topic covers using MLibrary to create a command line application.

There are some obvious benefits in writing a command line based exporter. Primarily it allows you to create an automated graphics build process. It should be pointed out that there are a few ways of using mel scripts to automate the build process which will only require a file translator plugin. A simple command line exporter may be all you require though....

 

 

 

 

Using MLibrary

Essentially any application we write can gain full access to Maya's functionality by linking to and using MLibrary.

As an example, this simply initialises the Maya libraries, and then exits. The source code frameworks, and the simple exporter examples provide more information should you need it.

 


#include<maya/MLibrary.h>

int main(int argc,char** argv)
{
 

// initialise the maya library
MLibrary::initialize(argv[0]);

// we could use MFileIO to open & export files here

// cleanup maya before we quit

MLibrary::cleanup();

return 0;

}




 

 

What Next?

Writing A File Translator Plugin

index

Rob Bateman [2004]

[HOME] [MEL] [API]