diff --git a/src/external/u3d/src/IDTF/Converter.cpp b/src/external/u3d/src/IDTF/Converter.cpp index bb8320a3d..72c829897 100644 --- a/src/external/u3d/src/IDTF/Converter.cpp +++ b/src/external/u3d/src/IDTF/Converter.cpp @@ -67,6 +67,7 @@ namespace IDTFConverter { bool IDTFToU3d( const std::string& inputFileName, const std::string& outputFileName, + int& resCode, int positionQuality) { const char* argv[] = { @@ -220,6 +221,7 @@ bool IDTFToU3d( IFXDEBUG_SHUTDOWN(); + resCode = result; return result == IFX_OK; } diff --git a/src/external/u3d/src/IDTF/Converter.h b/src/external/u3d/src/IDTF/Converter.h index 90e0c0a53..887176d44 100644 --- a/src/external/u3d/src/IDTF/Converter.h +++ b/src/external/u3d/src/IDTF/Converter.h @@ -22,9 +22,9 @@ namespace IDTFConverter { -bool IDTFToU3d( - const std::string &inputFileName, +bool IDTFToU3d(const std::string &inputFileName, const std::string &outputFileName, + int &resCode, int positionQuality = 500); } diff --git a/src/meshlabplugins/io_u3d/io_u3d.cpp b/src/meshlabplugins/io_u3d/io_u3d.cpp index 026c361c9..1dd209303 100644 --- a/src/meshlabplugins/io_u3d/io_u3d.cpp +++ b/src/meshlabplugins/io_u3d/io_u3d.cpp @@ -111,13 +111,11 @@ bool U3DIOPlugin::save( vcg::tri::io::ExporterIDTF::Save(m.cm,qPrintable(tmp),mask); //conversion from idtf to u3d - bool result = IDTFConverter::IDTFToU3d(tmp.toStdString(), filename, _param.positionQuality); + int resCode = 0; + bool result = IDTFConverter::IDTFToU3d(tmp.toStdString(), filename, resCode, _param.positionQuality); if(result==false) { - QMessageBox::warning( - parent, - tr("Saving Error"), - errorMsgFormat.arg(fileName, vcg::tri::io::ExporterU3D::ErrorMsg(!result))); + errorMessage = "Error saving " + QString::fromStdString(filename) + ": \n" + vcg::tri::io::ExporterU3D::ErrorMsg(resCode) + " (" + QString::number(resCode) + ")"; return false; }