modernator
modernator

Reputation: 4427

THREE.js failed to load json model

I've installed Blender THREE.js export plugin and exported my model as table.json, also checked "Face Materials" option also.

But when I loaded my model from THREE.js, it fails with both ObjectLoader and JSONLoader.

In ObjectLoader, it saids:

Uncaught TypeError: Cannot read property 'type' of undefined

In JSONLoader, it saids:

Uncaught TypeError: Cannot read property 'length' of undefined

Exported json looks like this:

{
    "metadata":{
        "type":"BufferGeometry",
        "normal":312,
        "version":3,
        "uv":312,
        "position":312,
        "generator":"io_three"
    },
    "data":{
        "attributes":{
            "normal":{
                "type":"Float32Array",
                "array":[..., ..., ...],
                "itemSize":3
            },
            "uv": { ... },
            "position":{ ... }
    },
    ...
}

Looks like exported well, but why it has an error on load from three.js? Is there a something that I missed?

I'm using Blender 2.78, THREE.js 0.84.0. Any advice will very appreciate it.

Upvotes: 0

Views: 437

Answers (1)

Austin Bentley
Austin Bentley

Reputation: 90

i usually get those errors when i make a mistake exporting. Watch this https://www.youtube.com/watch?v=Pp02jQp20is. make sure you have changed the type to geometry instead of buffergeometry. Its hard to tell the problem without seeing the relevant code and a screenshot of your export.

Upvotes: 1

Related Questions