root->mMeshes[0] = 0;
// create a dummy material for the mesh
- pScene->mNumMaterials = 1;
- pScene->mMaterials = new aiMaterial*[1];
- pScene->mMaterials[0] = CreateMaterial();
+ if(pScene->mNumMaterials==0){
+ pScene->mNumMaterials = 1;
+ pScene->mMaterials = new aiMaterial*[1];
+ pScene->mMaterials[0] = CreateMaterial();
+ }
}
// ------------------------------------------------------------------------------------------------
{
ex = new Assimp::Exporter();
im = new Assimp::Importer();
-
}
virtual void TearDown()
// ------------------------------------------------------------------------------------------------
TEST_F(ColladaExportLight, testExportLight)
{
- const char* file = "cameraExp.dae";
+ const char* file = "lightsExp.dae";
const aiScene* pTest = im->ReadFile(ASSIMP_TEST_MODELS_DIR "/Collada/lights.dae",0);
ASSERT_TRUE(pTest!=NULL);
}
EXPECT_EQ(AI_SUCCESS,ex->Export(pTest,"collada",file));
- EXPECT_EQ(AI_SUCCESS,ex->Export(pTest,"collada","lightsExp.dae"));
const aiScene* imported = im->ReadFile(file,0);
EXPECT_NEAR(orig->mAngleInnerCone,read->mAngleInnerCone,0.001);
EXPECT_NEAR(orig->mAngleOuterCone,read->mAngleOuterCone,0.001);
}
+
delete [] origLights;
+
}