diff --git a/panda/src/egg/eggGroupUniquifier.cxx b/panda/src/egg/eggGroupUniquifier.cxx index 26fe187f2d..fa84063164 100644 --- a/panda/src/egg/eggGroupUniquifier.cxx +++ b/panda/src/egg/eggGroupUniquifier.cxx @@ -29,10 +29,16 @@ TypeHandle EggGroupUniquifier::_type_handle; //////////////////////////////////////////////////////////////////// // Function: EggGroupUniquifier::Constructor // Access: Public -// Description: +// Description: If filter_names is true, then the group names will be +// coerced into a fairly safe, standard convention that +// uses no characters other than a-z, A-Z, 0-9, and +// underscore. If filter_names is false, the group +// names will be left unchanged. //////////////////////////////////////////////////////////////////// EggGroupUniquifier:: -EggGroupUniquifier() { +EggGroupUniquifier(bool filter_names) + : _filter_names(filter_names) +{ } //////////////////////////////////////////////////////////////////// @@ -62,6 +68,9 @@ get_category(EggNode *node) { string EggGroupUniquifier:: filter_name(EggNode *node) { string name = node->get_name(); + if (!_filter_names) { + return name; + } nassertr(!name.empty(), string()); string result; diff --git a/panda/src/egg/eggGroupUniquifier.h b/panda/src/egg/eggGroupUniquifier.h index ba9f07282f..e3864aa86b 100644 --- a/panda/src/egg/eggGroupUniquifier.h +++ b/panda/src/egg/eggGroupUniquifier.h @@ -32,13 +32,16 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDAEGG EggGroupUniquifier : public EggNameUniquifier { PUBLISHED: - EggGroupUniquifier(); + EggGroupUniquifier(bool filter_names = true); virtual string get_category(EggNode *node); virtual string filter_name(EggNode *node); virtual string generate_name(EggNode *node, const string &category, int index); +private: + bool _filter_names; + public: static TypeHandle get_class_type() { return _type_handle; diff --git a/pandatool/src/xfileegg/xFileToEggConverter.cxx b/pandatool/src/xfileegg/xFileToEggConverter.cxx index e002f0d968..43fc073441 100644 --- a/pandatool/src/xfileegg/xFileToEggConverter.cxx +++ b/pandatool/src/xfileegg/xFileToEggConverter.cxx @@ -141,7 +141,7 @@ convert_file(const Filename &filename) { if (_make_char) { // Now make sure that each joint has a unique name. - EggGroupUniquifier uniquifier; + EggGroupUniquifier uniquifier(false); uniquifier.uniquify(_dart_node); }