mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
102.81k stars 35.38k forks source link

Error in JSON file loader #13375

Closed especimenraro closed 6 years ago

especimenraro commented 6 years ago
Description of the problem

Three.js gives me an error when load a json file exported from Blender 2.76 threejs_error

"TypeError: vertices is undefined"

but if I use the example made with r69 it works there is a difference between json exported file. modelos.zip

Three.js version
Browser
OS
donmccurdy commented 6 years ago

Could you include the .blend file, as well?

especimenraro commented 6 years ago

misc_chair01.blend.zip misc_chair01.js is included in the example inside the book "Learning Three.js" by Jos Dirksen I buyed from threejs web site. The second json file I created with io_three addon I downloaded from the main page and the .blend file included in the example

donmccurdy commented 6 years ago

Thanks — FWIW the file exports correctly and can be loaded with the glTF Blender exporter and THREE.GLTFLoader.

screen shot 2018-02-20 at 12 15 41 pm
especimenraro commented 6 years ago

ok, you installed exporter in Blender and after used GTLFLoader. I'll try Thank you

Mugen87 commented 6 years ago

FYI #12903

olgageletina commented 6 years ago

+1 on this issue – what is quite annoying is that I have a JSON file with a Geometry, which by default gets converted BufferGeometry once imported and added to a Mesh, when I attempt THREE.Geometry().fromBufferGeometry( mesh.geometry ) I get the TypeError: attributes.position is undefined error. Ideally, I would love some guidance on how to preserve the data I am importing in its original form or a way of modifying the position of the individual mesh vertices based on user input using some other approach...

looeee commented 6 years ago

THREE.Geometry().fromBufferGeometry( mesh.geometry )

@olgageletina you should not be converting a BufferGeometry back to a Geometry. If you want a more detailed explanation or help with this, please ask over on the forum.

especimenraro commented 6 years ago

I did the export with gltf from Blender 2.79, but when I try to import with glTFLoader() I get an error: Error de lectura XML: mal formado Ubicación: file:///home/ricardo/Documentos/ProyectoHTML5/etnika/modelos/gltf/Pioneer.gltf Número de línea 1, columna 1: Pioneer.gltf:1:1 TypeError: path is undefined glTF-parser.js:91:17

donmccurdy commented 6 years ago

@especimenraro what is glTF-parser.js? Something has gone very wrong if XML is in the error message. 🤔

especimenraro commented 6 years ago

I fixed! I use GLTFLoader code on github and it works. I was using glTFLoader included in R89 libs

thanks