Hi again,
Is it possible to run code after an NGL.Worker has finished running?
The example I have in mind is for adding a surface representation. I would like to show a preloader until the surface appears, so that the user knows that something is happening.
I tried using, e.g.:
var structureName = 'structureName';
this.stage.getComponentsByName(structureName).list[0].signals.representationAdded.add( function(repr) {
console.log('rep added.');
});
But it fires way before surface representations are generated.
All the best,
Harry
There is a general task counter available in the stage object.
stage.tasks.signals.countChanged.add(function(delta, count){
// count is > 0 when the surface is still being calculated or a file is loaded
});
Thank you :)
Most helpful comment
There is a general task counter available in the
stageobject.