From f3d36055efa9aff4b10887241504526a99849e8c Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 13 May 2008 10:56:10 +0000 Subject: [PATCH] From Steven Thomas, "Subject: Collada fix There was a problem converting a file to Collada by using osgconv like this: osgconv file.osg file.dae You would get an error message: I/O error : Permission denied I/O error : Permission denied error : xmlNewTextWriterFilename : out of memory! Error: daeLIBXMLPlugin::write(file://cessna.dae) failed Warning: Error in writing to "cessna.dae". This was due to some bad URI processing code in the Collada plugin. The attached file fixes this by using the Collada DOM's URI processing functions. After this change the file will convert successfully in the local directory. " --- src/osgPlugins/dae/ReaderWriterDAE.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/osgPlugins/dae/ReaderWriterDAE.cpp b/src/osgPlugins/dae/ReaderWriterDAE.cpp index cc02af5b2..3af936d0a 100644 --- a/src/osgPlugins/dae/ReaderWriterDAE.cpp +++ b/src/osgPlugins/dae/ReaderWriterDAE.cpp @@ -167,15 +167,7 @@ ReaderWriterDAE::writeNode( const osg::Node& node, std::string ReaderWriterDAE::ConvertFilePathToColladaCompatibleURI(const std::string& FilePath) { - std::string fileURI = osgDB::convertFileNameToUnixStyle(osgDB::getRealPath(FilePath)); - // fileURI should now contain a canonical absolute path name with UNIX style component separators -#if defined(WIN32) && !defined(__CYGWIN__) - // Check for windows drive designator or UNC path - if ((fileURI[1] == ':') || ((fileURI[0] == '/') && (fileURI[1] == '/'))) - fileURI.insert(0, 1, '/'); -#endif - fileURI.insert(0, "file://"); - return fileURI; + return cdom::nativePathToUri(FilePath); }