JonVarner Posted November 3, 2018 Share Posted November 3, 2018 Hey all, I am working on a scene where, for optimization purposes only render when the camera is moving, or when an object is imported into the scene. However, for some reason the scene is rendering before the model is actually ready, which leads to a partially rendered object. What is the correct way to trigger a render once the model is actually imported and ready to go? My code: BABYLON.SceneLoader.ImportMesh('', 'assets/components/', path + '.babylon', scene, (newMeshes) => { self.__forceRender = true }) Quote Link to comment Share on other sites More sharing options...
JonVarner Posted November 4, 2018 Author Share Posted November 4, 2018 In the end I just ditched the Import mesh and used asset manager. Because I was loading things dynamically at different intervals, I had to use ".useDefaultLoadingScreen = false" so I did not get the preloader screen. But it seems to have solved my problem. Quote Link to comment Share on other sites More sharing options...
Guest Posted November 5, 2018 Share Posted November 5, 2018 Ok sounds good On the other end, you have this handy function: scene.executeWhenReady(function() {}) 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.