Skip to content

Commit 2df53a2

Browse files
committed
Auto populate MATT and MATT if MATI is a path in material overrides script
1 parent a9f35f0 commit 2df53a2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/pages/material-overrides.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@ export default function MaterialOverrides() {
1717
const text = await file.text();
1818
try {
1919
const jsonData = JSON.parse(text);
20+
21+
if (jsonData.MATI.startsWith("[") && jsonData.MATI.endsWith(".pc_mi")) {
22+
jsonData.MATT = jsonData.MATI.replace(".pc_mi", ".pc_entitytype");
23+
jsonData.MATB = jsonData.MATI.replace(".pc_mi", ".pc_entityblueprint");
24+
}
25+
2026
const modified = appendOverrides(jsonData);
2127
const materialName = jsonData.Material.Instance[0].Name.replace("mi", "material");
22-
const blob = new Blob([JSON.stringify(modified, null, 2)], { type: "application/json" });
28+
const blob = new Blob([JSON.stringify(modified, null, 2)], { type: "application/json" });
2329

2430
const a = document.createElement("a");
2531
a.href = URL.createObjectURL(blob);

0 commit comments

Comments
 (0)