How do you get the state when the model is fully loaded


modelStructureLoadEnd has been deprecated, what is the way to know when the model is loaded?

Because the model might be streaming interactively and some data might be left on the server, it is not always clear what “fully loaded” means. The `modelStructureReady’ callback lets you know that the model structure data is fully loaded and the model can be interacted with and queried. You can also use the function below to determine if the viewer has reached an idle state, which generally means that loading has ended.

await hwv.waitForIdle();

1 Like

My goal is actually to know and print the load time of the model. Is there any way to get the complete load time of the model directly?
Currently, I found that the streamingDeactivated callback function triggered twice, once before and once after model loading. I printed the interval between the two times through console.time(). Can this time be regarded as the complete loading time of the model?

Yes, that should largely work with the caveat that because streaming has stopped does not necessarily mean that the model is fully on the client. Alternatively can start the timer in the sceneReady callback and then stop it after the waitForIdle promise has been fulfilled.


Ok, thanks for your reply