15 #include "eggToMaya.h" 16 #include "mayaEggLoader.h" 26 #include "pre_maya_include.h" 27 #include <maya/MString.h> 28 #include <maya/MFileIO.h> 29 #include "post_maya_include.h" 42 set_binary_output(
true);
43 set_program_brief(
"convert .egg files to Maya .mb or .ma files");
44 set_program_description
45 (
"egg2maya converts files from egg format to Maya .mb or .ma " 46 "format. It contains support for basic geometry (polygons with textures)." 47 "It also supports animation for joints.");
51 "Convert animation tables.",
52 &EggToMaya::dispatch_none, &_convert_anim);
56 "Convert polygon models. You may specify both -a and -m at the same " 57 "time. If you specify neither, the default is -m.",
58 &EggToMaya::dispatch_none, &_convert_model);
62 "respect vertex and polygon normals.",
63 &EggToMaya::dispatch_none, &_respect_normals);
66 _output_units = DU_centimeters;
76 if (!_convert_anim && !_convert_model) {
77 _convert_model =
true;
83 _output_filename.make_absolute();
85 nout <<
"Initializing Maya.\n";
86 PT(
MayaApi) maya = MayaApi::open_api(_program_name);
87 if (!maya->is_valid()) {
88 nout <<
"Unable to initialize Maya.\n";
93 status = MFileIO::newFile(
true);
95 status.perror(
"Could not initialize file");
104 maya->set_units(_output_units);
106 if (_output_units != DU_centimeters && _output_units != DU_invalid) {
107 nout <<
"Converting from centimeters" 108 <<
" to " << format_long_unit(_output_units) <<
"\n";
112 if (!MayaLoadEggData(_data,
true, _convert_model, _convert_anim, _respect_normals)) {
113 nout <<
"Unable to convert egg file.\n";
117 if (!maya->write(_output_filename)) {
118 status.perror(
"Could not save file");
137 int main(
int argc,
char *argv[]) {
virtual void parse_command_line(int argc, char **argv)
Dispatches on each of the options on the command line, and passes the remaining parameters to handle_...
A program to read an egg file and write a maya file.
This is the general base class for a file-converter program that reads some model file format and gen...
This class presents a wrapper around the global Maya interface.