[osg-users] obj loader: map_* only reads last component

Bob Kuehne rpk at blue-newt.com
Wed Jul 23 13:26:56 PDT 2008


hi all,
i recently was working with some .obj files (and associated .mtl  
files) and ran into the problem where the loader would truncate only  
the last component of a filename containing spaces. so, for example,  
in the .mtl file would be an entry like:

  map_Kd my texture name.jpg

which is valid under many filesystems, however, the loader would  
truncate it to just 'name.jpg' and of course, not resolve that (or  
resolve a wrong texture).

so i did a little research, and the specifications for mtl seem to  
simply say that:

  map_Kd filename

is valid.

my question is to whomever wrote the mtl file parser - why are the  
filenames truncated? i'd say the should be stripped (ie, ' my file  
name.jpg  ' should resolve to 'my file name.jpg') but never only the  
last component used.

if that's the case, then i've got a patch ready to go.

anyone?
bob




More information about the osg-users mailing list