Skip to content

Fix #1626 Set skinned mesh at root#1627

Open
julienduroure wants to merge 9 commits into
mainfrom
skinned_mesh_at_root
Open

Fix #1626 Set skinned mesh at root#1627
julienduroure wants to merge 9 commits into
mainfrom
skinned_mesh_at_root

Conversation

@julienduroure

Copy link
Copy Markdown
Collaborator

Fix #1626
Set skinned mesh at root

Note : Need to be fully tested

@julienduroure
julienduroure marked this pull request as ready for review April 14, 2022 13:58
@scurest

scurest commented Apr 14, 2022

Copy link
Copy Markdown
Contributor

Even if the transform is not needed for the skinned mesh, there may be child objects that need the transform. The importer handles this by possibly creating a new node to attach the skinned mesh to.

Example

  1. Import CesiumMan.
  2. Parent a cube to the CesiumMan mesh.
  3. Drag the armature so its off-center.
  4. Export and view in viewer. On this branch, the cube is at the origin instead of off-center with the CesiumMan mesh.

@donmccurdy

donmccurdy commented Apr 14, 2022

Copy link
Copy Markdown
Member

Copying from #1626 (comment)

Understanding that applying transforms to the skinned mesh node (as opposed to the armature / joints) does not have an effect in glTF ... don't we still need to apply those transforms somewhere, if they were contributing to the final position of the vertices in Blender? Applying the transform to the inverse bind matrices might be the best approach if that's the case.

^See @scurest's #1626 (comment), my comment doesn't need to block the PR.

@julienduroure

Copy link
Copy Markdown
Collaborator Author

Trying a fix to the case described by @scurest
by resetting not only the TRS of glTF mesh, but also the internal world matrix that is used for children calculation

@julienduroure

Copy link
Copy Markdown
Collaborator Author

So, any other cases that breaks or are not solved?
Don't hesitate to tell me

@julienduroure

Copy link
Copy Markdown
Collaborator Author

Note: This breaks driver detection for now

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Skin/armature export produces NODE_SKINNED_MESH_NON_ROOT

3 participants