Ran into a problem where models made on a Windows box didn't work on a
Linux box because the modeler had stored texture filenames in the file in
one case "foo.jpg" and the actual image file was a different case "foo.JPG".

Obviously the solution is to fix the model, but unfortunately, I am dealt
the task of dealing with clueless modelers and yet-unborn clueless models
in the wild.

I believe I could rig some code to, in the event of a failure to locate a
file, get a directory listing of each osgDB search path, and attempt a
case-insensitive string compare looking for a file that matches, and then
load that.

My questions are:

Is there a better way to do this or away to do this already?

Is there an osgDB callback that I could hook into that would let me make
one last-ditch effort at finding a file before osgDB gives up?

I suspect I'd have to use something like BOOST::filesystem to do the
directory listing in a portable manner, which means this would be code that
couldn't be in core OSG (because of BOOST), hence the callback. If there's
a better way to do this within core OSG, and it would be a welcomed
submission, I'd be happy to do it that way too. Obviously it would have to
be an optional behavior since not everybody on Linux/OSX wants artificial
case insensitivity.

-- 
Chris 'Xenon' Hanson, omo sanza lettere. [email protected]
http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 •
GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio •
LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to