I'm attempting to convert a blender model into a threejs JSON format using the provided blender exporter. However, when I try to parse the JSON file, I encounter an error:
Uncaught TypeError: Cannot read property 'length' of undefined
The structure of the JSON file (excluding vertices and faces) is as follows:
{
"textures": [],
"metadata": {
"version": 4.3,
"sourceFile": "UV-World.blend",
"type": "Object",
"generator": "io_three"
},
"images": [],
"materials": [],
"object": {
"matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],
"children": [{
"type": "Mesh",
"name": "Kugel",
"uuid": "5051D840-9982-4F9A-8CFF-36303B38E091",
"position": [0.0,0.0,0.0],
"rotation": [-1.5707964897155762,0.0,0.0],
"scale": [1.0,0.9999999403953552,0.9999999403953552],
"visible": true,
"castShadow": true,
"receiveShadow": true,
"geometry": "DEAE2CE2-9824-4F91-BE4C-1C80BEDC566A"
}],
"type": "Scene",
"uuid": "8C543616-2AB0-4D1D-B76D-549E32A0E468"
},
"geometries": [{
"type": "Geometry",
"data": {
"name": "KugelGeometry",
"metadata": {
"version": 3,
"faces": 512,
"vertices": 482,
"generator": "io_three"
},
"vertices": [...],
"faces": [...]
},
"uuid": "DEAE2CE2-9824-4F91-BE4C-1C80BEDC566A"
}]
}
It appears that this JSON structure does not match the expected format by threejs. Manually adjusting the JSON to the following format allows threejs to correctly parse and display the model.
{
"scale": 1,
"vertices": [...],
"faces": [...]
}
Exporting and importing to/from OBJ formats is functioning properly.
Since I couldn't find anyone else facing this issue, I suspect it may be due to a mistake in my usage. I am new to using Blender, so it's possible I made an error there. I am currently using Blender 2.73a and the latest version of threejs from the repository.