diff --git a/src/osgPlugins/dae/daeWMaterials.cpp b/src/osgPlugins/dae/daeWMaterials.cpp index 62887c595..c65be9b8b 100644 --- a/src/osgPlugins/dae/daeWMaterials.cpp +++ b/src/osgPlugins/dae/daeWMaterials.cpp @@ -99,7 +99,8 @@ void daeWriter::processMaterial( osg::StateSet *ss, domInstance_geometry *ig, co osg::Image *osgimg = tex->getImage( 0 ); domImage::domInit_from *imgif = daeSafeCast< domImage::domInit_from >( img->createAndPlace( "init_from" ) ); std::string fileURI = ReaderWriterDAE::ConvertFilePathToColladaCompatibleURI(osgDB::findDataFile(osgimg->getFileName())); - imgif->setValue(daeURI(fileURI.c_str())); + daeURI dd( fileURI.c_str() ); + imgif->setValue( dd ); // The document URI should contain the canonical path it was created with imgif->getValue().makeRelativeTo(doc->getDocumentURI());