Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1626 Set skinned mesh at root #1627

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

julienduroure
Copy link
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
Copy link
Contributor

scurest commented Apr 14, 2022

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
Copy link
Contributor

donmccurdy commented Apr 14, 2022

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
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
Collaborator Author

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

@julienduroure
Copy link
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