From d5de32ec1c685edfbd9b2c5c2049105e2f671e48 Mon Sep 17 00:00:00 2001 From: FRICOTEAUX Date: Tue, 11 Sep 2018 16:07:43 +0200 Subject: [PATCH] FBX import: fix import of direct data by vertices + unify node renaming --- code/FBXConverter.cpp | 8 ++------ code/FBXMeshGeometry.cpp | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/code/FBXConverter.cpp b/code/FBXConverter.cpp index b088b22e0..0cbe04d8f 100644 --- a/code/FBXConverter.cpp +++ b/code/FBXConverter.cpp @@ -185,12 +185,8 @@ void FBXConverter::ConvertNodes( uint64_t id, aiNode& parent, const aiMatrix4x4& } if ( !name_carrier ) { - NodeNameCache::const_iterator it = mNodeNames.find(original_name); - if ( it != mNodeNames.end() ) { - original_name = original_name + std::string( "001" ); - } - - mNodeNames.insert( original_name ); + std::string old_original_name = original_name; + GetUniqueName(old_original_name, original_name); nodes_chain.push_back( new aiNode( original_name ) ); } else { original_name = nodes_chain.back()->mName.C_Str(); diff --git a/code/FBXMeshGeometry.cpp b/code/FBXMeshGeometry.cpp index 8bfd60570..aa794d4df 100644 --- a/code/FBXMeshGeometry.cpp +++ b/code/FBXMeshGeometry.cpp @@ -437,7 +437,7 @@ void ResolveVertexDataArray(std::vector& data_out, const Scope& source, // deal with this more elegantly and with less redundancy, but right // now it seems unavoidable. if (MappingInformationType == "ByVertice" && isDirect) { - if (!HasElement(source, indexDataElementName)) { + if (!HasElement(source, dataElementName)) { return; } std::vector tempData;