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

Editor:Uncaught TypeError: normal.clone is not a function #19407

Closed
4 of 7 tasks
zypy333 opened this issue May 21, 2020 · 3 comments · Fixed by #18537
Closed
4 of 7 tasks

Editor:Uncaught TypeError: normal.clone is not a function #19407

zypy333 opened this issue May 21, 2020 · 3 comments · Fixed by #18537
Labels

Comments

@zypy333
Copy link

zypy333 commented May 21, 2020

Description of the problem

I import a gltf file into three.js Editor, and when I export it ,I got this error

Uncaught TypeError: normal.clone is not a function
at createNormalizedNormalAttribute (GLTFExporter.js:297)
at processMesh (GLTFExporter.js:1240)
at processNode (GLTFExporter.js:1812)
at processNode (GLTFExporter.js:1860)
at processNode (GLTFExporter.js:1860)
at processScene (GLTFExporter.js:1921)
at processInput (GLTFExporter.js:1974)
at GLTFExporter.parse (GLTFExporter.js:2004)
at UIRow. (Menubar.File.js:272)
createNormalizedNormalAttribute @ GLTFExporter.js:297
processMesh @ GLTFExporter.js:1240
processNode @ GLTFExporter.js:1812
processNode @ GLTFExporter.js:1860
processNode @ GLTFExporter.js:1860
processScene @ GLTFExporter.js:1921
processInput @ GLTFExporter.js:1974
parse @ GLTFExporter.js:2004
(anonymous) @ Menubar.File.js:272 

And here is the file
https://github.com/zypy333/test1/blob/HEAD/2cen.gltf

Three.js version
  • Dev
  • r116
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • Windows
Hardware Requirements (graphics card, VR Device, ...)

no

@Mugen87
Copy link
Collaborator

Mugen87 commented May 21, 2020

As discussed at the forum, this happens because InterleaevedBufferAttribute has no clone() method.

https://discourse.threejs.org/t/editor-uncaught-typeerror-normal-clone-is-not-a-function-gltfexporter-js/15415/2?u=mugen87

There is a related runtime error in the editor that happens because toJSON() is missing, too. Maybe we could reactivate #18537 and implement both methods via de-interleaving for now (as
a quick fix).

@Mugen87 Mugen87 added the Bug label May 21, 2020
@mrdoob
Copy link
Owner

mrdoob commented May 22, 2020

There is a related runtime error in the editor that happens because toJSON() is missing, too. Maybe we could reactivate #18537 and implement both methods via de-interleaving for now (as
a quick fix).

Sounds good. Better than crashing... We may want to add a console.log() thought so we don't forget.

@Mugen87
Copy link
Collaborator

Mugen87 commented May 22, 2020

Reopened the PR, updated it and added the console message for both methods 👍.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants