mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-04-22 12:55:39 +00:00
wip
This commit is contained in:
parent
7de0355f3a
commit
ee6ff28af5
11 changed files with 157 additions and 95 deletions
33
scripts/convert-dts.ts
Normal file
33
scripts/convert-dts.ts
Normal 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();
|
||||
Loading…
Add table
Add a link
Reference in a new issue