drydart / model_viewer.dart

A Flutter widget for rendering interactive 3D models in the glTF and GLB formats.
https://pub.dev/packages/model_viewer
The Unlicense
209 stars 101 forks source link

ModelViewer failed to load model URL #3

Closed Olega95 closed 4 years ago

Olega95 commented 4 years ago

Hey. Please tell me what the problem is. When I load a model from an example, it displays normally. And when I upload the model to my server, it does not load. Flutter writes an error: I / flutter (25631): >>>>>>>>>>>>>>>>>> ModelViewer failed to load: Instance of 'WebResourceError' Please, help me!

artob commented 4 years ago

This may be a CORS issue. Would you be able to share your model URL? (You could email it to me at arto@bendiken.net if it isn't public.)

artob commented 4 years ago

Please try again with the latest 0.8.0 release. I was able to successfully load & render your model from your calculator project.

In case you are unable to load some model URL, check that the HTTP server in question is outputting a correct CORS Access-Control-Allow-Origin: * header, as GitHub Pages does:

$ curl -sI https://olega95.github.io/calculator1/m1.glb | fgrep -i access-control-allow-origin
access-control-allow-origin: *

Find some more troubleshooting information in the FAQ.