Three.js: Editor锛歎ncaught TypeError: normal.clone is not a function

Created on 21 May 2020  路  3Comments  路  Source: mrdoob/three.js

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
  • [x] Dev
  • [x] r116
Browser
  • [x] All of them
  • [ ] Chrome
  • [ ] Firefox
  • [ ] Internet Explorer
OS
  • [x] Windows
Hardware Requirements (graphics card, VR Device, ...)

no

Bug

All 3 comments

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).

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.

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

Was this page helpful?
0 / 5 - 0 ratings