I saw in ‘More Information’ that the model has 26 animations. However, when I load it using GLTFLoader and console.log(model.animations), I see an empty array.
I tried using both .gltf and .glb formats. The model loads fine. Am I doing something wrong?
I noticed in the comments of the model that people are talking about the animations in Blender.
The code:
import { GLTFLoader } from 'three/examples/jsm/Addons.js';
import { gsapAnimations } from './animations';
export function models(scene) {
let loader, velociraptor
loader = new GLTFLoader()
loader.load('/velociraptor_animated.glb',function ( gltf ) {
velociraptor = gltf.scene;
console.log(velociraptor.animations)
velociraptor.rotation.y = -2
scene.add(velociraptor);
gsapAnimations(velociraptor);
}, undefined, function ( error ) {
console.error( error );
} );
return velociraptor;
}