import fs from "fs"; const file = fs.readFileSync("TFDi_MD11_PAX_CABIN_LOD0.gltf", { encoding: "utf-8", }); const model = JSON.parse(file); model.animations.forEach((anim) => { if (anim.name.includes("MD11_CAB_FIRST_TRAY")) { let done = false; anim.channels.forEach((channel) => { const id = Number.parseInt(channel.target.node); const node = model.nodes[id]; const child = model.nodes.find( (_child, index) => node && node.children && node.children.includes(index) && _child.name.includes("WheelArm") ); if (!done && child && child.name.includes("WheelArm")) { done = true; console.log( ` ${child.name} ${anim.name} 50 50 ` ); } }); } });