Skip to content

Converting to binary file with library #659

@iiLearner

Description

@iiLearner

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions