Jump to content

GLTF Importer De-Parenting Skinned Meshes


MackeyK24
 Share

Recommended Posts

Yp @Deltakosh and @bghgary 

There seems to be a BUG in the GLTF importers... I have a hierarchy like this:

- Remy-Master (Parent)

--- Body (Child)

--- Bottoms (Child)

--- Eyes (Child)

--- Hair (Child)

--- Shoes (Child)

--- Tops (Child)

--- mixamorig:Hips (Child, Skeleton)

But when i look at the scene all the SKINNED MESHES (Body, Bottoms, Eyes, Hair, Shoes, Tops) are DE-PARENTED and in the root of the scene instead of being under Remy-Master.

That must be a BUG... Here is a screen shot of the scene:

931984634_ScreenShot2018-11-10at2_19_38AM.thumb.png.c8b50d6ea42194901b5e614afd74e8aa.png

 

Note: My GLTF json DOES have the 7 other nodes defined as children (and it works right in other viewers?

 

 "nodes": [
    {
      "children": [
        1,
        2,
        3,
        4,
        5,
        72,
        73
      ],
      "rotation": [
        0.0,
        1.0,
        0.0,
        0.0
      ],
      "name": "Remy-Master",
    }
]

 

 

Link to comment
Share on other sites

I imagine it would do the same thing with any Skinned meshes that are children of a master mesh.

But here is my Remy-Master

Note: Is kinda big... Has a bunch for blendshapes and 17MB worth of textures

Yo @bghgary ... Hey Gary... I finally GOT THE WHOLE GLTF Export Pipeline... Take a look at Remy.

1... Picture prefect PBR Material Export

2... Animations (Including Skeletal Animations)

3... Blendshapes (Including Morph Animations)

4... GLB Binary Containers (Which includes ALL external scene assets)

5... And so much more... Like Navmeshes, Lightmaps, Terrains (Including Splatmaps)

I tell you... That took a minute to get right. All the Unity type GLTF exporters (Even the one you made for reference) does not really work right and does not export the all the major stuff... Mainly Skeletal Animations... That was a bitch to get right.

 

Link to comment
Share on other sites

This is done intentionally to satisfy the requirements for the glTF spec. See https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins (second implementation note).

Quote

Implementation Note: Client implementations should apply only the transform of the skeleton root node to the skinned mesh while ignoring the transform of the skinned mesh node. In the example below, the translation of node_0 and the scale of node_1 are applied while the translation of node_3 and rotation of node_4 are ignored.

The code is here: https://github.com/BabylonJS/Babylon.js/blob/master/loaders/src/glTF/2.0/babylon.glTFLoader.ts#L564

Is this causing a specific problem for you?

Link to comment
Share on other sites

On ‎11‎/‎10‎/‎2018 at 10:29 PM, MackeyK24 said:

That took a minute to get right. All the Unity type GLTF exporters (Even the one you made for reference) does not really work right and does not export the all the major stuff... Mainly Skeletal Animations...

Skinning always take a bit to get right. I'm glad you figured it out!

Link to comment
Share on other sites

I’m using the gltf as a scene file... could have many root transform node... not just a single character model... and yes I get Remy-Master by name and move around using my Third Person Controller ... but in Babylon the body etc are parented to the root Babylon node and not Remy-master or whatever the main character model name is... this one is Called Remy-Master

Link to comment
Share on other sites

26 minutes ago, MackeyK24 said:

I get Remy-Master by name and move around using my Third Person Controller

The expected behavior in glTF is that transforms (parent and self) of skinned nodes are ignored. If you want to move the skeleton around, you need to move the root of the skeleton hierarchy and not the skinned node. This is the same behavior in Unity.

Link to comment
Share on other sites

The moving around of nodes and ignoring transforms is just for glTF and for the loader. Once the loading is done, you can move the skinned mesh.

https://playground.babylonjs.com/#KDITCT#1

But in your case, since you have a whole scene and multiple roots to move. I don't have a good solution. Can you file an issue for this? I'll think of something.

Link to comment
Share on other sites

2 minutes ago, MackeyK24 said:

Why not just use the original parent node. 

There can be a non-identity transform on the original parent node which should not be applied to the skinned mesh. If there are meshes attached as children of this node, then I must split the hierarchy as the skinned mesh should not have the transform applied but the child meshes should.

I can add a flag, but I rather not have options for how the hierarchy is constructed. It might cause some confusion.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...