archilogic-com / aframe-gblock

Aframe component loading models from poly.google.com (inofficial)
MIT License
68 stars 14 forks source link

Download URL does not always default to the same format #4

Closed deprecatedcoder closed 7 years ago

deprecatedcoder commented 7 years ago

Hey there @tomas-polach, thanks for the update to use the models from Poly. I discovered a problem with it while poking around though, so I thought I would let you know about it.

Using your codepen example, if I replace the gblock with this Pillow then it does not work.

I noticed that if I go to the download option on the page it returns a zipped OBJ file, but when going to the download URL you construct then it returns a glTF.

The model you used as an example yields an unzipped OBJ when getting it's download URL.

I tested this with a few others and the ones that are an OBJ load fine, while the ones that are a glTF do not.

I don't really know enough about the different formats to give any more thoughts on how to fix it, but figured the diagnosis might help. Thanks again for your work on this component. It really is super useful.

deprecatedcoder commented 7 years ago

Looked at this a little more tonight and it seems to stem from models where the model name is not explicitly "model", like the previous Pillow example which uses "pillow". It seemed to me like this might be a problem with the gblock update method, but I'm not familiar enough for it to be immediately apparent.

This Space Shuttle, which uses "SpaceShuttle(1)", even fails to load completely and throws the "Model not found" error, but that is because it has parens and this regex doesn't handle it.

tomas-polach commented 7 years ago

good catch! will fix.

thx for all the details. it helps with debugging

tomas-polach commented 7 years ago

i fixed the regex issue but some poly models were still not loading: turns out they are GLTF v2.

created new issue: #5

tomas-polach commented 7 years ago

@deprecatedcoder can you pls confirm if the updated code is working for you as expected? in combination with the resolved #5 space shuttle (GLTF v2) is loading alongside with GLTF v1 models for me :)

deprecatedcoder commented 7 years ago

Just threw everything I could at it and it loads them all now. Fix looks good. Thanks!

tomas-polach commented 7 years ago

thanks for testing! looking at the new issue now... :D