|
@@ -59,10 +59,16 @@ void ExportSceneObj(const char* pFile,IOSystem* pIOSystem, const aiScene* pScene
|
|
// we're still here - export successfully completed. Write both the main OBJ file and the material script
|
|
// we're still here - export successfully completed. Write both the main OBJ file and the material script
|
|
{
|
|
{
|
|
boost::scoped_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
|
|
boost::scoped_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
|
|
|
|
+ if(outfile == NULL) {
|
|
|
|
+ throw DeadlyExportError("could not open output .obj file: " + std::string(pFile));
|
|
|
|
+ }
|
|
outfile->Write( exporter.mOutput.str().c_str(), static_cast<size_t>(exporter.mOutput.tellp()),1);
|
|
outfile->Write( exporter.mOutput.str().c_str(), static_cast<size_t>(exporter.mOutput.tellp()),1);
|
|
}
|
|
}
|
|
{
|
|
{
|
|
boost::scoped_ptr<IOStream> outfile (pIOSystem->Open(exporter.GetMaterialLibFileName(),"wt"));
|
|
boost::scoped_ptr<IOStream> outfile (pIOSystem->Open(exporter.GetMaterialLibFileName(),"wt"));
|
|
|
|
+ if(outfile == NULL) {
|
|
|
|
+ throw DeadlyExportError("could not open output .mtl file: " + std::string(exporter.GetMaterialLibFileName()));
|
|
|
|
+ }
|
|
outfile->Write( exporter.mOutputMat.str().c_str(), static_cast<size_t>(exporter.mOutputMat.tellp()),1);
|
|
outfile->Write( exporter.mOutputMat.str().c_str(), static_cast<size_t>(exporter.mOutputMat.tellp()),1);
|
|
}
|
|
}
|
|
}
|
|
}
|