0
votes

I'm trying to load the scene from Blender, using ObjectLoader. The scene is loaded, but with no material colors.

Here are my blender exporter settings:

blender exporter settings

JSON: https://jsonblob.com/9e58bd8a-46ff-11e7-ae4c-0f21997a0996

And this is how I add the model to three.js scene:

const objectLoader = new THREE.ObjectLoader();

objectLoader.load('/static/models/lighthouse.json', (group) => {
  scene.add(group);
});

I might have missed something. Any help would be appreciated.

1
I suggest debugging ObjectLoader.parse. Put a breakpoint on the line where materials is assigned, and ensure it actually contains data when parseMaterials returns. If it doesn't, open your JSON file and ensure it actually created a materials section (it would be a root-level object, like json.geometries).TheJim01

1 Answers

0
votes

Finally I found decision. It was in cycles blender engine. Once I replaced it with blender render engine, I got material colors in three.js scene.

I'm not sure this is the right decision and whether the issue was exactly in blender engine, but changing the engine to blender render solved my problem.