Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glTF 2.0 animations can't target unspecified targets #6323

Closed
emackey opened this issue Mar 12, 2018 · 1 comment
Closed

glTF 2.0 animations can't target unspecified targets #6323

emackey opened this issue Mar 12, 2018 · 1 comment

Comments

@emackey
Copy link
Contributor

emackey commented Mar 12, 2018

I have a sample model, that came from the Khronos Blender exporter, that has an animation like this:

    "animations" : [
        {
            "channels" : [
                {
                    "sampler" : 0,
                    "target" : {
                        "node" : 1,
                        "path" : "rotation"

This one targets rotation. But the node in question, "node": 1, looks like this:

        {
            "mesh" : 0,
            "name" : "Cube"
        },

What's missing from Node 1? There's no rotation specified in that node.

Cesium is currently disregarding the animations in this model, and the correct behavior only appears if I add "rotation" : [ 0.0, 0.0, 0.0, 1.0 ] to the node in question. But I don't think anything in the glTF spec disallows applying an animation to a default value. So, I think this should be supported (but I can check in with the working group if there's any question).

To reproduce this problem, grab a copy of AnimatedTriangle.gltf and delete line 11 where the node is given a default rotation of the identity quaternion. (Also remove the comma on line 10 so that the JSON remains valid). The resulting model works fine in Babylon and ThreeJS, but does not animate in Cesium.

@lilleyse
Copy link
Contributor

@emackey and I talked about this a bit offline:

To fix this we can either:

  • Improve gltf-pipeline/addDefaults so that it adds translation/rotation/scale defaults instead of a matrix default when targeted by an animation.
  • Add checks for missing translation/rotation/scale in the animation code only.

Questions:

  • What happens if a node uses a matrix but an animation targets a rotation? Does the spec say anything about this case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants