From 699aa9c5834acd65304ef77f6dfe3ae100bed2f1 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 3 Feb 2016 21:09:20 +0100 Subject: [PATCH] Closes https://github.com/assimp/assimp/issues/754: use correct index token. --- code/FBXMeshGeometry.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/code/FBXMeshGeometry.cpp b/code/FBXMeshGeometry.cpp index d482ab833..28ce924cb 100644 --- a/code/FBXMeshGeometry.cpp +++ b/code/FBXMeshGeometry.cpp @@ -471,32 +471,38 @@ void MeshGeometry::ReadVertexDataColors(std::vector& colors_out, cons mappings); } - // ------------------------------------------------------------------------------------------------ +static const std::string TangentIndexToken = "TangentIndex"; +static const std::string TangentsIndexToken = "TangentsIndex"; + void MeshGeometry::ReadVertexDataTangents(std::vector& tangents_out, const Scope& source, const std::string& MappingInformationType, const std::string& ReferenceInformationType) { const char * str = source.Elements().count( "Tangents" ) > 0 ? "Tangents" : "Tangent"; + const char * strIdx = source.Elements().count( "Tangents" ) > 0 ? TangentsIndexToken.c_str() : TangentIndexToken.c_str(); ResolveVertexDataArray(tangents_out,source,MappingInformationType,ReferenceInformationType, str, - "TangentIndex", + strIdx, vertices.size(), mapping_counts, mapping_offsets, mappings); } - // ------------------------------------------------------------------------------------------------ +static const std::string BinormalIndexToken = "BinormalIndex"; +static const std::string BinormalsIndexToken = "BinormalsIndex"; + void MeshGeometry::ReadVertexDataBinormals(std::vector& binormals_out, const Scope& source, const std::string& MappingInformationType, const std::string& ReferenceInformationType) { const char * str = source.Elements().count( "Binormals" ) > 0 ? "Binormals" : "Binormal"; + const char * strIdx = source.Elements().count( "Binormals" ) > 0 ? BinormalsIndexToken.c_str() : BinormalIndexToken.c_str(); ResolveVertexDataArray(binormals_out,source,MappingInformationType,ReferenceInformationType, str, - "BinormalIndex", + strIdx, vertices.size(), mapping_counts, mapping_offsets,