Jump to content

Loading babylonjs files offline


DezOnlyOne
 Share

Recommended Posts

In my application I have animation packages(babylon files) that are very large and take a while to download from the server. This download time is helped by using the enableSceneOffline and enableTexturesOffline in the manifest file, but we still have to deal with the initial load each time. 

Is there a way to load those so they are available in the background without having to render them on screen until we are ready for the user to interact with them? The load times are excessive for each package, but it would help if I could load a new babylon file to have it ready for when the user is done interacting with the first. 

 

 

Link to comment
Share on other sites

Hi,

 You can simply call BABYLON.SceneLoader.Load() in the background and don't do anything in the callback. If you've set a manifest + enabling offline on the engine (by default), our loader will download the scene & assets and store them in IDB. This will preload your scene thus.

Is this what you'd like to achieve?

Bye,

David

 

Link to comment
Share on other sites

4 hours ago, davrous said:

Yes, ImportMesh goes through the same IDB layer.

I tried to use the import mesh without a callback, and it still rendered the mesh on screen. I want to be able to load it into the IDB without rendering it on screen at all. 

I tried with the importMesh Skull example on babylonjs-playground

BABYLON.SceneLoader.ImportMesh("", "scenes/", "skull.babylon", scene);

I attached the example I downloaded and edited.  

skullTest.zip

Link to comment
Share on other sites

20 minutes ago, Dad72 said:

Why not load the model and make it invisible with visybility = false.

this way it is loaded and not rendering on the scene.

The babylon files I have are very large, and contain several thousand frames of animation. If I try to load them in that manner, I get an OOM error. I can only load these 1 at a time.

Link to comment
Share on other sites

1 hour ago, Temechon said:

I will try to clarify what I am doing. 

I have a hospital room where the room is loaded separately from what I am calling "animation packages". An animation package is simply a virtual patient mesh with several animations that a user will play at different times in a scenario. Each one of the animation packages are different, in that they contain different animations for different parts of a scenario. What I want to do is load animation package A, and while the user is working with package A, I want to be loading package B into the IDB so it is available when packageA is complete. I am not sure if making the package incremental will help all that much except for when the loading fails. What makes this issue worse is that the animation packages are well over 100MB, so I am getting OOM errors when trying to load multiple animation packages at the same time. A package needs to be completely flushed from the scene before a new one can be loaded dependably. 

Link to comment
Share on other sites

20 hours ago, Dad72 said:

Perhaps more assetManager would fit in this case.

http://doc.babylonjs.com/tutorials/How_to_use_AssetsManager

You will probably have to create your own function in more to get what you want to do.

 

The assets manager is a pretty cool, and will have a use sometime down the road for other projects, but for these particular files, I get an OOM crash from just adding the tasks to the AM. I don't even need to load anything. I have had this issue before. There is just too much animation in these files I suppose. 

Link to comment
Share on other sites

  • 2 weeks 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...