-
-
Notifications
You must be signed in to change notification settings - Fork 35.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
GLTFExporter Fix Morph #12967
GLTFExporter Fix Morph #12967
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, thanks!
@@ -800,9 +800,41 @@ THREE.GLTFExporter.prototype = { | |||
|
|||
for ( var attributeName in geometry.morphAttributes ) { | |||
|
|||
// glTF 2.0 morph supports only POSITION/NORMAL/TANGENT. | |||
// | |||
// @TODO TANGENT support |
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.
TBH I wouldn't bother adding a @\TODO about this since three.js doesn't support stored tangents currently...
|
||
var baseAttribute = geometry.attributes[ attributeName ]; | ||
// Clones attribute not to override | ||
var attribute2 = attribute.clone(); |
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.
nit: could you rename this relativeAttribute
or something like that? Comment above it wouldn't be necessary in that case.
Updated. Thanks for the comments. Regarding absolute/relative comment, let me keep it because I think it'll be helpful for new developers. |
/ping @fernandojsg for the review |
Sorry, I lost track of this PR. I'll merge for now, we can amend if @fernandojsg has any comments. |
Thanks! |
This PR fixes
GLTFExporter
Morph.You can see that the second one fixes a morph issue on Don's glTF viewer
https://gltf-viewer.donmccurdy.com/
Without this change scene.zip
With this change scene_fix.zip
Zip files include glTF AnimationMorphCube model loaded with
GLTFLoader
and then exported withGLTFExporter
https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/AnimatedMorphCube
/cc @fernandojsg @donmccurdy