question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AnimationMixer finished event fires prematurely

See original GitHub issue
Description of the problem

As far as I understand it, the finished event on AnimationMixer should only fire when an action has finished.

In practice, it seems to often fire just before I’d expect.

For a 1000ms clip, at the point in time the finished fires, action.time will often be 983.4ms. This looks a lot like a single frame gap (ie 16.6ms) from the end. In addition, the property being manipulated will be just short (say, by 16.6 / 1000) of the lerp to the terminal value in a track associated with the clip.

Is this intended behavior? If so, can an event be added that only fires when the action is truly finished? If not, is this a matter of moving the location of the logic that fires the event to be a bit later in its code path?

Three.js version
  • Dev
  • r81
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • Linux
  • Android
  • IOS

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
fallenoakcommented, Nov 3, 2016

@takahirox I wound find that much more intuitive.

Still haven’t had a chance to put together a jsfiddle showing the not-yet-final-value issue I mentioned originally, but I’ll try do that this week.

1reaction
takahiroxcommented, Nov 2, 2016

BTW, I think ‘finished’ and ‘loop’ should be fired after accumulation here.

https://github.com/mrdoob/three.js/blob/fcd6fd23b6612db1579c7d907fa0ec31156082a5/src/animation/AnimationAction.js#L377

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fire an Aframe animation-mixer event using Javascript ...
1 Answer 1 · I am facing two problems: 1). The part of code in animation-finished event is not firing and 2). Is...
Read more >
Animation: finish event - Web APIs | MDN
The finish event of the Animation interface is fired when the animation finishes playing, either when the animation completes naturally, ...
Read more >
Three.js Making a Game
I ended up writing quite a but of code to make this simple unfinished game like ... To play the animations each model...
Read more >
AnimationMixer – three.js docs
The AnimationMixer is a player for animations on a particular object in the scene. ... This is usually done in the render loop,...
Read more >
AdCube: WebVR Ad Fraud and Practical Confinement of Third ...
ports a fusing event that fires when a user locates the cursor on a targeted entity. ... played a game for five minutes,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found