Merge branch 'master' into fix/multibody-binary-stls

pull/1602/head
Kim Kulling 2017-11-30 00:28:59 +01:00 committed by GitHub
commit 9be69a90b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View File

@ -516,7 +516,9 @@ aiNode* ImportNode(aiScene* pScene, glTF2::Asset& r, std::vector<unsigned int>&
{
Node& node = *ptr;
aiNode* ainode = new aiNode(node.name);
std::string nameOrId = node.name.empty() ? node.id : node.name;
aiNode* ainode = new aiNode(nameOrId);
if (!node.children.empty()) {
ainode->mNumChildren = unsigned(node.children.size());

View File

@ -56,6 +56,12 @@ public:
return nullptr != scene;
}
virtual bool binaryImporterTest() {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile( ASSIMP_TEST_MODELS_DIR "/glTF2/2CylinderEngine-glTF-Binary/2CylinderEngine.glb", aiProcess_ValidateDataStructure);
return nullptr != scene;
}
#ifndef ASSIMP_BUILD_NO_EXPORT
virtual bool exporterTest() {
Assimp::Importer importer;
@ -74,6 +80,10 @@ TEST_F( utglTF2ImportExport, importglTF2FromFileTest ) {
EXPECT_TRUE( importerTest() );
}
TEST_F( utglTF2ImportExport, importBinaryglTF2FromFileTest ) {
EXPECT_TRUE( binaryImporterTest() );
}
#ifndef ASSIMP_BUILD_NO_EXPORT
TEST_F( utglTF2ImportExport, exportglTF2FromFileTest ) {
EXPECT_TRUE( exporterTest() );