← back to Quadrille Showroom

scripts/glbcheck.cjs

9 lines

const fs = require('fs');
const dir = require('path').join(__dirname, '..', 'public', 'models');
const names = ['sofa', 'office-chair'];
for (const n of names) {
  const p = require('path').join(dir, n + '.glb');
  const b = fs.readFileSync(p);
  console.log(n, 'magic:', b.slice(0, 4).toString('ascii'), 'ver:', b.readUInt32LE(4), 'declaredLen:', b.readUInt32LE(8), 'fileLen:', b.length);
}