mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-01-19 12:14:47 +00:00
28 lines
637 B
TypeScript
28 lines
637 B
TypeScript
import fs from "node:fs/promises";
|
|
import { execFileSync } from "node:child_process";
|
|
|
|
const blender = `/Applications/Blender.app/Contents/MacOS/Blender`;
|
|
|
|
/**
|
|
* Find all .dif files in `public/base` and convert them to glTF.
|
|
*/
|
|
async function run() {
|
|
for await (const inFile of fs.glob("public/base/**/*.dif")) {
|
|
const outFile = inFile.replace(/\.dif$/i, ".gltf");
|
|
execFileSync(
|
|
blender,
|
|
[
|
|
"--background",
|
|
"--python",
|
|
"scripts/blender/dif2gltf.py",
|
|
"--", // args after here go to the script
|
|
inFile,
|
|
outFile,
|
|
],
|
|
{ stdio: "inherit" }
|
|
);
|
|
}
|
|
}
|
|
|
|
run();
|