17 #include "eggPolygon.h"
18 #include "eggGroupNode.h"
20 #include "string_utils.h"
31 set_program_brief(
"convert .egg files to .obj");
32 set_program_description
33 (
"This program converts egg files to obj. It "
34 "only converts polygon data, with no fancy tricks. "
35 "Very bare-bones at the moment; not even texture maps are supported.");
39 "Specify the coordinate system of the resulting " + _format_name +
40 " file. Normally, this is z-up.");
44 "Clean out higher-order polygons by subdividing into triangles.",
45 &EggToObj::dispatch_none, &_triangulate_polygons);
47 _coordinate_system = CS_zup_right;
48 _got_coordinate_system =
true;
58 if (_triangulate_polygons) {
59 nout <<
"Triangulating polygons.\n";
60 int num_produced = _data->triangulate_polygons(~0);
61 nout <<
" (" << num_produced <<
" triangles produced.)\n";
68 nout <<
"An error occurred while writing.\n";
83 return EggToSomething::handle_args(args);
86 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_...
virtual bool write_file(const Filename &filename)
Handles the conversion of the internal EggData to the target file format, written to the specified fi...
Filename get_output_filename() const
If has_output_filename() returns true, this is the filename that the user specified.
void set_egg_data(EggData *egg_data)
Sets the egg data that will be filled in when convert_file() is called.
This is the general base class for a file-converter program that reads some model file format and gen...
Convert an obj file to egg data.