The current implementation of the Collada writer sometimes generates <init_from> elements on Windows that look like this.

 

 <init_from>../../../../C:/Environ%20Project/environ/TerrainData/vtp-apps-data-and-plantlib/BuildingModels/cement_block1_256.jpg</init_from>

 

If you try to reimport this file then the texture image is not found due to the fact that this is an invalid file name as far as windows is concerned.

 

The problem is cause by the following call

 

        imgif->getValue().makeRelativeTo( doc->getDocumentURI() );

 

Where the image URI looks like this

 

“file:///C:/Environ Project/environ/TerrainData/vtp-apps-data-and-plantlib/BuildingModels/cement_block1_256.jpg”

 

and the document URI

 

file:///c:/temp/colladatest/models/brantholme.dae

 

Notice that drive letter parts of the URI are different case.

 

The problem appears to be that the makeRelativeTo method does a case sensitive comparison of the path segments. Windows paths are case insensitive.

 

I suggest that the safest place were we can make assumptions about the platform we are running on is in the plugin code itself not in the Collada dae.

 

So on windows maybe we should force the image URI to lower case and make a temporary lower case copy of the Document URI before calling the make relative method.

 

I don’t know if this is the only place we are going to run into this kind of problem.

 

Comments anyone?

 

Roger

 

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to