Hi there!
I am building an app that can import or export meshes. Sometimes I import different meshes with empty nodes in it, so I would like to be able to export excluding all these empty nodes. What is the best way to do this?
Here is what I have tried, but it is not working:
let excludedNodes = [];
scene.getNodes().forEach(node => {
if(node.getChildMeshes().length == 0){
excludedNodes.push(node);
}
});
let options = {
shouldExportNode: function (node) {
return excludedNodes.indexOf(node) === -1;
}
};
BABYLON.GLTF2Export.GLBAsync(scene, "fileName",options).then((glb) => {
glb.downloadFiles();
});