glTF file with skins but not joint or weight attributes

Hi,

I have a glTF file that gets rendered correctly with the animations in an online glTF viewer and blender.

However, while it has skins defined, there are no joints or weights attributes defined for the mesh or mesh primitive, and I can’t see any other places (including extensions) where weights are defined.

In this case, where all the joints and weights are undefined, how do you handle this?

I don’t know for certain what your file contains, but my guess would be it’s something like:

In this case some meshes have joints and weights, but many do not — most of the model’s animated meshes are simply children of joint nodes, inheriting transforms from their animated parent nodes. This would work the same way whether the nodes were part of a skin or not, and no weights are required.

Thanks. I thought it was an error due to this:

NODE_SKIN_WITH_NON_SKINNED_MESH Node has skin defined, but mesh has no joints data. Error

If the file is invalid then all bets are off — your implementation can handle it or not. Would probably have more to do with the engine’s requirements than the file format at that point.

The main problem is composing the transforms after animation. Before animation, starting with each mesh that makes up the model (left):

  1. Apply the transforms of each individual node (middle)
  2. Apply the parent transforms, which gives the correct model (right)

Then after updating the node matrices after applying the animation transform to each node at time t, the animation is not correct for this type of model (no skinned mesh). However, the animations work well for skinned models with weights defined such as this one.

I am not sure how to handle the transforms, as applying the parent transforms to each child node results in undefined behaviour (but the model renders and animates correctly in blender)
How do you handle the transforms for non-skinned models with defined joints

It sounds like you are maybe writing a renderer from scratch, not just loading glTF data into an existing renderer? Each node must inherit the transform of its parent, before applying its own transform. If the node transforms aren’t working yet, I would pause any work on skinning and try to implement node transforms correctly, nothing will look right without that. A good tutorial on scene graphs might be:

Thanks for the hint, it is now animating correctly. Yes, I am writing code to load glTF files into my game engine.

The issue was that I forgot to reset the node transform to the local transform of the node in every frame, as the animation sequence doesn’t target all the nodes.


This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.