27 lines
647 B
JavaScript
27 lines
647 B
JavaScript
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_ECON_TRAY")) {
|
|
let done = false;
|
|
anim.channels.forEach((channel) => {
|
|
const id = Number.parseInt(channel.target.node);
|
|
const node = model.nodes[id];
|
|
|
|
if (!done && node.name.includes("Clip")) {
|
|
done = true;
|
|
console.log(
|
|
`<UseTemplate Name="MD11_TrayTable">
|
|
<NODE_ID>${node.name}</NODE_ID>
|
|
<ANIM_NAME>${anim.name}</ANIM_NAME>
|
|
</UseTemplate>`
|
|
);
|
|
}
|
|
});
|
|
}
|
|
});
|