Jump to content

Is it possible to stop the manifest error?


joshcamas
 Share

Recommended Posts

Hey guys! Another question from Josh!

 

Now that my project is getting bigger, something is getting very annoying. This guy:

 

GET localhost/unsinkable/assets/meshes/player/man3.babylon.manifest?1427843823831 404 (Not Found)
babylon-alpha.js:3 BJS - [16:17:03]: Valid manifest file not found. Scene & textures will be loaded directly from the web server.
 
Now, I know that this isn't bad. However, since I do not want to have any manifest files, and for most meshes I will never want it, is it possible to turn this warning off? Even better, to turn off the check, so the GET error isn't shown? Cause I have many many many meshes, and it's making the console worthless!
 
Thanks!!
Link to comment
Share on other sites

Hi Josh,

The error comes from the browser itself and not from babylon. To check that the file exists you have to make a request and see if it was sent back or is 404. This cannot be turned off. More about it here - http://stackoverflow.com/questions/16372271/jquery-ajax-how-to-prevent-404-errors-spam-in-chrome-devtools/16379746#16379746

But, you can simply log differently. The browser lets you filter the messages you are seeing, so just ignore those errors. Sadly no other suggestion is easily implemented. Another solution would be a new LoadWithoutManifest function, or a new flag in the current load or append function, but that's a bit more work :-)

Link to comment
Share on other sites

Hi,

 

 I can add a boolean to the engine asking to avoid checking for manifest file in order to always work with the assets from the web server. Need to discuss that with the team.

 

Bye,

 

David

 

It would be a great idea this. I also wish I could avoided this error

Link to comment
Share on other sites

  • 6 months later...

Hi,

 

 To disable manifest check, simply set the boolean enableOfflineSupport to false on the BABYLON.Engine object. I think I'll set it by default to false in next versions as we have this question very often on the failing XHR. People will have to set it to true to use .manifest and indexeddb.

 

 What do you think?

 

Bye,

 

David

Link to comment
Share on other sites

Everything is explained here : http://doc.babylonjs.com/page.php?p=22231

 

Basically, the manifest is very useful is you want to cache your 3D models in the client browser cache.

Why would that tiny piece of information require a separate file and thus request? Couldn't it just be stored in the .babylon file itself or configurable in the ImportMesh() function?

Link to comment
Share on other sites

Well, because if you'd like to handle cache ressources, you don't want to download the whole file to discover you'd just like to update or use the cache.

 

Imagine the following scenario using embedded info:

 

1 - you're download the .babylon file and it contains cache data indicating I should keep it offline (in IDB)

2 - next time you're loading the scene, it comes from the IDB / cache

3 - you'd like to update something in the scene (meshes or textures). How do you say that to Babylon?

 

If I need to redownload everytime the complete .babylon to check for updates, there's no interest to keep the file offline.

 

David

Link to comment
Share on other sites

To those who would like babylon to stop calling for manifest - 

 

modify Database.prototype.checkManifestFile function, so it starts like this:

 

     
   Database.prototype.checkManifestFile = function () {            var _this = this;            var that = this;            function noManifestFile() {                that.enableSceneOffline = false;                that.enableTexturesOffline = false;                that.callbackManifestChecked(false);            }            noManifestFile(); // those 2 lines disable calling for Manifest            return; // those 2 lines disable calling for Manifest

Didn't look what those functions inside noManifestFile() do, but they were called after failure of downloading manifest - so I put them before this call happens and do the return.

 

I understand manifest file is somehow used for caching, but should't it be rather deifned by some param? I really don't get this external-file-approach  ;)

Link to comment
Share on other sites

I understand manifest file is somehow used for caching, but should't it be rather deifned by some param? I really don't get this external-file-approach  ;)

 

The manifest tells the browser to cache or not. If it exists, then it caches the the scene. Also, it is a seprate file to control resyncing the cache with version number. Saves having to have the user manually flushing their cache or having to use URL tricks to force a flush and recache on load. You just change the vesion number in your manifest file and it handles it.

Link to comment
Share on other sites

  • 4 months later...

Like the flexibility of caching that it offers, but as the number of model files increases, it seems like a pain to create empty manifest files, just to avoid the warning. If there's any way the browser warning can be avoided, but still honor the manifest caching directives when it does exist, that would be the best of both worlds.

Link to comment
Share on other sites

  • 5 months later...

The link to the docs describing the file has been updated. It is http://doc.babylonjs.com/tutorials/Caching_Resources_in_IndexedDB

It is a short description but in summary (at 29th August 2016) the manifest file should be called  NameOfYourScene.babylon.manifest (well, you can get the name from your 404 error message)

And the contents can be

{
  "version" : 1,
  "enableSceneOffline" : true,
  "enableTexturesOffline" : true
}

Then the scene and texture* data will be saved in each user's browser storage. See the docs for details about storing textures offline.

Link to comment
Share on other sites

  • 10 months later...
Quote

To disable manifest check, simply set the boolean enableOfflineSupport to false on the BABYLON.Engine object. I think I'll set it by default to false in next versions as we have this question very often on the failing XHR. People will have to set it to true to use .manifest and indexeddb.

It looks as if this still defaults to true.

I set it to false and babylon no longer checks for the manifest (and gets rid of the 404 error). But is there a way to do this case by case? Some assets I'd like to cache, others come out of a database hosted on cloudfront and so it's not practical to create a .manifest for each file. 

Link to comment
Share on other sites

  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...