adiciona modelo real
This commit is contained in:
1 parent
71d13753c9
commit
3a659a52c7
18 files changed
+612
-176
No files matched your search
@@ -0,0 +1,24 @@
|
||||
import { execFileSync } from "node:child_process";
|
||||
import { existsSync, mkdirSync } from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { SOURCES } from "./sources.mjs";
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const RAW_DIR = path.resolve(__dirname, "../raw");
|
||||
const CONVERTED_DIR = path.resolve(__dirname, "../converted");
|
||||
mkdirSync(CONVERTED_DIR, { recursive: true });
|
||||
|
||||
for (const { fbx, key } of SOURCES) {
|
||||
const inPath = path.join(RAW_DIR, fbx);
|
||||
const outPath = path.join(CONVERTED_DIR, `${key}.glb`);
|
||||
if (existsSync(outPath)) {
|
||||
console.log(`✓ já convertido: ${fbx}`);
|
||||
continue;
|
||||
}
|
||||
console.log(`⚙ convertendo ${fbx} → ${key}.glb ...`);
|
||||
execFileSync("assimp", ["export", inPath, outPath, "-f", "glb2"], { stdio: "inherit" });
|
||||
console.log(`✓ ${key}.glb gerado`);
|
||||
}
|
||||
|
||||
console.log("Conversão FBX → glTF concluída.");
|
||||
Reference in new issue
Block a user