0
votes

I am using the latest three.js exporter for three.js v71 plugged into Blender 2.75. I have a simple Blender file with a cube, armature and single bone. When I export the file to three.js, the bone and animation data is never exported.

The options that I have highlighted are :

https://www.dropbox.com/s/99wma7fqaw2wur5/blenderoptions.jpg?dl=0

And the output js file, without bones or animation, is :

    "data": {
        "skinIndices": [],
        "vertices": [1,1,-1,1,-1,-1,-1,-1,-1,-1,1,-1,1,0.999999,1,0.999999,-1,1,-1,-1,1,-1,1,1],
        "animations": [],
        "normals": [0.577349,0.577349,-0.577349,0.577349,-0.577349,-0.577349,-0.577349,-0.577349,-0.577349,-0.577349,0.577349,-0.577349,0.577349,0.577349,0.577349,-0.577349,0.577349,0.577349,-0.577349,-0.577349,0.577349,0.577349,-0.577349,0.577349],
        "faces": [33,0,1,2,3,0,1,2,3,33,4,7,6,5,4,5,6,7,33,0,4,5,1,0,4,7,1,33,1,5,6,2,1,7,6,2,33,2,6,7,3,2,6,5,3,33,4,0,3,7,4,0,3,5],
        "influencesPerVertex": 2,
        "metadata": {
            "version": 3,
            "vertices": 8,
            "uvs": 0,
            "faces": 6,
            "normals": 8,
            "bones": 0,
            "generator": "io_three"
        },
        "uvs": [],
        "name": "CubeGeometry",
        "bones": [],
        "skinWeights": []
    }

What else do I need to do? I've tried every combination of options, including the Morph animation, but nothing works. I've uploaded my Blender file and the js output to : https://www.dropbox.com/s/yr90088smoa9941/simplecube.zip?dl=0

1

1 Answers

0
votes

Wow, Blender really isn't easy, is it?

I eventually set the parent of the mesh to the skeleton by using Ctrl-P and then choosing automatic weights, rather than selecting the parent myself. I had been choosing the parent as Armature->Bone->Bonename. Apparently it has to be just Armature->Object. Ctrl-P sorted this out for me automatically, and when the file is exported (Along with the bones and skinning boxes being ticked) then the animation details are alo placed into the json file.

Further Gotcha : If the file is exported with scene information then Threejs must use the Objloader, otherwise you start getting 'Undefined length' errors when loading the model. If the file is exported without scene information, then use the JsonLoader.