Hey guys. I 'm working on my final year project. it’s about a lip animation. I’ve already built a face model with multiple lip movements. And I’m trying to map this movements to each pronounce units to develop the following example.
For example, a user input word “hello” and this word contains four animations “H”, “e”, “L”, and “OW”. And my model plays these four animations in a chain.
The following code is the “play” part of my code. I used GLFLoader. I have 15 animations and I want to play them in a chain. However, when I run this, it will only play four animations and stop.
var AnimationAction = mixer.clipAction(glf.animations[0]);
AnimationAction.loop = THREE.LoopOnce;
AnimationAction.play();
var p = 0;
function l() {
if (p >= 14){
return;
}
p++;
AnimationAction = mixer.clipAction(glf.animations[p]);
AnimationAction.timeScale = 0.4;
AnimationAction.loop = THREE.LoopOnce;
AnimationAction.play();
mixer.addEventListener('finished', function (e) {
l();
});
}
mixer.addEventListener('finished', function (e) {
l()
});
Any ideas on how would I play animations in a chain?
Best Regards