Merge branch 'master' into gltf2-materials
commit
bfa33b50ad
|
@ -75,6 +75,10 @@ void ExportSceneCollada(const char* pFile, IOSystem* pIOSystem, const aiScene* p
|
||||||
|
|
||||||
// invoke the exporter
|
// invoke the exporter
|
||||||
ColladaExporter iDoTheExportThing( pScene, pIOSystem, path, file);
|
ColladaExporter iDoTheExportThing( pScene, pIOSystem, path, file);
|
||||||
|
|
||||||
|
if (iDoTheExportThing.mOutput.fail()) {
|
||||||
|
throw DeadlyExportError("output data creation failed. Most likely the file became too large: " + std::string(pFile));
|
||||||
|
}
|
||||||
|
|
||||||
// we're still here - export successfully completed. Write result to the given IOSYstem
|
// we're still here - export successfully completed. Write result to the given IOSYstem
|
||||||
std::unique_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
|
std::unique_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
|
||||||
|
@ -104,7 +108,7 @@ ColladaExporter::ColladaExporter( const aiScene* pScene, IOSystem* pIOSystem, co
|
||||||
// set up strings
|
// set up strings
|
||||||
endstr = "\n";
|
endstr = "\n";
|
||||||
|
|
||||||
// start writing
|
// start writing the file
|
||||||
WriteFile();
|
WriteFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,10 @@ void ExportSceneObj(const char* pFile,IOSystem* pIOSystem, const aiScene* pScene
|
||||||
// invoke the exporter
|
// invoke the exporter
|
||||||
ObjExporter exporter(pFile, pScene);
|
ObjExporter exporter(pFile, pScene);
|
||||||
|
|
||||||
|
if (exporter.mOutput.fail() || exporter.mOutputMat.fail()) {
|
||||||
|
throw DeadlyExportError("output data creation failed. Most likely the file became too large: " + std::string(pFile));
|
||||||
|
}
|
||||||
|
|
||||||
// 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
|
||||||
{
|
{
|
||||||
std::unique_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
|
std::unique_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
|
||||||
|
|
|
@ -475,7 +475,11 @@ void ObjFileParser::getFace( aiPrimitiveType type ) {
|
||||||
} else {
|
} else {
|
||||||
reportErrorTokenInFace();
|
reportErrorTokenInFace();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
//On error, std::atoi will return 0 which is not a valid value
|
||||||
|
throw DeadlyImportError("OBJ: Invalid face indice");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
m_DataIt += iStep;
|
m_DataIt += iStep;
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,6 +70,10 @@ void ExportScenePly(const char* pFile,IOSystem* pIOSystem, const aiScene* pScene
|
||||||
// invoke the exporter
|
// invoke the exporter
|
||||||
PlyExporter exporter(pFile, pScene);
|
PlyExporter exporter(pFile, pScene);
|
||||||
|
|
||||||
|
if (exporter.mOutput.fail()) {
|
||||||
|
throw DeadlyExportError("output data creation failed. Most likely the file became too large: " + std::string(pFile));
|
||||||
|
}
|
||||||
|
|
||||||
// we're still here - export successfully completed. Write the file.
|
// we're still here - export successfully completed. Write the file.
|
||||||
std::unique_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
|
std::unique_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
|
||||||
if(outfile == NULL) {
|
if(outfile == NULL) {
|
||||||
|
|
|
@ -62,6 +62,10 @@ void ExportSceneSTL(const char* pFile,IOSystem* pIOSystem, const aiScene* pScene
|
||||||
// invoke the exporter
|
// invoke the exporter
|
||||||
STLExporter exporter(pFile, pScene);
|
STLExporter exporter(pFile, pScene);
|
||||||
|
|
||||||
|
if (exporter.mOutput.fail()) {
|
||||||
|
throw DeadlyExportError("output data creation failed. Most likely the file became too large: " + std::string(pFile));
|
||||||
|
}
|
||||||
|
|
||||||
// we're still here - export successfully completed. Write the file.
|
// we're still here - export successfully completed. Write the file.
|
||||||
std::unique_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
|
std::unique_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
|
||||||
if(outfile == NULL) {
|
if(outfile == NULL) {
|
||||||
|
@ -75,6 +79,10 @@ void ExportSceneSTLBinary(const char* pFile,IOSystem* pIOSystem, const aiScene*
|
||||||
// invoke the exporter
|
// invoke the exporter
|
||||||
STLExporter exporter(pFile, pScene, true);
|
STLExporter exporter(pFile, pScene, true);
|
||||||
|
|
||||||
|
if (exporter.mOutput.fail()) {
|
||||||
|
throw DeadlyExportError("output data creation failed. Most likely the file became too large: " + std::string(pFile));
|
||||||
|
}
|
||||||
|
|
||||||
// we're still here - export successfully completed. Write the file.
|
// we're still here - export successfully completed. Write the file.
|
||||||
std::unique_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wb"));
|
std::unique_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wb"));
|
||||||
if(outfile == NULL) {
|
if(outfile == NULL) {
|
||||||
|
|
|
@ -80,6 +80,10 @@ void ExportSceneXFile(const char* pFile,IOSystem* pIOSystem, const aiScene* pSce
|
||||||
// invoke the exporter
|
// invoke the exporter
|
||||||
XFileExporter iDoTheExportThing( pScene, pIOSystem, path, file, &props);
|
XFileExporter iDoTheExportThing( pScene, pIOSystem, path, file, &props);
|
||||||
|
|
||||||
|
if (iDoTheExportThing.mOutput.fail()) {
|
||||||
|
throw DeadlyExportError("output data creation failed. Most likely the file became too large: " + std::string(pFile));
|
||||||
|
}
|
||||||
|
|
||||||
// we're still here - export successfully completed. Write result to the given IOSYstem
|
// we're still here - export successfully completed. Write result to the given IOSYstem
|
||||||
std::unique_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
|
std::unique_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
|
||||||
if(outfile == NULL) {
|
if(outfile == NULL) {
|
||||||
|
|
Loading…
Reference in New Issue