Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to specify extension when the extension is not part of the url #202

Closed
agusmdev opened this issue Jan 10, 2022 · 3 comments
Closed

Comments

@agusmdev
Copy link

Hi, I'm trying to render .gltf objects from ipfs, but the engine can't process the file. Although it can process exactly the same file from another source:
E.g:
it works correctly here: https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/DamagedHelmet/glTF-Embedded/DamagedHelmet.gltf
it doesn't work here: https://ipfs.io/ipfs/QmVzbVRXNr46NRhkjifUjxGj9KcfXUiMYvHTxYcW2h74A4
But when I get those links from the browser, both are exactly the same.

P.S: I don't think this is a CORS issue

@agusmdev
Copy link
Author

Well I figured it out, it is an extension problem, the engine does not know how to read my file since the filename/extension is not in the URL, to solve this I hardcoded "gltf" as a default value when it can't infer the extension, but it could be great to somehow have the option for sending the extension before rendering the object

@kovacsv kovacsv changed the title Render from url with the same content doesn't work both the same Ability to specify extension when the extension is not part of the url Jan 10, 2022
@ahmedsadman
Copy link

Hello @kovacsv, for production use cases, it's not always possible to have the extension in the download file URL. I have a project where we're trying to use this library and this is a major obstacle. We can have another variant for LoadModelFromUrl where we can specify the extension alongside the model URL. If possible, please look into this with a higher priority. Thank you.

@kovacsv
Copy link
Owner

kovacsv commented Jun 6, 2022

From the next release it will be possible to provide file names along with urls:

let inputFiles = [
    new OV.InputFile ('hundred_cubes.obj', OV.FileSource.Url, '../../test/testfiles/obj/hundred_cubes_noext_obj'),
    new OV.InputFile ('hundred_cubes.mtl', OV.FileSource.Url, '../../test/testfiles/obj/hundred_cubes_noext_mtl')
];
viewer.LoadModelFromInputFiles (inputFiles);

@kovacsv kovacsv closed this as completed Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants