23 lines
534 B
JavaScript
23 lines
534 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_OVHDBIN")) {
|
|
const id = Number.parseInt(anim.channels[0].target.node);
|
|
const node = model.nodes[id];
|
|
|
|
const child = model.nodes[node.children[0]];
|
|
|
|
console.log(
|
|
`<UseTemplate Name="MD11_Bin">
|
|
<NODE_ID>${child.name}</NODE_ID>
|
|
<ANIM_NAME>${anim.name}</ANIM_NAME>
|
|
</UseTemplate>`
|
|
);
|
|
}
|
|
});
|