zeux / meshoptimizer

Mesh optimization library that makes meshes smaller and faster to render
MIT License
5.61k stars 480 forks source link

Do not use absolute paths to the textures #117

Closed serhii-rieznik closed 4 years ago

serhii-rieznik commented 4 years ago

Minor usability note:

I think it would be a good idea to not use absolute paths to the textures in the output gltf files. Or at least have an option for that.

zeux commented 4 years ago

While I agree with this statement, I'm not sure I understand this :) gltfpack currently preserves texture paths, are you saying that if the input paths are absolute, the output paths should be relative?

serhii-rieznik commented 4 years ago

Well, probably there should be an option for that - to convert absolute paths to relative. I'd say this can save a lot of time for artists and other people. Because "it is working on my computer", but when I upload model - paths (from my laptop) could not be found.

zeux commented 4 years ago

Any chance you have an example of a model with absolute paths to make sure the fix for this issue properly addresses it?

zeux commented 4 years ago

I don't want to blindly fix this issue without examples, because the specific semantics of encoding absolute paths in glTF URIs is unclear to me (glTF spec doesn't require support for absolute paths either). I tried to find a tool that exports absolute paths but Blender doesn't do that and Substance Painter doesn't do that either. So I'm going to close this for now; feel free to reopen it with example files and the software that produced that.

serhii-rieznik commented 4 years ago

Sorry, I missed your previous comment.

I think preserving path is completely valid behaviour. Nothing should be changed actually.

zeux commented 4 years ago

Thanks!