Merge pull request #1766 from assimp/issue_774

closes https://github.com/assimp/assimp/issues/774: use correct type …
pull/1769/head
Kim Kulling 2018-02-04 19:05:02 +01:00 committed by GitHub
commit 48d41b4bf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 5 deletions

View File

@ -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");

View File

@ -1022,8 +1022,8 @@ public:
fbx_simple_property(CoordAxisSign, int, 1)
fbx_simple_property(OriginalUpAxis, int, 0)
fbx_simple_property(OriginalUpAxisSign, int, 1)
fbx_simple_property(UnitScaleFactor, double, 1)
fbx_simple_property(OriginalUnitScaleFactor, double, 1)
fbx_simple_property(UnitScaleFactor, float, 1)
fbx_simple_property(OriginalUnitScaleFactor, float, 1)
fbx_simple_property(AmbientColor, aiVector3D, aiVector3D(0,0,0))
fbx_simple_property(DefaultCamera, std::string, "")

Binary file not shown.

View File

@ -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);
}