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.
"
This commit is contained in:
Robert Osfield
2008-05-13 10:56:10 +00:00
parent c81b02bca4
commit f3d36055ef

View File

@@ -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);
}