From e5ed62581d9672b05c3875e3c89d8333385790f5 Mon Sep 17 00:00:00 2001 From: Gargaj Date: Sat, 2 Aug 2014 14:57:43 +0200 Subject: [PATCH] Handle both types of element names MAX seems to add an "s" to "Binormal" and "Tangent" when exporting --- code/FBXMeshGeometry.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/FBXMeshGeometry.cpp b/code/FBXMeshGeometry.cpp index be3fbd621..ebc75f48e 100644 --- a/code/FBXMeshGeometry.cpp +++ b/code/FBXMeshGeometry.cpp @@ -466,8 +466,9 @@ void MeshGeometry::ReadVertexDataTangents(std::vector& tangents_out, const std::string& MappingInformationType, const std::string& ReferenceInformationType) { + const char * str = source.Elements().count( "Tangents" ) > 0 ? "Tangents" : "Tangent"; ResolveVertexDataArray(tangents_out,source,MappingInformationType,ReferenceInformationType, - "Tangent", + str, "TangentIndex", vertices.size(), mapping_counts, @@ -481,8 +482,9 @@ void MeshGeometry::ReadVertexDataBinormals(std::vector& binormals_ou const std::string& MappingInformationType, const std::string& ReferenceInformationType) { + const char * str = source.Elements().count( "Binormals" ) > 0 ? "Binormals" : "Binormal"; ResolveVertexDataArray(binormals_out,source,MappingInformationType,ReferenceInformationType, - "Binormal", + str, "BinormalIndex", vertices.size(), mapping_counts,