Exporting Model with animations?

I’ve been trying to export the loaded FBX model(with animations/skeletal mesh). First i’ve tried using a simple object loader/exporter. The problem is that it couldn’t save the skeletal mesh and animations. So i’ve tried using the GLTFExporter/GLTFLoader. Even though the GLTFLoader seems to be loading the objects without problem, the GLTFExporter is completely ‘destroying’ the object mesh upon export(even though the skeletal mesh is fine). Here’s a picture of the bug: https://imgur.com/a/ol8OMWT.
And a download link for the exported .gltf object: http://www.mediafire.com/file/hfoue24y7pao7a2/103_test.gltf/file

OBS: I’ve tried using both the exporter AND loader from threejs release 101, 102 and 103. The 102 loader would get errors loading the broken object(but it loaded good objects without problem) and the 101 and 103 loaders loaded the broken object without issues(besides it being broken, obviously). All the GLTFExporters tested exported the object with the same error. I’ve tested the object’s integrity with https://gltf-viewer.donmccurdy.com/

Also, code snippet for my exporter (the export is a button click function)

    var exporter = new THREE.GLTFExporter();

    var options = {
        trs: false,
        onlyVisible: true,
        truncateDrawRange: true,
        binary: false,
        forceIndices: false,
        forcePowerOfTwoTextures: false
    };

    exporter.parse( that.scene.children[viewer.scene.children.length-1], function(gltf){
        //FBX Model is the last thing added to the scene.
        var stringfied = JSON.stringify(gltf, null, 2);

        require("fs").writeFile( "./src/data/103_test.gltf", stringfied, 'utf8', function(err) {
            console.log(err);
        });     
        console.log(stringfied);
    }, options );

Could you share the source FBX?

Are you making any changes to the model after loading?

If you’re doing this to concert FBX -> glTF, then I’d recommend using FBX2glTF.

Not to the model directly, only the material type/properties (color, shininess, ect). But the application i’m making do not make any changes besides those(I don’t think that counts as chaning the model, does it?).
The object was made with blender, then i used mixamo to rig and get some animations to test the application.
The source fbx is this one(the one from mixamo): https://www.mediafire.com/file/ds6s1go5w8l97hz/Capoeira.fbx/file

If it’s working in threejs but the exported model skinning is broken, it sounds like there’s a bug we should fix in GLTFExporter. I’ll try to take a look in a few days but if you want to open a bug with all the files needed to recreate the broken export that would be helpful.

Alternatively, i’ve used this workflow with Mixamo in the past: https://www.donmccurdy.com/2017/11/06/creating-animated-gltf-characters-with-mixamo-and-blender/

1 Like

From the screenshot, the skinning seems to be fine. The character mesh that is completely broken(using the exported GLTF). I’m making some changes inside de application (mostly playing with things like material settings/type) and i need to save those changes to be loaded later. Is after loading the FBX object and trying to export it to GLTF format that it breaks the mesh