Is it possible to use the ReadyPromise with a ModelGraphics? Ultimately, I am trying to set a model on an entity. This model needs to have some of its properties be of type TimeIntervalCollectionProperty. Therefor, I am using (new ModelGraphics()) to instantiate the model. However, I would like to draw a point or fallback billboard if the model fails to load, so I was hoping to have the ReadyPromise available, like it is in the standard "Model" object.
Is there any way to have both the properties implement the "Property" interface AND have the ReadyPromise callback when using models?
if (this.modelViz._modelHash[object.id]) {
Cesium.when(this.modelViz._modelHash[abject.id].modelPrimitive.readyPromise).then(function(model) {
model.activeAnimations.removeAll();
});
}
This is not a very clean way of accessing the Model, but it works.. (Until there is a better/supported way of accessing the Model from Entity/ModelGraphics.)
Hi Premkumar,
No, unfortunately I was pulled onto other priorities a few months ago and never got the chance to try out the solution. I still have this flagged as important so that I can go back and try it whenever I am freed up again.
By the way, I finally got back to this and was able to use your solution.
However, I had to put it in a timeout as modelHash wasn't immediately available. In addition, I looped through the visualizers (instead of hard-coding "12" and checked for a ModelVisualizer in case they ever change the position.