Hagop Posted March 14, 2018 Share Posted March 14, 2018 Dear all Maybe this is a dummy question, but I couldn't figure out a workaround solution. I have created a scene using the standard var createScene = function() {}, after which I make MULTIPLE calls to import meshes BABYLON.SceneLoader.ImportMesh(). I try to display the Preloading screen using the following code var renderFunction = function () { if (scene) { var remaining = scene.getWaitingItemsCount(); if (remaining !=0) { engine.displayLoadingUI(); engine.loadingUIBackgroundColor = "green"; engine.loadingUIText = "Please Wait, An Incredible 3D Online Shopping Experience is Streaming: " + (remaining ? (remaining + " items remaining") : ""); } else if (remaining ==0) { engine.hideLoadingUI(); } scene.render(); } }; engine.runRenderLoop(renderFunction); The problme is that scene.getWaitingItemsCount() fluctuates, it decreases than increases, then decreases until it gets to zero. Is there a way for Counting to wait for ALL meshes/textures to QUEUE before it fires? Quote Link to comment Share on other sites More sharing options...
Guest Posted March 14, 2018 Share Posted March 14, 2018 Unfortunately no as the loader will add items while loading (like discovering a new texture that needs to be loaded) Quote Link to comment Share on other sites More sharing options...
Hagop Posted March 14, 2018 Author Share Posted March 14, 2018 OK, I see, however is there a way where we can restrict counting to a single BABYLON.SceneLoader.ImportMesh() call and discard the rest of the calls? Quote Link to comment Share on other sites More sharing options...
Guest Posted March 15, 2018 Share Posted March 15, 2018 There is no such a way to restrict to a single call unfortunately Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.