I submitted a fix to osg-submissions. Diff (against trunk) is below for anyone who wants it now.

Steve

===================================================================
--- src/osgPlugins/dae/ReaderWriterDAE.cpp    (revision 8313)
+++ src/osgPlugins/dae/ReaderWriterDAE.cpp    (working copy)
@@ -167,15 +167,7 @@

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


[EMAIL PROTECTED] wrote:
Actually I can reproduce this now. I just wasn't calling it the same way you guys were. I was giving the output file a full path, and in that case the conversion works.

This is likely a simple error in the way the plugin converts URIs to file paths (which, incidentally, doesn't need to be done for the DAE load/save functions anymore). I'll see if I can take a look sometime today. In the meantime, giving the output file a full path should allow the conversion to go through, though as I mentioned, nothing shows up in the viewer when I try to load cessna.dae.

Steve

[EMAIL PROTECTED] wrote:
I just tried this and I didn't have any problems. I'm on Ubuntu Gutsy. Here's (roughly) what I did.

# DOM setup
sudo aptitude install libxml2-dev libpcre3-dev libboost-filesystem-dev
svn co dom
make
sudo make install

# OSG setup
sudo aptitude install cmake
svn co osg-trunk
svn co osg-data-trunk
cmake .
make
sudo make install
OSG_FILE_PATH=...
osgconv cessna.osg ~/models/cessna.dae

I got no errors when building or running osgconv, but when I open it with osgviewer nothing shows up. Other models, like the DOM test file cube.dae or cow.osg converted to Collada via osgconv, seem to load ok (not totally correct: materials are busted on the cow, but the geometry looks right).

The only difference I can see is that I'm running with the DOM trunk, not 2.1. I don't believe I've made any code changes since the 2.1 release, but I'll try against with 2.1 just to be sure.

I'm still hoping to get the Windows build of the Collada plugin working, and test on Mac also.

Steve

Robert Osfield wrote:
HI Valery,

On Sat, May 10, 2008 at 12:48 PM, Валерий Быков <[EMAIL PROTECTED]> wrote:
For your information writer plugin for dae doesn't work at all:


osgconv cessna.osg cessna.dae
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".

Thanks for the notification, I've just tried this and got exactly the
same error.  Clearly something's broke with the migration to DOM 2.x.
So little has changed in the dae plugin I kinda suprised, perhaps the
dom itself is responsible.

Robert.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to