Skip to content

Commit

Permalink
closes #774: use correct type for unitscale in fbx.
Browse files Browse the repository at this point in the history
  • Loading branch information
kimkulling committed Feb 4, 2018
1 parent 455ff4a commit 37d3526
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion code/FBXDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions test/unit/utFBXImporterExporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit 37d3526

Please sign in to comment.