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 );