mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 01:44:06 -04:00
fix bug in x2egg involving joint names with hyphens
This commit is contained in:
parent
2a1a215fac
commit
9feab0567f
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user