glTF clarification : local transforms in node section?

39 Views Asked by At

I have a glb with a skeleton.

 {
      "children": [
        52
      ],
      "name": "mixamorig:Spine",
      "rotation": [
        -0.01015173364430666,
        0,
        0,
        0.9999485015869141
      ],
      "scale": [
        0.9999999403953552,
        1,
        0.9999999403953552
      ],
      "translation": [
        -120.8421709430404,
        120.89957332611084,
        -120.01826735585928
      ]
},

I modified the translation section with huge values (+/-120) to see what effect it would have on the mesh.

the original values were :

  "translation": [
    -2.842170943040401e-14,
    0.8995733261108398,
    -0.018267355859279633
  ]

So a big diff here.

Net result: none.

Blender didn't see a diff and plays the animation as if nothing happened. Even in rest mode, no issue.

So, why are those value useful? When are they used? Should we always consider those values as useless when an animation is registered?

this glTF tutorial didn't help

1

There are 1 best solutions below

1
On BEST ANSWER

In glTF, animation channels overwrite their corresponding static transformations when they play. In the above example, you've made what looks like it should be a large change to the static translation. But, if any animation is enabled that controls this bone's translation, then the static data you've provided here is overwritten by output values from the animation.

Some systems (ThreeJS, Babylon, etc) may be able to show you what the model looks like when no animation is playing. In this case you should be able to see the "default" pose, with no animation applied, where the static transformation is used. But even here, there's a possible catch: Typical glTF viewers built with these systems auto-center the model in the view. So what bone is this that you're modifying? Is it the root bone, parent of the entire skeleton? Moving it 120 meters away will simply cause the default camera to also move 120 meters away, so the model remains centered in the view like before. You need a floor or something in the model that's not a child of this bone, to see the translation applied to it.