KHR_interactivity/FlowGraph starting animation breaks Babylon

Hi!

I’m considering quite a trivial scenario: [click on a mesh] → [the mesh is animated (just once)]

Here’s a playground snippet:

When the mesh clicked while it’s already moving, the animation silently breaks and get removed from scene completely.

I know, everything is changing somewhat rapidly, since 2023.
And the bug may not be relevant soon.
However, I noticed, the case is not covered in tests for interactivity.
Also, I see some code both in FlowGraphPlayAnimationBlock and AnimationGroup that supposed to deal with that, but it still fails somehow.

P.S.
The issue could be monkey-patch-fixed by injecting StopAnimationBlock right before PlayAnimation. But it’s also not quite working, because the stopping is async yet the ‘out’ is activated immediately before it actually stopped. It works when connected via done though, but corresponding KHR node doesn’t have the done.

I assume, @bghgary is interested in such stuff.

1 Like