After installing the Blender THREE.js export plugin, I successfully exported my model as table.json and made sure to check the "Face Materials" option.
However, when attempting to load my model in THREE.js using both ObjectLoader and JSONLoader, I encountered errors. The ObjectLoader displayed:
Uncaught TypeError: Cannot read property 'type' of undefined
While the JSONLoader showed:
Uncaught TypeError: Cannot read property 'length' of undefined
The exported json appeared to be structured correctly, as seen below:
{
"metadata":{
"type":"BufferGeometry",
"normal":312,
"version":3,
"uv":312,
"position":312,
"generator":"io_three"
},
"data":{
"attributes":{
"normal":{
"type":"Float32Array",
"array":[..., ..., ...],
"itemSize":3
},
"uv": { ... },
"position":{ ... }
},
...
}
Although the export seems fine, I am puzzled as to why it is failing to load properly in three.js. Could there be something crucial that I overlooked?
For your reference, I am using Blender 2.78 and THREE.js 0.84.0. Any guidance on this matter would be greatly appreciated.