Browse Source

fix fbx importer lookup for setting formatScaleFactor

AzaezelX 3 years ago
parent
commit
f9496559c9
1 changed files with 4 additions and 4 deletions
  1. 4 4
      Engine/source/ts/assimp/assimpShapeLoader.cpp

+ 4 - 4
Engine/source/ts/assimp/assimpShapeLoader.cpp

@@ -177,11 +177,11 @@ void AssimpShapeLoader::enumerateScene()
 
       // Setup default units for shape format
       String importFormat;
-      if (getMetaString("SourceAsset_Format", importFormat))
+
+      const aiImporterDesc* importerDescription = aiGetImporterDesc(shapePath.getExtension().c_str());
+      if (importerDescription->mName == "Autodesk FBX Importer")
       {
-         // FBX uses cm as standard unit, so convert to meters
-         if (importFormat.equal("Autodesk FBX Importer", String::NoCase))
-            ColladaUtils::getOptions().formatScaleFactor = 0.01f;
+         ColladaUtils::getOptions().formatScaleFactor = 0.01f;
       }
 
       // Set import options (if they are not set to override)