CesiumGS / obj2gltf

Convert OBJ assets to glTF
Apache License 2.0
1.7k stars 307 forks source link

Remove double quotes in the mtl and texture paths #297

Closed chetan-set closed 12 months ago

chetan-set commented 12 months ago

If the mtl and/or texture paths are enclosed in double-quotes, they will fail to be read.

For example, if within theobj file, the mtl path is defined as follows:

mtllib "OBJ - Berlin Bridge.mtl"

The mtl file will not be loaded because when we try to compare the extension of the file to confirm that it ends with .mtl, that fails because the last token is .mtl"

The same thing happens to texture files.

This pull request strips the mtl and texture file of its double quotes if they exists. If they don't , nothing happens.

There is at least one OBJ export tool (metashape from agisoft) that adds double quotes to filemanes that contains spaces in them.

This pull request sould fix this isse.

lilleyse commented 12 months ago

@chetan-set looks good. Could you update CHANGES.md?

chetan-set commented 12 months ago

Hi @lilleyse. Ok sure, I have added the change to Changes.md

lilleyse commented 12 months ago

Thanks @chetan-set