25 add_path_replace_options();
26 add_path_store_options();
31 set_program_brief(
"convert a DirectX .x file to an .egg file");
32 set_program_description
33 (
"This program converts DirectX retained-mode (.x) files to egg. " 34 "Polygon meshes, materials, and textures, as well as skeleton " 35 "animation and skinning data, are supported. All animations " 36 "found in the source .x file are written together into the same " 41 "Specify the name of the animated character to generate. This option " 42 "forces the model to be converted as an animatable character, even " 43 "if animation channels are not found in the file. Without this " 44 "option, the model is converted as a static model (which " 45 "is usually more efficient to load within Panda), unless animation " 46 "channels are present in the .x file.",
47 &XFileToEgg::dispatch_string, &_make_char, &_char_name);
51 "Specify the frame rate of the resulting animation. If this is " 52 "omitted or 0, the frame rate is inferred from the file itself; but " 53 "note that the file must contain evenly-spaced keyframes.",
54 &XFileToEgg::dispatch_double,
nullptr, &_frame_rate);
58 "Generate animation data only (all geometry will be discarded).",
59 &XFileToEgg::dispatch_none, &_keep_animation);
63 "Generate model data only (all animation data will be discarded).",
64 &XFileToEgg::dispatch_none, &_keep_model);
68 "Specify the units of the input " + _format_name +
" file.");
72 "Specify the units of the resulting egg file. If both this and -ui are " 73 "specified, the vertices in the egg file will be scaled as " 74 "necessary to make the appropriate units conversion; otherwise, " 75 "the vertices will be left as they are.");
79 "Specify the coordinate system of the input " + _format_name +
80 " file. Normally, this is y-up-left.");
83 _coordinate_system = CS_yup_left;
91 _data->set_coordinate_system(_coordinate_system);
96 converter._frame_rate = _frame_rate;
97 converter._make_char = _make_char;
98 converter._char_name = _char_name;
99 converter._keep_model = _keep_model;
100 converter._keep_animation = _keep_animation;
103 apply_parameters(converter);
106 nout <<
"Unable to read " << _input_filename <<
"\n";
115 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_...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void add_normals_options()
Adds -no, -np, etc.
virtual bool convert_file(const Filename &filename)
Handles the reading of the input file and converting it to egg.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void set_egg_data(EggData *egg_data)
Sets the egg data that will be filled in when convert_file() is called.
void write_egg_file()
Writes out the egg file as the normal result of the program.
void init_libxfile()
Initializes the library.
void add_transform_options()
Adds -TS, -TT, etc.
This is the general base class for a file-converter program that reads some model file format and gen...
A program to read a DirectX "x" file and generate an egg file.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void add_units_options()
Adds -ui and -uo as valid options for this program.