23 #include <maya/MString.h> 24 #include <maya/MFileIO.h> 36 set_binary_output(
true);
37 set_program_brief(
"convert .egg files to Maya .mb or .ma files");
38 set_program_description
39 (
"egg2maya converts files from egg format to Maya .mb or .ma " 40 "format. It contains support for basic geometry (polygons with textures)." 41 "It also supports animation for joints.");
45 "Convert animation tables.",
46 &EggToMaya::dispatch_none, &_convert_anim);
50 "Convert polygon models. You may specify both -a and -m at the same " 51 "time. If you specify neither, the default is -m.",
52 &EggToMaya::dispatch_none, &_convert_model);
56 "respect vertex and polygon normals.",
57 &EggToMaya::dispatch_none, &_respect_normals);
60 _output_units = DU_centimeters;
68 if (!_convert_anim && !_convert_model) {
69 _convert_model =
true;
74 _output_filename.make_absolute();
76 nout <<
"Initializing Maya.\n";
77 PT(
MayaApi) maya = MayaApi::open_api(_program_name);
78 if (!maya->is_valid()) {
79 nout <<
"Unable to initialize Maya.\n";
84 status = MFileIO::newFile(
true);
86 status.perror(
"Could not initialize file");
94 maya->set_units(_output_units);
96 if (_output_units != DU_centimeters && _output_units != DU_invalid) {
97 nout <<
"Converting from centimeters" 102 if (!MayaLoadEggData(_data,
true, _convert_model, _convert_anim, _respect_normals)) {
103 nout <<
"Unable to convert egg file.\n";
107 if (!maya->write(_output_filename)) {
108 status.perror(
"Could not save file");
127 int main(
int argc,
char *argv[]) {
string format_long_unit(DistanceUnit unit)
Returns the string representing the full name (plural) for the given unit.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the general base class for a file-converter program that reads some model file format and gen...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class presents a wrapper around the global Maya interface.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.