Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting to binary file with library #659

Open
iiLearner opened this issue Apr 23, 2024 · 0 comments
Open

Converting to binary file with library #659

iiLearner opened this issue Apr 23, 2024 · 0 comments

Comments

@iiLearner
Copy link

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)
  })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant