How can I determine when a model loaded via the Entity API has finished loading?


I am working with Cesium and loading a GLB model using the Entity API. Since the model resource is hosted online, the downloading and loading can take some time. I have subsequent operations that depend on the model being fully loaded, and hence, I need to ascertain the exact moment when the model has been fully loaded into the scene.

I have explored the following approaches:

  1. Polling certain attributes of the Entity, such as position. However, I realized this isn’t a reliable indicator, as the position attribute might be set even before the model is actually rendered.
  2. Using the Primitive API since it offers the readyPromise. But I’m more inclined to stick with the Entity API as I have already written a substantial amount of code based on it. Transitioning to the Primitive API would require significant refactoring, which is not only inconvenient but could also introduce new challenges.
  3. Manual, visual confirmation, but this isn’t an automated solution.

My question is: Is there a way (perhaps an event, flag, or another method) to determine when a model loaded via the Entity API has fully loaded? Or are there recommended approaches to handle this asynchronous loading scenario?

Thank you for your assistance!