Changeset 8314

Show
Ignore:
Timestamp:
05/13/08 12:56:10
Author:
robert
Message:

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.
"

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • OpenSceneGraph/trunk/src/osgPlugins/dae/ReaderWriterDAE.cpp

    r7664 r8314  
    168168std::string ReaderWriterDAE::ConvertFilePathToColladaCompatibleURI(const std::string& FilePath) 
    169169{ 
    170     std::string fileURI = osgDB::convertFileNameToUnixStyle(osgDB::getRealPath(FilePath)); 
    171     // fileURI should now contain a canonical absolute path name with UNIX style component separators 
    172 #if defined(WIN32)  && !defined(__CYGWIN__) 
    173     // Check for windows drive designator or UNC path 
    174     if ((fileURI[1] == ':') || ((fileURI[0] == '/') && (fileURI[1] == '/'))) 
    175         fileURI.insert(0, 1, '/'); 
    176 #endif 
    177     fileURI.insert(0, "file://"); 
    178     return fileURI; 
     170    return cdom::nativePathToUri(FilePath); 
    179171} 
    180172