Hijack is such a harsh word…
The secret here would be to either override the
reload function of the file loader (the quick and dirty js way), or extend the fileinput class (the cleaner typescript version).
All in all, the reload function is what you are looking for. when this function executes, the fiel loader will have the internal variable
this._sceneFileToLoad which will contain the main scene file (File object) that was dropped. attention, this is a private variable, so if you extend the class you will need to be creative about how to get it. The best (and only) way I see is to send onReloadCallback to super during construction, and storing it when this executes.
Define a onReloadCallback during construction of the FileInput class, you will get a File object with which you can work. just do whatever you want with the File. The fileLoader is using
SceneLoader.LoadAsync, but you can use whatever you see fit.
The assets manager’s mesh loading task takes only
string as sceneFileName, but it can also be a File, from the way it is used.
I will change the signature of the mesh asset task, in case you want to use it with typescript