00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "eggRename.h"
00016 #include "pystub.h"
00017
00018
00019
00020
00021
00022
00023 EggRename::
00024 EggRename() {
00025 set_program_description
00026 ("egg-rename reads one or more egg files and writes back with modified"
00027 "node names. ie. suppressing prefix from all the nodes' names. ");
00028
00029 add_option
00030 ("strip_prefix", "name", 0,
00031 "strips out the prefix that is put on all nodes, by maya ext. ref",
00032 &EggRename::dispatch_vector_string, NULL, &_strip_prefix);
00033 }
00034
00035
00036
00037
00038
00039
00040 void EggRename::
00041 run() {
00042 if (!_strip_prefix.empty()) {
00043 nout << "Stripping prefix from nodes.\n";
00044 int num_renamed = 0;
00045 int num_egg_files = 0;
00046 Eggs::iterator ei;
00047 for (ei = _eggs.begin(); ei != _eggs.end(); ++ei) {
00048 num_renamed += (*ei)->rename_nodes(_strip_prefix, true);
00049 ++num_egg_files;
00050 }
00051 nout << " (" << num_renamed << " renamed.)\n";
00052 }
00053
00054 write_eggs();
00055 }
00056
00057
00058 int main(int argc, char *argv[]) {
00059
00060 pystub();
00061
00062 EggRename prog;
00063 prog.parse_command_line(argc, argv);
00064 prog.run();
00065 return 0;
00066 }