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

two cubes, one loads, one does not. #141

Closed
anupamdas2012 opened this issue Feb 19, 2021 · 4 comments
Closed

two cubes, one loads, one does not. #141

anupamdas2012 opened this issue Feb 19, 2021 · 4 comments

Comments

@anupamdas2012
Copy link

Hi, Im experiencing a very strange issue. I have two cubes which are identical loaded to a storage endpoint (firebase). one loads properly,
the other gives me a JSON error. Any insight would be helpful as this one is stumping me.

//this one loads
https://firebasestorage.googleapis.com/v0/b/xrviewprototype.appspot.com/o/models%2F-MNBhmCn3c-CzHgBYvJE%2FBox.glb?alt=media&token=5b6b152f-3497-4768-bcbe-d1b4dde858b7

//this one does not load and gives me a json parse error
https://firebasestorage.googleapis.com/v0/b/xrviewprototype.appspot.com/o/models%2F-MTssfZoHm4VBjGd_pfl%2FBox_test.glb?alt=media&token=42d7d0ae-bd6e-49c1-bf34-fb4eac82e072

//here are the details

argumentException: JSON parse error: Invalid value.
UnityEngine.JsonUtility.FromJson (System.String json, System.Type type) (at /Users/builduser/buildslave/unity/build/Modules/JSONSerialize/Public/JsonUtility.bindings.cs:42)
UnityEngine.JsonUtility.FromJson[T] (System.String json) (at /Users/builduser/buildslave/unity/build/Modules/JSONSerialize/Public/JsonUtility.bindings.cs:30)
GLTFast.GLTFast.ParseJson (System.String json) (at Library/PackageCache/[email protected]/Runtime/Scripts/GltFast.cs:345)
GLTFast.GLTFast+d__55.MoveNext () (at Library/PackageCache/[email protected]/Runtime/Scripts/GltFast.cs:297)
--- End of stack trace from previous location where exception was thrown ---

@anupamdas2012
Copy link
Author

also note that both of these load just fine on web, I have tested this using the babylonjs gltf sandbox with no issues.

@anupamdas2012
Copy link
Author

im wondering if the content-type is wrong in the header? looks like the glb that works has a content type: model/gltf+json where as the one that does not work is application/octet-stream. I feel like an older version of gltfast did not care about this and so it just worked, but could be wrong. If it is a header issue, then the problem is obviously with the way im uploading the model to my storage service.

@anupamdas2012
Copy link
Author

Hi, quick update. I have fixed the file metadata issue on my storage endpoint, but still getting the same result. Not sure where exactly this is breaking at this point.

@atteneder
Copy link
Owner

Hi @anupamdas2012 ,

Thanks for the report. You're right suspecting the content-type.

The first link returns content-type application/octet-stream, which is ignored and then the type (glb or gltf) is derived from the file extension correctly.

The second link returns content-type model/gltf+json, which is incorrect. glTF-binary should have content-type model/gltf-binary.

If you configure your server this way, it should work.

hth

atteneder added a commit that referenced this issue May 27, 2024
* feat: AddScene overload that accepts a scene origin transformation matrix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants