From 7967f0a33fce02d8c862157ec5c32b25bc144438 Mon Sep 17 00:00:00 2001 From: "Kenneth Perry (thothonegan)" Date: Fri, 13 Jul 2018 15:25:04 -0500 Subject: [PATCH] FBXImporter: Fix GetUniqueName to return names properly --- code/FBXConverter.cpp | 5 +++-- code/FBXConverter.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/code/FBXConverter.cpp b/code/FBXConverter.cpp index 981203abb..472eb03fb 100644 --- a/code/FBXConverter.cpp +++ b/code/FBXConverter.cpp @@ -407,14 +407,15 @@ static bool HasName( NodeNameCache &cache, const std::string &name ) { return it != cache.end(); } -void Converter::GetUniqueName( const std::string &name, std::string uniqueName ) { +void Converter::GetUniqueName( const std::string &name, std::string& uniqueName ) { if ( !HasName( mNodeNames, name ) ) { uniqueName = name; + mNodeNames.push_back( uniqueName ); return; } int i( 0 ); - std::string newName; + std::string newName (name); while ( HasName( mNodeNames, newName ) ) { ++i; newName.clear(); diff --git a/code/FBXConverter.h b/code/FBXConverter.h index fca42e8d7..2c0810d94 100644 --- a/code/FBXConverter.h +++ b/code/FBXConverter.h @@ -131,7 +131,7 @@ private: void ConvertCamera( const Camera& cam, const std::string &orig_name ); // ------------------------------------------------------------------------------------------------ - void GetUniqueName( const std::string &name, std::string uniqueName ); + void GetUniqueName( const std::string &name, std::string& uniqueName ); // ------------------------------------------------------------------------------------------------ // this returns unified names usable within assimp identifiers (i.e. no space characters -