This repository has been archived on 2026-10-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2026-03-18 13:18:52 -03:00

23 lines
779 B
JavaScript

const fs = require('fs');
function checkIndices(filePath) {
const buffer = fs.readFileSync(filePath);
const jsonLen = buffer.readUInt32LE(12);
const jsonBuf = buffer.slice(20, 20 + jsonLen);
const gltf = JSON.parse(jsonBuf.toString());
[37, 41].forEach(idx => {
console.log(`Node [${idx}]:`, gltf.nodes[idx] ? gltf.nodes[idx].name : 'OUT OF RANGE');
if (gltf.nodes[idx] && gltf.nodes[idx].mesh !== undefined) {
const meshIdx = gltf.nodes[idx].mesh;
console.log(` Mesh [${meshIdx}]:`, gltf.meshes[meshIdx].name);
}
});
[37, 41].forEach(idx => {
console.log(`Mesh [${idx}]:`, gltf.meshes[idx] ? gltf.meshes[idx].name : 'OUT OF RANGE');
});
}
checkIndices('Cabinet v2.5 con eje.glb');