Blinds/Trays and Lavs
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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_NAME>${child.name}</NODE_NAME>
|
||||
<ANIM_NAME>${anim.name}</ANIM_NAME>
|
||||
</UseTemplate>`
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,22 @@
|
||||
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_WINDOWBLINDS")) {
|
||||
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_Blind">
|
||||
<NODE_NAME>${child.name}</NODE_NAME>
|
||||
<ANIM_NAME>${anim.name}</ANIM_NAME>
|
||||
</UseTemplate>`
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,26 @@
|
||||
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_NAME>${node.name}</NODE_NAME>
|
||||
<ANIM_NAME>${anim.name}</ANIM_NAME>
|
||||
</UseTemplate>`
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,35 @@
|
||||
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(
|
||||
`<UseTemplate Name="MD11_TrayTable">
|
||||
<NODE_NAME>${child.name}</NODE_NAME>
|
||||
<ANIM_NAME>${anim.name}</ANIM_NAME>
|
||||
<ANIM_LENGTH>50</ANIM_LENGTH>
|
||||
<ANIM_LAG>50</ANIM_LAG>
|
||||
</UseTemplate>`
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user