From e63426b89c97e9f9c9f0ced64de55813a43d4402 Mon Sep 17 00:00:00 2001 From: Engin Manap Date: Fri, 8 Jul 2022 23:42:41 +0200 Subject: [PATCH] Fix collada parser fails on Mixamo exports --- code/AssetLib/Collada/ColladaParser.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/AssetLib/Collada/ColladaParser.cpp b/code/AssetLib/Collada/ColladaParser.cpp index 922d1f6b2..25034defb 100644 --- a/code/AssetLib/Collada/ColladaParser.cpp +++ b/code/AssetLib/Collada/ColladaParser.cpp @@ -1616,12 +1616,17 @@ void ColladaParser::ReadIndexData(XmlNode &node, Mesh &pMesh) { XmlParser::getValueAsString(currentNode, v); const char *content = v.c_str(); vcount.reserve(numPrimitives); + SkipSpacesAndLineEnd(&content); for (unsigned int a = 0; a < numPrimitives; a++) { if (*content == 0) { throw DeadlyImportError("Expected more values while reading contents."); } // read a number - vcount.push_back((size_t)strtoul10(content, &content)); + size_t valueRead = (size_t)strtoul10(content, &content); + if(valueRead == 0) { + printf("wohoo"); + } + vcount.push_back(valueRead); // skip whitespace after it SkipSpacesAndLineEnd(&content); }