Converting to binary file with library
iiLearner opened this issue · comments
Hi,
I'm trying to convert a gltf model into glb binary model, while this works well with cli by passing -b, it does not seem to be working with library. I'm probably missing a flag or something similar. The produced the glb is less than 1mb of size, while processed glb with cli is about 8mb (rightfully). What am I missing?
const options = {
resourceDirectory: productPath,
outputName: `${productPath}${modelName}.glb`,
}
const gltfToGlb = gltfPipeline.gltfToGlb
const gltf = fsExtra.readJsonSync(`${productPath}/${gltfFile}`)
await gltfToGlb(gltf, options).then(function (results: any) {
fsExtra.outputFile(options.outputName, results.glb)
})