I've tried following solutions from Stack Overflow to resolve this issue, but I'm still unable to load external objects (Blender).
Essentially, I exported it as a ThreeJS JSON file, here is the content of my JSON file:
{
"textures":[],
"animations":[{
"fps":24,
"tracks":[],
"name":"default"
}],
"geometries":[{
"materials":[{
"colorEmissive":[0,0,0],
"DbgName":"Material.113",
"DbgIndex":0,
"shading":"phong",
"specularCoef":50,
"transparent":false,
"visible":true,
"blending":1,
"depthWrite":true,
"DbgColor":15658734,
"doubleSided":false,
"wireframe":false,
"colorSpecular":[0.5,0.5,0.5],
"opacity":1,
"depthTest":true,
"colorDiffuse":[0.0396404,0.0396404,0.0396404]
},{
"colorEmissive":[0,0,0],
"DbgName":"Material.112",
"DbgIndex":1,
"shading":"lambert",
"transparent":false,
"visible":true,
"blending":1,
"depthWrite":true,
"DbgColor":15597568,
"doubleSided":false,
"wireframe":false,
"opacity":1,
"depthTest":true,
"colorDiffuse":[0.8,0.443066,0.182712]
},{
"colorEmissive":[0,0,0],
"DbgName":"Material.114",
"DbgIndex":2,
"shading":"phong",
"specularCoef":50,
"transparent":false,
"visible":true,
"blending":1,
"depthWrite":true,
"DbgColor":60928,
"doubleSided":false,
"wireframe":false,
"colorSpecular":[0.5,0.5,0.5],
"opacity":1,
"depthTest":true,
"colorDiffuse":[0.8,0.614231,0.407028]
}],
"data":{
"uvs":[],
"normals":[-0,0,1,-1,-0,0,1,-0,-0,-0,-1,0,-1,4.76837e-07,0,-1,-0,0,-2.38419e-07,-1,2.38419e-07,-2.38419e-07,-1,2.38419e-07,-2.38419e-07,-1,2.38419e-07 },
"type":"Geometry",
"uuid":"639CD2C2-56FB-4D8F-B53B-B8C3E040803C",
"name":"Cube.111Geometry.4"
}],
...
I've omitted some data in the normals array, but essentially I'm trying to load it as follows:
var objLoader = new THREE.ObjectLoader();
objLoader.load('assets/dama.json', function (geometry) {
this.scene.add(geometry);
});
It locates the file but I encounter an error: Cannot read property 'scene' of undefined
Perhaps the issue lies in the export settings, but I've already switched from buffergeometry to geometry and checked the scene checkbox. What could I be missing? :S