Hi,
I’ve faced with strange behaviour on AnimationMixer event listener - I can’t identify/remove event listener after mixer.addEventListener(‘finished’,function(e){…}); … call of mixer.hasEventListener(‘finished’) after adding returns false (same as inside of function(e){…}), but if print mixer via console.log there is _listeners and uuid the same when adding and trying to identify/remove. What is this an issue? It seems there is a bug here… revision 117.
You can take , for instance, webgl_skinning_simple.html example and add the following lines:
mixer = new THREE.AnimationMixer( gltf.scene ); mixer.addEventListener('loop',function(e) { console.log('fin'); console.log(this.hasEventListener('loop')); this.removeEventListener('loop'); }); console.log('has:'); console.log(mixer.hasEventListener('loop')); mixer.clipAction( gltf.animations[ 0 ] ).play();
console output for hasEventListener will be always false and loop will never removed.