Hi,
I am using Draco with my model and created an animation in blender.
But i cannot find the animations in the animations array of the 3d element.
When i use “const clip = THREE.AnimationClip.findByName(clips, “Action”);”
I can find it in the console, but it doesn’t play at all.
here is my code :
let mixer;
let clock = new THREE.Clock();
dracoLoader.setDecoderPath(`/node_modules/three/examples/jsm/libs/draco/`);
dracoLoader.setDecoderConfig({ type: "js" });
gltfLoader.setDRACOLoader(dracoLoader);
gltfLoader.load(
"/Model/cosmosv6.gltf",
function (gltf) {
mixer = new THREE.AnimationMixer(gltf.scene);
const clips = gltf.animations;
const clip = THREE.AnimationClip.findByName(clips, "Action");
const action = mixer.clipAction(clip);
action.play();
gltf.scene.children[1].material.map = videoTexture;
gltf.scene.children[1].material.map.flipY = false;
gltf.scene.children[1].material.map.rotation = Math.PI;
gltf.scene.children[1].material.map.wrapS = THREE.RepeatWrapping;
gltf.scene.children[1].material.map.wrapT = THREE.RepeatWrapping;
gltf.scene.children[1].material.lightMapIntensity = 1.3;
scene.add(gltf.scene);
function animate() {
if (mixer !== undefined ) mixer.update(clock.getDelta())
action.play();
}
animate();
}