From 04b0883a3141241f6ddb4508eae25b34a173e6b7 Mon Sep 17 00:00:00 2001 From: Areloch Date: Fri, 19 Nov 2021 23:14:06 -0600 Subject: [PATCH] Assimp checks against lowercase extensions, so we force the extension of the file to lower before fetching the importer. Also adds sanity check that the importer was actually found before we try and use it. --- Engine/source/ts/assimp/assimpShapeLoader.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Engine/source/ts/assimp/assimpShapeLoader.cpp b/Engine/source/ts/assimp/assimpShapeLoader.cpp index f0dbd509e..0ffa6bd11 100644 --- a/Engine/source/ts/assimp/assimpShapeLoader.cpp +++ b/Engine/source/ts/assimp/assimpShapeLoader.cpp @@ -178,8 +178,9 @@ void AssimpShapeLoader::enumerateScene() // Setup default units for shape format String importFormat; - const aiImporterDesc* importerDescription = aiGetImporterDesc(shapePath.getExtension().c_str()); - if (StringTable->insert(importerDescription->mName) == StringTable->insert("Autodesk FBX Importer")) + String fileExt = String::ToLower(shapePath.getExtension()); + const aiImporterDesc* importerDescription = aiGetImporterDesc(fileExt.c_str()); + if (importerDescription && StringTable->insert(importerDescription->mName) == StringTable->insert("Autodesk FBX Importer")) { ColladaUtils::getOptions().formatScaleFactor = 0.01f; }