Open rla-inneo opened 1 year ago
Thanks, yeah it's the closest we have. @AdrianAtGoogle can you find the right place for this bug?
Also @emackey, is this animations with multiple scenes thing something that needs to be clarified in the spec?
This is a very interesting test case, thank you! It would seem reasonable that if an animation targets node(s) not in the current scene, those targets should be ignored during the animation.
BabylonJS takes this one step further, and doesn't offer the animation that doesn't apply. For example in VSCode you can see it only offers the "move" animation for scene 0, and if you switch the default scene to 1, it only offers the "rotate" animation. Other rendering engines I've tried seem to get badly confused by this.
I suspect the glTF spec doesn't much need an update, although it's unfortunate that engines have to work out for themselves which parts of which animations can apply to which scenes. Still, it's just a matter of checking whether a given animation target node exists in the scene, and being prepared to ignore references to nodes from other scenes in the animations list.
Perhaps we need a new test model (without Draco and without the CC-BY-NC helmet) as part of the official sample models.
Thank you very much for the quick responses!
BabylonJS takes this one step further, and doesn't offer the animation that doesn't apply.
Is this a feature that could also be useful for the model-viewer? Currently, the availableAnimations
property returns all animations in the model, but adding animation-name="rotate"
in my demo did not result in any errors. However, it still tries to play the animation on the wrong scene, which may lead to some unexpected outcomes if the hierarchies do not align.
Altough it seems like a minor quirk since there is no way to select a scene in the first place and the playback of an incompatible animation has to be deliberate. It might be more beneficial to have an extension to the GLTFLoader of THREE that offers this functionality on the lowest level - then the implementation here would be trivial.
Perhaps we need a new test model (without Draco and without the CC-BY-NC helmet) as part of the official sample models.
That sounds great. I have updated my demo by using a license-free cube mesh, and I am happy to submit a pull request to the gltf-Sample-Models repo to take it further.
Description
This issue is related to the SceneViewer on Android and not the model-viewer. The demo contains a GLB file with two scenes "first" and "second" and two animations "move" and "rotate".
Steps to reproduce
Expected behavior
Actual behavior
Additional information
The GLB file is valid through Khronos' glTF Validator tool.
Oddly the glTF spec doesn't have a way to assign an animation to a specific scene. My guess is that the SceneViewer stumbles when trying to load the "rotate" animation and can't find any fitting node in the "first" scene.
The demo contains a second model "Multi Scene and Single Animation" in which the second scene does not contain an animation. This one loads just fine.
Live Demo
https://jumbled-sepia-hedgehog.glitch.me/
Version
Browser Affected
OS
AR
If this is not the right place to report SceneViewer related issues I apologize. But it seemed through past issues in this repo that it is the most fitting.