瀏覽代碼

closes https://github.com/assimp/assimp/issues/774: use correct type for unitscale in fbx.

Kim Kulling 7 年之前
父節點
當前提交
37d352622b
共有 2 個文件被更改,包括 5 次插入3 次删除
  1. 3 1
      code/FBXDocument.cpp
  2. 2 2
      test/unit/utFBXImporterExporter.cpp

+ 3 - 1
code/FBXDocument.cpp

@@ -351,7 +351,9 @@ void Document::ReadGlobalSettings()
         return;
     }
 
-    std::shared_ptr<const PropertyTable> props = GetPropertyTable(*this, "", *ehead, *ehead->Compound(), true);
+    std::shared_ptr<const PropertyTable> props = GetPropertyTable( *this, "", *ehead, *ehead->Compound(), true );
+
+    //double v = PropertyGet<float>( *props.get(), std::string("UnitScaleFactor"), 1.0 );
 
     if(!props) {
         DOMError("GlobalSettings dictionary contains no property table");

+ 2 - 2
test/unit/utFBXImporterExporter.cpp

@@ -101,12 +101,12 @@ TEST_F( utFBXImporterExporter, importPhongMaterial ) {
 
 TEST_F(utFBXImporterExporter, importUnitScaleFactor) {
     Assimp::Importer importer;
-    const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/FBX/spider.fbx", aiProcess_ValidateDataStructure);
+    const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/FBX/global_settings.fbx", aiProcess_ValidateDataStructure);
 
     EXPECT_NE(nullptr, scene);
     EXPECT_NE(nullptr, scene->mMetaData);
 
     double factor(0.0);
     scene->mMetaData->Get("UnitScaleFactor", factor);
-    EXPECT_DOUBLE_EQ(1.0, factor);
+    EXPECT_DOUBLE_EQ(500.0, factor);
 }