I can update the name, but it’s a bit tricky because I don’t know which name would be the right one to replace. The extra transform node is there in case that node is being targeted for animation. You can distinguish between them as one is a TransformNode and one is a Mesh.
Maybe, let me think about that.
Override mesh has many issues also. That’s why we did it this way.
I’m sure we can find a solution that works for you.
I think if it was reliable… all skins moved under bones or not. And keep some kind of reference to the skin node on the transform node… Then i could at least make a getter for this.transform and do the checking if this is Really the node i attached the script to.
Here is another example loading a ReadyPlayerMe character. None of the mesh nodes are under the HIPS
The way the algorithm works right now, it always updates the skinned mesh as a child of the parent of the skeleton root (except when the skinned mesh is the skeleton root parent). The skeleton root is either computed via common ancestor or specified by the glTF via the skeleton property. The skinned mesh is supposed to be a sibling of the skeleton hierarchy not inside the skeleton hierarchy.
I like this idea but I’m not sure a reference will be good. It might cause some lifetime issues. Would a callback that fires when the glTF skin node is split into TransformNode and Mesh help?
If there was a link to the skinned mesh on the original transform node, then i guess it would not matter if the the skinned meshed was moved under the root bone or not.
So it comes down to keeping a reference to the skinned mesh on the original transform node.
Even if you give me callback that GLTF is spitting things into a TransformNode/Mesh combo… I would still need to store that reference, right… I guess i could also APPEND Skin to the mesh name then as well ?
Yes, depending on what you are doing. I’m worried adding reference from one node to another will cause them to stay around longer than they should, but maybe it’ll be fine.
The first statement is effectively true. The original glTF skin node will be created as a TransformNode. A new skinned mesh will also be created whose parent will be assigned to the parent of the skeleton root, which effectively makes this new skinned mesh a sibling of the skeleton root and the transform node, for this case.
The second statement is not quite right. It should say:
But if they ARE NOT siblings (have different parents) then they WILL be reparented so the skin is undera sibling of the root bone