Donkey-play-Violin.zip
Describe the bug
I exported an animation from one of our current projects but noticed that modelviewer/threejs have trouble with it; it seems that the animation is interpreted incorrectly. There are some warnings but I think they should not cause this behaviour, especially as it works fine in other viewers.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Correct animation playback.
(correct, Babylon sandbox)
Screenshots
(Incorrect, threejs)
Platform:
EDIT: I believe this is because objects have different hierarchies but the same object names that are differently animated, and seems three doesn't take the object hierarchy into account when animating, only the object name?
Hm, object naming shouldn't be the issue, in recent versions we append a suffix to object names to ensure they're unique for this reason. There are a few warnings printed by the glTF-Validator on this one:
The file's not invalid (the skinned mesh doesn't _have_ to be at the root of the scene) but viewers have to treat it as though it were, so it's often better and safer to put it there. I thought we handled these cases correctly either way, but it's possible something fails here.
Thank you!
Two more thoughts,
@hybridherbst This issue seems to be fixed on dev
. Please double-test this by drag'n'drop the asset into the editor:
https://raw.githack.com/mrdoob/three.js/dev/editor/index.html
You can start playing the animation from the sidebar (ANIMATIONS
section).
It seems #20880 did the trick.
@Mugen87 you could have at least given me a chance to try this out before closing 馃檭
Can confirm it works for the attached model. I'll try a more complex one over the next days and open another issue if necessary.
Complex example also seems to work :) Happy Holidays!
Most helpful comment
Complex example also seems to work :) Happy Holidays!