This commit is contained in:
Brian Beck 2025-11-12 19:22:29 -08:00
parent 7de0355f3a
commit ee6ff28af5
11 changed files with 157 additions and 95 deletions

33
scripts/convert-dts.ts Normal file
View file

@ -0,0 +1,33 @@
import fs from "node:fs/promises";
import { execFileSync } from "node:child_process";
const blender = `/Applications/Blender.app/Contents/MacOS/Blender`;
/**
* Find all .dts files in `public/base` and convert them to glTF.
*/
async function run() {
for await (const inFile of fs.glob("public/base/**/*.dts")) {
const outFile = inFile.replace(/\.dts$/i, ".gltf");
execFileSync(
blender,
[
"--background",
"--python",
"scripts/blender/dts2gltf.py",
"--", // args after here go to the script
inFile,
outFile,
"--format",
"gltf",
// "--scale",
// "1.0",
// "--no-anims",
// "--only-visible",
],
{ stdio: "inherit" }
);
}
}
run();