Vousk-prod. Posted August 5, 2014 Share Posted August 5, 2014 Yup everyone, Some little questions about proper scene management. 1. Is scene.executeWhenReady(callback) equivalent to something like "as soon as scene.isReady, call callback" ? 2. We can load complete scene or meshes[ ] from .babylon files withSceneLoader.Load(rootUrl, sceneFilename, engine, onsuccess, progressCallBack, onerror)SceneLoader.ImportMesh(meshesNames, rootUrl, sceneFilename, scene, onsuccess, progressCallBack, onerror) Both methods have that great onsuccess callback. The loading is processed in a parallel thread, and it sounds like onsuccess is called only when the scene/meshes[ ] is fully loaded. But when I put this for my onsuccess callback :function (scene -or meshes, particles, skeletons- ) { scene.executeWhenReady( function() { ... do some init operations on meshes, like changing material etc... } );}Time tests show that the scene.executeWhenReady is sent later than the onsuccess, as if it is waiting for some more stuff to load. What the onsuccess and executeWhenReady callbacks are respectively waiting for ? Quote Link to comment Share on other sites More sharing options...
burbonvagin Posted August 5, 2014 Share Posted August 5, 2014 about two thirds of the way down http://blogs.msdn.com/b/eternalcoding/archive/2013/06/28/babylon-js-how-to-load-a-babylon-file-produced-with-blender.aspx in a code comment it says that scene.executeWhenReady waits "for textures and shaders to be ready". Maybe images haven't been loaded yet or maybe the textures and shaders just need to be prepared. 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.