-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add skinning support to glTF exporter #7197
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
@@ -472,6 +478,12 @@ class GltfExporter extends CoreExporter { | |||
const entityMeshInstance = resources.entityMeshInstances.find(e => e.node === entity); | |||
if (entityMeshInstance) { | |||
node.mesh = resources.entityMeshInstances.indexOf(entityMeshInstance); | |||
|
|||
// Add skin reference if this node has a skinned mesh | |||
const meshInstance = entityMeshInstance.meshInstances[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slight problem here is that the engine supports different skin for each mesh instance in the array here, but glTF does not.
We should check all meshInstances in this array, and they must point to the same skin. If they point to different skins, or some do not link to any skin, we should probably log a warning and skip skinning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Any objection to opening a new issue on this and fixing it in a follow up PR? I want to keep this PR reasonably simple and there might be some nuance to how we want to deal with the case you mention.
Allows for exporting of skins to glTF.
Fixes #7144
Partially addresses #5001
I confirm I have read the contributing guidelines and signed the Contributor License Agreement.