Receive all `onProgress` events from asset loading

In my app, I’m changing individual parts of the scene pretty often and interactively, often loading them on demand. Until recently, I’ve used to track Babylon’s loading progress globally by monkey-patching FileTools.RequestFile:

import { FileTools } from '@babylonjs/core/Misc/fileTools';

FileTools.RequestFile = () => {...}

Since 5.0 this is not possible anymore, because RequestFile is not namespaced in 5.0.

Is there any other way to avoid adding onProgress handlers everywhere?

would scene._requestFile despite being private fit your needs ?

That’s a good pointer, thanks! I’ll probably have to monkey-patch scene._loadFile too, but this might be a proper way.

Let me know if that works and we ll try to make it a more official feature.

1 Like

Hi @rassie just checking in how are things? Would you like any more help?

@carolhmj I’m sorry, I haven’t got around to actually implementing this. I’m about 90% certain it will work as desired, but have no proof yet.

1 Like