Currently I have a fallback in my 3d model viewer for the web which loads a model from the url using GLTFLoader if there is a model with a file param there. The same model viewer also has a DropListener in it for drag/dropped models.
The issue I am finding is that dropped models using DropListener set up their animations correctly in this example
glb file:
Parent object (empty)
-Cube with animation
-another model with no animation
Loading this file with droplistener applies an Animator component to the cube with animation and it works correct
When I use a GLTFLoader to load the file from the url without droploader from the FTP server I use this code
loader.load(result, (gltf) => {
console.log(gltf);
this.scene.add(gltf.scene);
this.dispatchEvent(
new CustomEvent(LoaderFixerListenerEvents.ObjectAdded, { detail: gltf })
);
});
Which doesnβt create any animator components - I have written some code to add an Animator if there are animations in the file but I just add the Animator to the Parent object (empty) because I donβt have any way to find out what objects the Animator should actually be on (which should be the child object Cube with animation in the example above).
To circumvent this I would like to just sent the DropListener the url of the file or the file itself from my script but all the methods in DropListener are private
Is there any way to do this?
by user 103054507105067008